Termbridge

CLI Reference

Basic usage

Just run the command - no arguments needed:

npx termbridge

This starts everything: local server, tmux session, and the default Cloudflare tunnel.

Running termbridge without a subcommand is equivalent to termbridge start.

You can also run termbridge start explicitly with all flags:

termbridge start --port 8080 --proxy 5173 --session dev --kill-on-exit --no-qr --tunnel cloudflare

Flags

FlagWhat it doesDefault
--port <port>Use a specific port instead of a random oneRandom
--proxy <port>Proxy a local dev server (enables Terminal/Preview views)-
--session <name>Name your tmux sessionAuto-generated
--kill-on-exitClean up tmux sessions when Termbridge exitsOff
--no-qrDon't print the QR code (useful for scripts)Off
--no-tunnelDisable the tunnel (requires --public-url)Off
--public-url <url>Public URL when tunnel is disabled-
--tunnel cloudflareTunnel provider (cloudflare or none)cloudflare
--backend <backend>Terminal backend (tmux or sandbox-daytona)tmux
--tunnel-token <token>Use a named Cloudflare Tunnel token (requires --port)-
--tunnel-url <url>Public URL for the named tunnel (required with --tunnel-token)-
--sandbox-daytona-repo <url>Repo URL for Daytona sandbox-
--sandbox-daytona-branch <branch>Branch for Daytona sandbox-
--sandbox-daytona-path <path>Repo path in the sandbox-
--sandbox-daytona-name <name>Sandbox name-
--sandbox-daytona-preview-port <port>Preview port in the sandbox-
--sandbox-daytona-publicCreate a public sandboxOff
--sandbox-daytona-directRun the server inside the Daytona sandbox (no tunnel)Off

Examples

Attach to an existing tmux session

If you already have a tmux session running:

termbridge --session my-session

Fixed port and custom session

termbridge --port 8080 --session codex

Clean exit (no leftover sessions)

termbridge --kill-on-exit

Scripting (no QR output)

termbridge --no-qr

Proxy a Vite dev server

# Start your Vite app first
cd my-app && npm run dev  # runs on port 5173

# Then start Termbridge with proxy
termbridge --proxy 5173

Use the Views button to switch between Terminal and Preview. Preview loads your app through the proxy with HMR support.

Named Cloudflare tunnel (token-based)

If you have a Cloudflare account and want to avoid trycloudflare rate limits:

termbridge --port 8080 --tunnel-token <TOKEN> --tunnel-url https://term.example.com

Disable the tunnel (bring your own public URL)

termbridge --no-tunnel --public-url https://example.com

Environment variables

Core settings

VariableWhat it does
TERMBRIDGE_SESSIONS=2Create multiple tmux sessions on startup
TERMBRIDGE_PUBLIC_URL=https://example.comPublic URL when tunnel is disabled
TERMBRIDGE_TUNNEL=noneDisable the tunnel
TERMBRIDGE_TUNNEL_TOKEN=<token>Named tunnel token (requires TERMBRIDGE_TUNNEL_URL)
TERMBRIDGE_TUNNEL_URL=https://term.example.comPublic URL for the named tunnel

Development

VariableWhat it does
TERMBRIDGE_INSECURE_COOKIE=1Allow HTTP cookies (local dev only)
TERMBRIDGE_PROXY_PORT=5173Proxy port for dev:beam:proxy script
TERMBRIDGE_DEV_UI=http://127.0.0.1:5000Override Vite dev UI URL
TERMBRIDGE_DEV_PORT=3000Override Termbridge server port in dev

Sandbox (Daytona)

VariableWhat it does
TERMBRIDGE_BACKEND=sandbox-daytonaUse the Daytona sandbox backend
TERMBRIDGE_SANDBOX_DIRECT=trueRun Termbridge inside the sandbox
TERMBRIDGE_SANDBOX_SERVER_PORT=8080Port for the sandboxed server
TERMBRIDGE_SANDBOX_AGENTS=claude-code,codexAuto-install + sync auth for agents
TERMBRIDGE_SANDBOX_AGENT_ENV=...Extra env vars to forward
TERMBRIDGE_SANDBOX_AGENT_AUTH_PATHS=...Local auth files to sync

For full Daytona configuration, see the Daytona guide.

Stopping Termbridge

Press Ctrl+C in the terminal where Termbridge is running. This:

  • Closes the tunnel (if enabled)
  • Stops the local server
  • Keeps tmux sessions alive (unless you used --kill-on-exit)

Your tmux sessions persist by default, so you can reconnect later.

On this page