+------------------------------------------------------------------+ | ______ __ _______ _ | | / ____/___ ____/ /__ /_ ___ _ __(_)___ | | / / / __ \/ __ / _ \ / / / / / / / / __ \ | | / /___/ /_/ / /_/ / __/ / / / / /_/ / / / / / | | \____/\____/\__,_/\___/ /_/ /_/\__,_/_/_/ /_/ | +------------------------------------------------------------------+ | TERMINAL-FIRST AI CODING AGENT + MOBILE | +------------------------------------------------------------------+
CodeTwin | Run local. Control anywhere.
CodeTwin is a terminal-first AI coding agent.
The CLI is the main product. Launching the CLI with no arguments opens the interactive TUI.
The mobile app is the remote control surface for the CLI agent running on your laptop.
Public links:
- Website: https://code-twin.vercel.app/
- GitHub: https://github.com/Sahnik0/CodeTwin
- Main experience: local CLI + TUI in your terminal.
- Companion mobile app for remote task control and approvals.
- Provider model: BYOK supported (bring your own API key).
- Free usage path: opencode provider supports no-cost models, with an upsell prompt when free usage is exhausted.
App: Flutter mobile remote companion.CLI: codetwin runtime, wrappers, and TUI.codetwin-remote-server: bridge between mobile app and worker.Website: landing/docs and install scripts.
Check if Bun is already installed:
bun --versionIf Bun is missing, run this install command:
powershell -c "irm https://bun.sh/install.ps1 | iex"Auto-check and install in one step:
if (Get-Command bun -ErrorAction SilentlyContinue) { bun --version } else { powershell -c "irm https://bun.sh/install.ps1 | iex" }After installation, open a new terminal and run bun --version again.
Windows PowerShell:
irm https://code-twin.vercel.app/install.ps1 | iexLinux/macOS:
curl -fsSL https://code-twin.vercel.app/install.sh | bashAfter install, open a new terminal and verify:
codetwin --helpIf you installed with one-liner, you can run codetwin from any project folder.
From your project folder:
codetwinThis starts the interactive CodeTwin TUI.
You can also run a one-shot task:
codetwin run "refactor auth module and add tests"You can tune autonomy per run using:
codetwin run "task" --dependence-level 3Option A: start with the built-in free usage path (opencode provider no-cost models).
Option B: BYOK for full provider choice and limits:
codetwin providers login
codetwin providers list
codetwin modelsSupported provider set includes OpenAI, Anthropic, Groq, Gemini, Mistral, Ollama, Azure, and others via the provider system.
Mobile connection is a core part of the CodeTwin idea, not an afterthought.
CodeTwin is built as a two-surface workflow:
- The CLI device (your laptop/desktop) runs the agent, tools, and file operations.
- The mobile app acts as your remote control layer for task submission, approvals, decisions, and live logs.
This design keeps execution and credentials on your own machine while giving you real-time control from anywhere.
Mobile app download link:
Remote pairing flow:
codetwin login https://codetwin-1quv.onrender.comThen:
- Copy the 12-character pairing code shown in terminal.
- Open the mobile app Pair screen.
- Enter the same bridge URL and pairing code.
- Start worker:
codetwin worker- Confirm the app shows your CLI device as connected.
QR flow (faster pairing):
- Open the mobile app Pair screen and tap Scan QR.
- Scan the pairing QR shown by your CLI environment.
- If QR is not available, use the 12-character code flow above.
CodeTwin has five dependence levels (autonomy levels). You can set them per run with --dependence-level.
Example:
codetwin run "refactor auth service" --dependence-level 3Level summary:
- Level 1 - Full supervision: asks before every write/delete/shell action.
- Level 2 - Reads are free: auto-allows read-only actions and asks before write-like actions.
- Level 3 - Smart checkpoints (default): allows most actions with explicit approval checkpoints.
- Level 4 - Destructive only: asks only for destructive classes.
- Level 5 - Full delegation: allows all actions and suppresses question prompts.
Valid range is 1 through 5. If omitted, behavior is equivalent to level 3.
Use this if you want to change CodeTwin code, not just use it.
- Git
- Bun
- Flutter SDK (only if editing mobile app)
- Android Studio/Xcode (only if building mobile targets)
git clone https://github.com/Sahnik0/CodeTwin.git
cd CodeTwinWindows:
.\CLI\codetwin.cmdLinux/macOS:
./CLI/codetwinWith no args, both wrappers open the TUI.
To verify launcher from source:
Windows:
.\CLI\codetwin.cmd --helpLinux/macOS:
./CLI/codetwin --helpIf you are just a normal user, skip this section.
cd App
flutter pub get
flutter runWindows:
.\CLI\codetwin.cmd login https://codetwin-1quv.onrender.com
.\CLI\codetwin.cmd workerLinux/macOS:
./CLI/codetwin login https://codetwin-1quv.onrender.com
./CLI/codetwin worker- Start TUI:
codetwin - One-shot task:
codetwin run "task" - Provider login:
codetwin providers login - List providers:
codetwin providers list - List models:
codetwin models - Pair remote app:
codetwin login <bridge-url> - Start remote worker:
codetwin worker - Set autonomy level:
codetwin run "task" --dependence-level <1..5> - Usage/cost stats:
codetwin stats
codetwinnot found after one-liner install:- open a new terminal
- ensure your PATH update is applied
bunnot found while running from source:- run
bun --version - if command not found, run
powershell -c "irm https://bun.sh/install.ps1 | iex" - open a new terminal and verify
bun --version
- run
- Pairing code expired:
- rerun
codetwin loginand enter the new code
- rerun
- Worker not connecting:
- confirm the same bridge URL is used in both CLI and app
- App not showing your device:
- confirm
codetwin workeris running - confirm laptop internet is available
- confirm
- Unexpected behavior at high autonomy:
- rerun with
--dependence-level 2or--dependence-level 3
- rerun with
- Free usage can be exhausted depending on provider path and limits.
- When exceeded on opencode free usage, the CLI may surface an upsell message.
- For production reliability, BYOK is recommended.
- Getting Started: https://code-twin.vercel.app/docs/getting-started
- Dependence Levels: https://code-twin.vercel.app/docs/dependence-levels
- Mobile Connection: https://code-twin.vercel.app/docs/mobile-connection
- Remote Control: https://code-twin.vercel.app/docs/remote-control
- CLI Reference: https://code-twin.vercel.app/docs/cli-reference