cosmoremote
v2.2.3
Published
CosmoRemote bridge — connect your Mac to the CosmoRemote iOS/Android app to control Claude Code and Codex remotely
Maintainers
Readme
CosmoRemote Bridge
CLI daemon that runs on your Mac and connects Claude Code / Codex to the CosmoRemote app.
Setup
npm installRun
npm run dev # Development
cosmoremote start # Auto-detects the Appzinhos workspace root if launched inside it
cosmoremote start -w /path/to/Appzinhos # Optional override
cosmoremote start --port 4422 # Custom port
cosmoremote start --backend wss://your-backend.com # Enable remote relayLocal Debug Command
If you want a local command that always uses the checkout you are editing:
cd /path/to/CosmoRemote/bridge
npm install
npm run build
npm link
cosmoremote-debug # Auto-detects the Appzinhos workspace root if launched inside it
cosmoremote-debug --workdir /path/to/Appzinhoscosmoremote-debug defaults to the deployed backend relay. Pass --backend only if you need to override it.
Set COSMOREMOTE_WORKDIR=/path/to/Appzinhos if you want to force a specific workspace root.
Use npm run dev:debug while developing if you want to skip the global link step.
How it works
- Open Terminal in the project folder you want to work from
- Run
cosmoremote starton your Mac, orcosmoremote-debugfrom a linked local checkout - Detects which CLIs are available (Claude Code, Codex)
- Starts a local WebSocket server on port 4422
- Generates a pairing QR code with the workspace embedded
- App scans QR → connects via WebSocket
- App sends prompts → bridge spawns CLI process → streams output back
WebSocket Protocol
All messages use JSON envelope:
{ "type": "prompt|output|error|done|kill", "sessionId": "...", "content": "..." }Inbound (from app)
prompt— send a prompt to the CLI (includescli,workingDir)kill— kill a running session
Outbound (to app)
paired— pairing confirmed, includessessionTokenoutput— streaming output chunkerror— error messagedone— session complete, includes full output
