Remote Control

CodeTwin supports remote control through a bridge workflow. This mobile-to-CLI connection is a key part of CodeTwin's USP: control an agent running on your laptop from your phone.

Architecture at a glance

  • CLI device: runs CodeTwin and the worker.
  • Mobile app: sends tasks, approvals, and decisions.
  • Bridge server: relays messages between app and worker.

Mobile app download:

  • Google Drive: https://drive.google.com/drive/folders/12f3pnUAb6GOitnHyF_JeRF02tre8YJ8N?usp=sharing
  1. Pair CLI with bridge:
bash
codetwin login https://codetwin-1quv.onrender.com
  1. Copy the 12-character pairing code shown in terminal.
  2. Open mobile app Pair screen and enter the same bridge URL and code.
  3. Start worker:
bash
codetwin worker
  1. Confirm status in the app is connected.

QR pairing flow (fast path)

If you prefer scanning instead of typing the pairing code:

  1. Open the mobile app Pair screen and tap Scan QR.
  2. Scan the pairing QR shown by your CLI environment.
  3. Confirm pairing in the app, then run worker if needed.

For local source installs, use your launcher path:

  • Windows: .\CLI\codetwin.cmd login ... and .\CLI\codetwin.cmd worker
  • Linux/macOS: ./CLI/codetwin login ... and ./CLI/codetwin worker

Local pairing host flow (advanced)

You can host a local pairing session and share a secure pair code:

bash
codetwin pair host

Join from another client with:

bash
codetwin attach --pair-code <pair-code>

What you can do remotely

  • Submit natural language tasks
  • Approve or reject pre-flight maps
  • Watch the full agent log stream in real time
  • Cancel a running task
  • Change the dependence level mid-task

Security model

  • Pairing codes are short-lived and one-time use.
  • Worker credentials are stored locally on the CLI device.
  • Mobile app stores its own scoped client credential.

Normal users do not need to manually supply REMOTE_EXEC_TOKEN for this flow.

Troubleshooting

  • Pairing code expired: run login again to generate a new code.
  • Worker not connecting: verify the same bridge URL is used for both app and CLI.
  • App not showing your device: confirm worker is running and laptop internet is available.
  • Credentials stale: re-run login, then restart worker.