shellphone
Pipe any CLI command to a secure, mobile-friendly web terminal. Run a command, scan the QR code, interact from your phone.
# shellphone run [OPTIONS] <CMD>...
$ shellphone run --tunnel cloudflared claude --resume my-session-id
▄▄▄▄▄▄▄ ▄▄▄ ▄▄▄▄▄▄▄
█ ▄▄▄ █ ▀▄ ▀█▄▀▄▄ █ ▄▄▄ █
█ ███ █ ▀█▀ ▀█▀█ █ ███ █
█▄▄▄▄▄█ ▄ ▄▀▄ ▄ ▄ █▄▄▄▄▄█
▄ ▄▄ ▄▄▄▀▀▄▄█ ▄ ▄ ▄ ▄▄
▄▄ ███▄ ▄ ▀ ██ ▀▀▄ ▄▄█▀
▄▀ ▀▄▄ ▀▄▄ ██▄▀▄▄▀▄▀█
█ ▄ ▀▄▀██▀▀▄▄█▀▄▄▀█▀▄ █▀
▀ ▀▀█▀▄▀███▄▀▄ ▀█▄█▄▄▀▄ ▀
▄▄▄▄▄▄▄ ██▀▄█▀▄▀█ ▄ █▄▀█▄
█ ▄▄▄ █ ▀█▄▄█▄ ▀█▄▄▄█▀ █▀
█ ███ █ █▄▀▄██ ▀██ ██▀█▀
█▄▄▄▄▄█ ▄ ▀ ▄ ▄▀ █▄ ▀▀█▄▄
→ https://my-cloudflare-tunnel.trycloudflare.com/t/a1b2c3d4e5f6
How it works
shellphone spawns your command in a pseudo-terminal, serves a wterm web UI over WebSocket, and optionally tunnels it to the internet. Authentication uses a one-time token embedded in the QR code — consumed on first connection, replaced with a refresh token for reconnection.
Features
- Single binary — frontend bundled and embedded at compile time
- wterm terminal — DOM-based rendering with native text selection and smooth scrolling
- Mobile toolbar — Esc, Tab, arrow keys, Enter (touch devices only)
- TUI scroll support — swipe to scroll in Claude Code, vim, less, etc.
- Agent shortcuts —
shellphone agent claudeto resume sessions directly - Tunnel auto-detection — cloudflared, ngrok, bore, tailscale, or custom commands
- One-time token auth with refresh token for reconnection
- Built-in TLS — self-signed certs with
--tls, fingerprint printed for TOFU - Virtual keyboard support — terminal resizes when the keyboard appears
- Graceful shutdown — exits when the command finishes
Install
Needs a Rust toolchain. If you don't have one:
# or, any platform, via rustup:
|
Then install from crates.io:
Or build from a clone of this repo:
# or just: cargo build --release → binary at target/release/shellphone
Usage
Run any command
shellphone run [OPTIONS] <CMD>...
Examples:
Resume an agent session
shellphone agent [OPTIONS] [AGENT] [SESSION]
Supported agents: claude, codex, opencode
Examples:
Attach from another terminal
shellphone attach [OPTIONS] <URL>
Connect to a running shellphone session from any terminal — no browser needed. Uses the same one-time token for initial auth, then reconnects automatically via refresh token if the connection drops.
Options
--tunnel <PROVIDER> auto, cloudflared, ngrok, bore, tailscale, custom, none [default: auto]
--tunnel-cmd <CMD> Custom tunnel command ({port} placeholder)
--tls Enable built-in TLS with self-signed certificate
--bind <ADDR> Bind address [default: 127.0.0.1:3845]
Security
- Server binds to localhost only (unless
--tlswith--bind 0.0.0.0) - 256-bit one-time token, consumed on first connection
- Constant-time token comparison (
subtle) - Refresh token for reconnection, dies with the process
- TLS via tunnel or built-in self-signed certs
- QR code cleared from terminal after client connects
Building the frontend
The frontend uses wterm and requires a build step:
The built frontend is committed to the repo, so this is only needed when modifying the terminal UI.