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
Hosted bridge flow (recommended)
- Pair CLI with bridge:
bash
codetwin login https://codetwin-1quv.onrender.com- Copy the 12-character pairing code shown in terminal.
- Open mobile app Pair screen and enter the same bridge URL and code.
- Start worker:
bash
codetwin worker- Confirm status in the app is connected.
QR pairing flow (fast path)
If you prefer scanning instead of typing the pairing code:
- Open the mobile app Pair screen and tap Scan QR.
- Scan the pairing QR shown by your CLI environment.
- 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 hostJoin 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.