Your terminal, on the web
Kick off your coding agent, then go for a walk.
tui2web puts the session on your phone through a private, encrypted link, so you can check in, answer its questions and keep the work moving from anywhere.
Your agent keeps working. Monitor the progress. Go touch grass.
npm install -g tui2web
tui2web claude
via tui2web.com
tui2web --tailscale claude
fully private
With --tailscale, nothing goes through our servers: your computer runs the relay, and only your Tailscale devices can open the link.
Or try it without installing: npx tui2web claude. Requires Node.js 16+ on macOS, Linux or Windows.
Made with Opus 5.5
How it works
tui2web runs your command on your computer and streams it to a private web page. Your laptop and your phone share one live session, so wherever you are, your work is one tap away.
- Run it. Put
tui2webin front of any command. It prints a private link and a QR code, and waits for you to press Enter before starting the app. Lost it? Press Ctrl+\ to bring it back. - Scan the code. Open the link on your phone. You see the same screen your computer shows, with keys that phone keyboards are missing: Esc, Tab, Ctrl, the arrow keys and more.
- Go for a walk. Step away from your desk. Check in when your agent needs you, approve with a tap, and come back to finished work. Your computer's terminal keeps working normally the whole time.
Your agents work. You live your life.
Coding agents do most of their work on their own, then need a quick answer. With tui2web you can give it from a walk, the coffee line or the playground, over a link only you can open, instead of waiting at your desk.
- Works on any network. Your computer connects out to the relay, like ngrok, so there are no open ports for anyone to find. No port forwarding, VPN or firewall changes.
- Two-way sync. Keystrokes from your laptop and phone go to the same session. The screen resizes to fit whichever device you last typed on.
- Any terminal app. Claude Code, Codex, opencode, Oh My Pi, Gemini CLI, aider or a plain shell. If it runs in a terminal, it runs in tui2web.
- Secure by default. Private, unguessable links, an optional password, encrypted connections and rate-limited logins. Run your own relay, even privately on your Tailscale network.
Security
A tui2web link controls a real terminal on your computer, so it's locked down like a login.
Your computer (runs the command in a terminal) connects out over HTTPS to the tui2web.com relay (passes your session along and keeps its screen). Your phone connects to the relay over HTTPS, and needs the link or your password.
How access works
- Each session gets a random ID and a secret token. Nobody can open it without them.
- Opening the link logs that browser in and removes the token from the address bar, the way Jupyter does.
- Optionally set a password with
tui2web set-password. Only a salted hash leaves your computer. - Login attempts are rate limited, and the session closes when your command exits.
Treat the link like a password
Anyone with the link can type into your terminal, and a coding agent can run commands on your computer. Don't share the link, and end the session when you're done. Traffic is encrypted on the way to and from the relay, but the relay itself can see your session's contents. If that matters for your work, use Tailscale (below).
Leaving it running? Use Tailscale
For sessions that stay open for hours or overnight, run tui2web --tailscale claude. Your computer runs the relay itself, so the session never passes through tui2web.com, and only devices signed into your Tailscale account can reach it. Even a leaked link is useless to anyone else. tui2web use tailscale makes it the default. See the setup guide.
Cheat sheet
| Commands | |
|---|---|
tui2web <command> [args…] | Run a command and share it. For example tui2web claude, tui2web codex or tui2web opencode. |
tui2web ls | List your running sessions and their links, from any terminal. |
tui2web set-password | Set a password for opening your sessions without the link, handy when typing the URL on your phone. Only a hash is stored. |
tui2web clear-password | Remove the password. Sessions then only open with the link. |
tui2web autoconnect off | Start sessions disconnected, and connect from the link screen when you leave. tui2web autoconnect on switches back. |
tui2web use tailscale | Keep every session private on your Tailscale network by default. tui2web use public switches back. |
tui2web relay | Run your own relay. See the self-hosting guide. |
| While it’s running | |
| Ctrl+\ | Show the link and QR code again. Press any key to go back. |
| Ctrl+\ then d / c | Disconnect the session from the relay, or connect it again. The link stays the same, so connect only when you leave. |
| Options | |
--tailscale | (Recommended) Keep this session private: your computer runs the relay, and only your Tailscale devices can open the link. |
--disconnected | Start this session without connecting to the relay. The link is shown right away and works once you connect. |
--no-wait | Start the app right away instead of waiting for Enter on the link screen. |
--hotkey <key> | Change the Ctrl+\ key, for example ctrl-^ or ctrl-g, or turn it off with none. |
--no-password | For this session, only accept the link’s token, even if you’ve set a password. |
--no-qr | Don’t print the QR code. |
--relay <url> | Use your own relay (or set TUI2WEB_RELAY). |
FAQ
How do I use my coding agent from my phone?
Install tui2web with npm install -g tui2web, then put tui2web in front of the command you'd normally run: tui2web claude, tui2web codex, tui2web opencode and so on. It prints a private link and a QR code. Scan it with your phone and you get the same live session in your phone's browser, with extra keys like Esc, Tab and ⇧Tab.
Do I need SSH, a VPN or port forwarding?
No. Your computer makes an outbound connection to the relay, like ngrok does, so it works from home Wi-Fi, office networks and behind NAT without opening any ports or installing an SSH server.
How is this different from SSH-ing in from my phone?
With SSH you start a new, separate shell. tui2web shares the session that's already running on your computer, and both screens stay in sync. You can start your agent at your desk, carry on from your phone, and come back to find your laptop terminal exactly where you left it. It also works in any mobile browser, with no SSH app or keys.
Which apps does it work with?
Anything that runs in a terminal: Claude Code, Codex, opencode, Oh My Pi, Gemini CLI, aider, vim, or a plain shell. Full-screen apps work too. Press Ctrl+\ at any time to bring the link back.
Is it secure?
Each session has a random ID and a secret token, and nobody can open it without the link or your tui2web password. Traffic is encrypted on the way to and from the relay, but the relay can see what's in your session, so treat the link like a password. If that matters for your work, keep it on your own devices with Tailscale (see below).
How do I get a fully secure, private connection?
Use Tailscale. Install it on your computer and your phone, then run tui2web --tailscale <command>. Your computer runs the relay itself, so nothing goes through tui2web.com, and only your own Tailscale devices can reach it. Traffic between your phone and your computer is encrypted end to end with WireGuard, and nothing is exposed to the internet: no public relay, no open ports. Tailscale's servers only help your devices find each other and never see your terminal. Run tui2web use tailscale to make it the default, and add tui2web set-password for a second layer. See the self-hosting guide.
What happens if my connection drops?
The session reconnects on its own and the screen comes back as it was, including when the relay restarts. The app itself runs on your computer, so the computer needs to stay on and awake.
How do I update tui2web?
Run npm install -g tui2web@latest, then check with tui2web --version. Your password and settings in ~/.tui2web are kept. Sessions that are already running keep the old version until you restart them. If you use npx, npx tui2web@latest claude always runs the newest release. Self-hosting? tui2web relay updates along with the CLI; for Docker, rebuild the image.
Is tui2web free?
Yes. tui2web is free and open source under the MIT license. The code for the CLI, the relay and the web viewer is on GitHub.