Reverse connection, no public IP
The adapter on your PC makes outbound connections only — no public IP, port mapping or tunnel. Any firewall or corporate network just works.
tunnelbox puts opencode, Claude Code, Codex, DeepSeek Harness, OpenClaw, Hermes and Cursor in your pocket — watch streaming output, fire off tasks, and approve risky actions. No public IP, no port forwarding.
$ opencode serve --print-logs
[tunnelbox] Connected to relay wss://relay.tunnelbox.top …
[tunnelbox] Pairing code: 8F3K-9Q2Z (valid for 10 minutes)
[tunnelbox] Scan the QR with your phone to start:
└ or open the tunnelbox App on your phone and enter the code manually
[tunnelbox] ✓ agent registered agentID: opencode-main
[tunnelbox] ✓ Waiting for phone connection …▍
Core features
A unified remote gateway on top of the CLI / headless agent ecosystem — sessions, streaming, permissions and commands, normalized into one protocol.
The adapter on your PC makes outbound connections only — no public IP, port mapping or tunnel. Any firewall or corporate network just works.
Run opencode, Claude Code, Codex and more side by side. Each pairs and connects independently; switch between them on your phone, even compare agents on the same task.
Before bash or file edits run, the permission request is pushed to a card on your phone — allow / deny / always-allow in one tap. Nothing dangerous is auto-approved.
The terminal prints a QR code and pairing code. Use “Scan to pair” in the tunnelbox App to connect instantly; codes are single-use and expire in 10 minutes.
Session lists / streaming output / permission approvals / slash commands are all normalized into one protocol — your phone never cares which agent is behind it.
The relay only does stateless forwarding and stores no conversation content. Transport is fully TLS. Privacy-sensitive users can self-host the relay and stay in control.
Supported agents
Each agent maps to an adapter that normalizes its sessions / streaming / permissions into the unified remote protocol — zero awareness for the relay and your phone.
| Agent | Adapter | Type | Status |
|---|---|---|---|
| O opencode | In-process plugin (@tunnelbox/opencode) | A | ✅ MVP · Implemented |
| DS DeepSeek Harness (dsh) | Native Cordis plugin (@tunnelbox/dsh-tunnelbox) | B | ✅ Implemented |
| CC Claude Code | claude-agent-sdk bridge (separate process) | B | ✅ Implemented |
| CX Codex | codex app-server bridge (separate process) | B | ✅ Implemented |
| OW OpenClaw | Official Gateway operator WS | B | ✅ Implemented · e2e pending |
| HM Hermes | hermes chat -Q -q oneshot bridge (+ Native plugin) | B | ✅ Implemented · experimental |
| CS Cursor | Cursor CLI agent -p headless (separate process) | B | ✅ Implemented · experimental |
A In-process plugin · runs inside the agent server process · B CLI / headless bridge · a separate connector process drives the non-interactive mode. Multiple instances of the same type are supported (opencode1 / opencode2 …).
How it works
A unified remote gateway for the agent ecosystem: your phone connects to the relay, and adapters on your PC connect back — messages flow both ways.
Android · iOS App
Cloud server · self-hostable
Agent adapters
Reverse connections punch through NAT and firewalls naturally — office networks and dorms work fine, with no public IP or tunnel service.
Low cost and easy to scale. Nodes are stateless and reconnect automatically; session data always lives only in your agent’s local storage on the PC.
After the first scan you get a session token and reconnect automatically. With MySQL configured, a relay restart does not require re-pairing either.
Download
Download the tunnelbox App from the official website (Android & iOS are both available). Scan the QR code or tap a button below.
Scan to download the App
Native mobile app: scan-to-pair, remote sessions, streaming output, risky-action approvals and push notifications.
Tutorial
Every agent follows the same path: install the adapter on your PC → scan with your phone → go. The setup manual below gives foolproof step-by-step commands for each agent — copy them with one click.
Install and run the adapter for your agent (commands in the "Setup manual" below). Once running, the terminal prints a QR code + pairing code.
Download and install the tunnelbox App (Android & iOS) from the official website, then sign in.
Tap "Scan to pair" and point it at the terminal QR code to connect automatically — or type the pairing code manually. The agent appears on your home list once paired.
Open the agent chat page: switch / create sessions via tabs, send prompts, watch streaming output render in real time, approve risky actions on the card, and hit "Stop" whenever you want.
Pick your agent below and follow the steps one by one — every command has a one-click copy button.
First install opencode itself (official one-liner for macOS / Linux; on Windows use WSL, or Chocolatey / Scoop):
# macOS / Linux (official one-line installer)
curl -fsSL https://opencode.ai/install | bash
# Windows (PowerShell): Chocolatey / Scoop / WSL
choco install opencodeAfter install, opencode --version should print a version number.
// opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@tunnelbox/opencode"]
}--print-logs recommended); the plugin connects to the relay and prints a QR code + pairing code. Inside opencode you can also ask to “show phone pairing code” or type /pair anytime to get the pairing code and a scan-able QR right in the chat.opencode serve --print-logs✅ You’re done when the terminal shows the [tunnelbox] QR code — scan it with your phone to pair.
No config is needed for the official relay. To use your own relay, set the TUNNELBOX_RELAY_URL env var, or pass options.relayUrl via the object form in opencode.json:
// opencode.json (custom relay)
{
"plugin": [{ "package": "@tunnelbox/opencode", "options": { "relayUrl": "wss://relay.tunnelbox.top" } }]
}State lives in ~/.config/opencode/remote-state.json. You can run several adapters on one PC — each pairs independently and the phone lets you switch between them with one tap.
First install Claude Code itself (official native installer — auto-updates, no extra runtime needed):
# macOS / Linux / WSL (official native installer)
curl -fsSL https://claude.ai/install.sh | bash
# Windows PowerShell
irm https://claude.ai/install.ps1 | iexAfter install, claude --version should work; sign in with a paid Claude account on first launch.
# no repo clone needed
npm install -g @tunnelbox/claude-codetunnelbox-claude-code✅ You’re done when the QR code appears — scan it with your phone.
All optional. Common example:
TUNNELBOX_RELAY_URL=wss://relay.tunnelbox.top \
TUNNELBOX_CWD=D:/workspace/project \
TUNNELBOX_CLAUDE_MODE=plan \
tunnelbox-claude-codeTool approvals are pushed to your phone by default (allow / deny / always-allow). On disconnect or a 120s timeout the request is automatically denied (fail-closed) — nothing is auto-approved. Modes: default / plan / acceptEdits / bypassPermissions.
codex app-server subcommandFirst install the Codex CLI itself (official installer or npm):
# macOS / Linux (official installer)
curl -fsSL https://chatgpt.com/codex/install.sh | sh
# Windows PowerShell
irm https://chatgpt.com/codex/install.ps1 | iex
# or Node: npm install -g @openai/codex
npm install -g @openai/codexVerify with codex --version, then codex login to sign in. Adapter self-check: tunnelbox-codex --check (confirms codex app-server is available).
# no repo clone needed
npm install -g @tunnelbox/codextunnelbox-codex✅ You’re done when the QR code appears — scan it with your phone.
All optional. Common example:
TUNNELBOX_RELAY_URL=wss://relay.tunnelbox.top \
TUNNELBOX_CODEX_SANDBOX=workspace-write \
tunnelbox-codex
# optional: TUNNELBOX_CODEX_APPSERVER_ARGS="--stdio"Approvals and choices are native: codex sends tool-approval requests and multiple-choice questions straight to your phone (allow / deny, pick an option), and its reasoning streams live. Disconnect / timeout are auto-denied (fail-closed). What's allowed is still bounded by TUNNELBOX_CODEX_SANDBOX (read-only / workspace-write / danger-full-access).
$DSH_HOME/.credentials.yaml, default ~/.dsh)First install dsh itself (DeepSeek’s official npm package; requires Node.js ^22.19 or >=24):
# Install dsh globally (official package)
npm install -g @deepseek-ai/dsh
# or try instantly: npx @deepseek-ai/dsh webAfter install, dsh --version should work; on first use configure a DeepSeek API key (stored in $DSH_HOME/.credentials.yaml).
dsh plugin --profile tunnelbox add @tunnelbox/dsh-tunnelbox
dsh --profile tunnelbox --dump-config # verify the tunnelbox-dsh layerdsh --profile tunnelbox✅ You’re done when the QR code appears. Model / working directory can be set in the profile’s cordis.yml.
All optional. Profile config example (cordis.patch.yml):
- id: tunnelbox-dsh
config:
relayUrl: 'wss://relay.tunnelbox.top'
model: 'deepseek-v4-flash'
cwd: 'D:/workspace/project'Approvals follow dsh’s approval / sandbox-policy (default workspace-write + ask) — risky actions are pushed to your phone. Run multiple instances with separate DSH_HOME values.
First install OpenClaw (official installer) and complete the onboard wizard:
# macOS / Linux (official installer)
curl -fsSL https://openclaw.ai/install.sh | bash
# Windows PowerShell
iwr -useb https://openclaw.ai/install.ps1 | iex
# finish the setup wizard after install
openclaw onboardYou’re ready once openclaw works and the Gateway is running.
# no repo clone needed
npm install -g @tunnelbox/openclawThe first time the adapter connects to your local Gateway it requests device pairing — approve it manually:
openclaw devices list # note the requestId
openclaw devices approve <requestId>tunnelbox-openclaw✅ After approving the device, the QR code appears — scan it with your phone to pair.
All optional. Common example:
TUNNELBOX_RELAY_URL=wss://relay.tunnelbox.top \
TUNNELBOX_OPENCLAW_GATEWAY_URL=ws://127.0.0.1:18789 \
tunnelbox-openclawDeleting a session archives it (the Gateway has no hard delete). The bootstrap token for first pairing can be set via openclaw configure --section gateway or TUNNELBOX_OPENCLAW_TOKEN.
hermes setup)First install Hermes Agent (official installer) and finish setup:
# official installer
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
# finish setup after install
hermes setupYou’re ready when hermes chat -Q -q "hi" responds.
# no repo clone needed
npm install -g @tunnelbox/hermestunnelbox-hermes✅ You’re done when the QR code appears — scan it with your phone.
All optional. Common example:
TUNNELBOX_RELAY_URL=wss://relay.tunnelbox.top \
TUNNELBOX_HERMES_MODEL="anthropic/claude-sonnet-4" \
tunnelbox-hermesNote: this headless adapter does not provide phone approval; dangerous operations are governed by hermes’s own security policy (fail-closed). Sessions continue on the real Hermes session (the id is auto-discovered after the first turn). Interactive-session approval/question flows live in the official Hermes native plugin (native-plugin/).
First install the Cursor CLI itself (official installer):
# macOS / Linux (official installer)
curl https://cursor.com/install -fsS | bash
# Windows PowerShell
irm 'https://cursor.com/install?win32=true' | iexYou’re ready when agent -p "hello" outputs normally (headless usage is billed by Cursor).
# no repo clone needed
npm install -g @tunnelbox/cursortunnelbox-cursor✅ You’re done when the QR code appears — scan it with your phone.
All optional. Common example (plan mode + allow file edits):
TUNNELBOX_RELAY_URL=wss://relay.tunnelbox.top \
TUNNELBOX_CURSOR_MODE=plan \
TUNNELBOX_CURSOR_FORCE=1 \
tunnelbox-cursorPhone approval is not possible (Cursor hooks are IDE / Cloud-agent only; headless agent -p has no external approval relay), and print mode suppresses thinking (no reasoning cards). What runs is decided by permissions allow/deny + --force/--yolo + --sandbox. Read-only by default (no --force: the agent only proposes, it doesn’t edit). Set TUNNELBOX_CURSOR_FORCE=1 to actually edit files. No CLI yet? macOS / Linux: curl https://cursor.com/install -fsS | bash; Windows: irm 'https://cursor.com/install?win32=true' | iex.
plugin/ in the repo.docker compose up -d deploys the relay in one command (optional MySQL persistence). An nginx.conf template provides reverse-proxy HTTPS; set NATS_URL to scale out to multiple nodes.FAQ
Yes. The adapter on your PC only makes outbound WebSocket connections (a reverse connection). No public IP, port forwarding or tunnel needed; it punches through NAT and firewalls, so corporate networks work fine.
The relay only does stateless forwarding and stores no conversation content. Transport is fully TLS; pairing codes are single-use and expire in 10 minutes; session tokens are stored as SHA-256 hashes. Privacy-sensitive users can self-host the relay so data stays on their own server.
Only in the agent’s local storage on your PC. The app fetches history from your computer in real time when you open a session; it is unreachable while the PC is off or the plugin is offline. The relay does no cloud sync or backup — that is the deliberate privacy-friendly, low-cost trade-off.
opencode, Claude Code, Codex, DeepSeek Harness, OpenClaw, Hermes and Cursor are supported, and multiple instances of the same type are allowed (e.g. opencode1 / opencode2). Each pairs and connects independently — switch between them from your phone list, or let different agents run the same task for a side-by-side comparison.
Yes. When tools such as bash or file edits are invoked, the request follows each agent’s native ask / approval model and is pushed to your phone — it only runs after you allow or deny. You may also pick “always allow” for a tool for the current session.
Free and open source (see the LICENSE in the repo). The relay is self-hostable: Docker / docker compose deploys it in one command, with HTTPS via an nginx reverse proxy, MySQL persistence and NATS multi-node scaling. Android / iOS apps are available on the official website.
tunnelbox is built around remote control from your phone: relay reverse-connection plus native Android / iOS apps, so you can drive several CLI agents on your PC from anywhere. A unified protocol, a stateless relay and self-hosting friendliness make it easy to run and manage many agents on a single machine.
Install the adapter on your PC, pull out your phone and scan. All your agents, ready to serve.