Web Terminal (interactive)

Every session has a browser-based terminal: open it to watch the CLI live, and if you have permission, type into it directly. It works on desktop, tablet, and phone.

The one exception is the ZMX backend, which has no Web Terminal. Run botmux list or zmx attach on the host instead; see ZMX backend.

Web Terminal

How to open it

You want toDo thisYou get
See what the CLI is doingClick "🖥️ Open Web Terminal" on the terminal status cardRead-only terminal
Operate the CLI yourselfClick "🔑 Get Write Link" on the cardWritable terminal, sent to you privately
The card isn't handySend /term in the topicWritable terminal, sent to you privately
Look from the Dashboard"Open read-only terminal" / "Take over terminal" on the Sessions pageSee Dashboard

A write link never shows up in the group: in a regular group you get a "visible only to you" card; in topic groups, direct chats, or if that fails, it's sent to you by direct message. Clicking the button shows a "write link sent privately" toast; with /term, if it went by DM, the topic gets a short note saying so. Only people with operate permission (usually the bot admins) can get one; anyone else sees a "no permission" toast. See Permissions.

Read-only vs writable

Read-only terminalWritable terminal
Watch live output, scroll backYesYes
Type, press keys, pick menu itemsNo (a "read-only" banner shows at the top)Yes
Who can open itAnyone who has the link can watchAnyone who has the link can operate, so don't share it
Still works after a restartYes, links on old cards keep workingYes

Notes:

  • The link carries an access credential, so forwarding a link hands over view (or operate) access.
  • To let everyone in a group operate the terminal directly, enable writableTerminalLinkInCard on the bot. The card then gets a "🖥️ Open Writable Web Terminal" button that anyone who can see the card can use. Only turn it on in trusted groups; see Cards.

Using it on a phone

When you open a writable terminal on a phone or tablet, an input bar appears at the bottom:

  • Shortcut row (swipe sideways): Paste, Ctrl+C, Esc, Tab, arrow keys, ⌫, Enter, Shift+Tab. Use it to pick menu items, confirm permissions in Claude Code, or interrupt a run.
  • Input box, with a button on the left that switches between two input modes:
Mode (on-screen label)While you typeButton on the rightGood for
Buffer (缓冲, default)Text stays in the input box上屏 ("put on screen"): places the text in the CLI's input box without submitting; press Enter when it looks rightLonger text, IME input
Live (实时)Every keystroke goes straight to the terminal发送 ("send"): sends and presses EnterKey-by-key work, interactive menus

The chosen mode is saved on the server: the same session opens in the same mode on any device, and new sessions start with the most recent choice.

Three-way sync

The Lark topic, the Web Terminal, and the host's tmux all show the same CLI process. Typing in tmux on your computer, typing in the Web Terminal on your phone, and sending a message in Lark all have the same effect. To enter a session on the host, see tmux backend.

If you see a status page

MessageMeaningWhat to do
Terminal is startingThe session is restoring its terminalWait and refresh, or reopen from the latest card
Session suspendedThe session is asleep, and a read-only link won't wake itSend a message in the Lark topic, or sign in and reopen
Terminal unavailableThe session still exists, but its terminal can't be restored right nowTry again later, or send /restart in the Lark topic to restart the CLI
Terminal link expiredThe credential in the link no longer matchesGo back to Lark and reopen from the session's latest card
This session is closedThe session has endedCan't be viewed anymore; start a new topic if needed
Session not foundThe link is wrong, or the session was deletedCheck the link

Works on networks without internet access

Automatic, nothing to configure. The xterm.js library and its add-ons used by the terminal page are served by botmux itself from the same origin (bundled with botmux) instead of an external CDN, so the terminal opens fine on internal networks that can't reach the internet. They are public open-source library files and carry no session data. If the terminal page fails to start, only the first error is shown, which makes it easier to pin down.

Remote access (when your phone is on another network)

By default a terminal link looks like http://<host LAN IP>:<port>/s/<session ID> and only works from the same subnet. To open it from elsewhere, pick the option that fits:

Your setupDo thisThe link becomes
Connected to the central platform (remote access on and bound)Nothing extrahttps://t-<machineId>.<platform domain>/s/<session ID>
You reverse-proxy the Dashboard to a domain with nginx or similarSet BOTMUX_PUBLIC_URL<your domain>/s/<session ID>
botmux runs on a cloud host with a public addressSet WEB_EXTERNAL_HOSThttp://<public address>:<port>/s/<session ID>
botmux runs locally and you forward through a relay hostSee "Forwarding through a relay host" belowhttp://<relay address>:<port>/s/<session ID>

If more than one applies, the order is: central platform > BOTMUX_PUBLIC_URL > Devbox private short link > local address.

Through the central platform you sign in with single sign-on first: if you're recognized as the owner you can operate right away; everyone else gets read-only, and the read-only page shows an "owner sign in to operate →" link.

Environment variables go in ~/.botmux/.env; run botmux restart afterwards. Full reference: Environment variables.

Forwarding through a relay host

Use this when botmux runs on your local machine and there's another machine both sides can reach (a cloud host or a corporate-intranet machine).

# 1. Point terminal links at the relay host (write to ~/.botmux/.env, then botmux restart)
WEB_EXTERNAL_HOST=<relay host domain or IP>

# 2. On the machine running botmux, open a reverse tunnel to the relay host
autossh -M 0 -f -N -R 18800:localhost:8800 user@relay-host

# 3. On the relay host, bridge the public port onto the tunnel
#    (sshd usually disables GatewayPorts by default, so bridge in user space with socat)
socat TCP-LISTEN:8800,bind=0.0.0.0,reuseaddr,fork TCP:127.0.0.1:18800

How ports map:

  • Each bot has one terminal entry port: the 1st bot uses 8800, the 2nd 8801, and so on (change the base with BOTMUX_WEB_PROXY_BASE_PORT). By default the link uses that port, so the relay host must listen on the same port number (both ends use 8800 above).
  • To expose a different port on the relay host (e.g. 8800 locally, 9000 on the relay): set WEB_EXTERNAL_PORT=9000 and botmux restart; links switch to 9000 and the socat line becomes TCP-LISTEN:9000. With several bots it's also a base: the Nth bot uses 9000 + index, matching the local ports one-to-one, and the relay bridges each one.
  • The terminal page's WebSocket is same-origin with the page, so TCP-level forwarding passes it through with no extra config.

Before opening the port to a wider network, think about who can reach it: anyone with a read-only link can watch the terminal, and anyone with a write link can operate it.