Getting Started
CodeTwin is a terminal-first AI coding agent that runs on your machine. This guide covers installation, provider authentication, your first task, and mobile connection.
Installation
Verify Bun (Windows)
Check whether Bun is already installed:
bun --versionIf Bun is not installed, run:
powershell -c "irm https://bun.sh/install.ps1 | iex"Windows one-step verify + install:
if (Get-Command bun -ErrorAction SilentlyContinue) { bun --version } else { powershell -c "irm https://bun.sh/install.ps1 | iex" }Windows one-liner (PowerShell)
irm https://code-twin.vercel.app/install.ps1 | iexLinux/macOS one-liner
curl -fsSL https://code-twin.vercel.app/install.sh | bashOpen a new terminal, then verify:
codetwin --helpIf you installed with one-liner, start the TUI from any project folder using:
codetwinSource install (Windows, Linux, macOS)
git clone https://github.com/Sahnik0/CodeTwin.git
cd CodeTwinRun the launcher from the repository:
./CLI/codetwin --helpWindows equivalent:
.\CLI\codetwin.cmd --helpProvider authentication
CodeTwin supports both:
- limited free usage path (opencode no-cost models), and
- BYOK (bring your own API key) across providers.
Authenticate a provider and verify saved credentials:
codetwin providers login
codetwin providers listList available models for a provider:
codetwin models openaiFirst task
Interactive TUI:
codetwinOne-shot command mode:
codetwin run "refactor auth module to use JWT"Override autonomy for a single run:
codetwin run "add tests for auth middleware" --dependence-level 3Mobile connection (CodeTwin USP)
Mobile connection is one of CodeTwin's core differentiators: your laptop runs the agent while your phone can monitor, approve, and steer runs remotely.
If you are only using local CLI/TUI, you can skip this section.
Mobile app download:
- Google Drive: https://drive.google.com/drive/folders/12f3pnUAb6GOitnHyF_JeRF02tre8YJ8N?usp=sharing
- Pair this CLI device with a bridge:
codetwin login https://codetwin-1quv.onrender.com- Copy the 12-character pairing code printed in terminal.
- Open the mobile app Pair screen.
- Enter the same bridge URL and code.
- Start worker:
codetwin worker- Confirm the app shows your CLI device as connected.
QR flow (if available in your app build):
- 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 method above.
For local source installs, use the repo launcher variants:
- Windows: .\CLI\codetwin.cmd login ... and .\CLI\codetwin.cmd worker
- Linux/macOS: ./CLI/codetwin login ... and ./CLI/codetwin worker
For complete details and troubleshooting, see Mobile Connection and Remote Control.
Config locations
CodeTwin reads config from standard project/global locations, including:
- codetwin.json or codetwin.jsonc
- .codetwin directory in your repository hierarchy
- your OS global config directory
Use the same command everywhere; only the launcher path differs by installation method.