Environment Variables and File Locations
Most settings live in bots.json and the Dashboard, so you usually don't need environment variables. Only a few machine-wide switches (bind address, ports, external address, backend type, and so on) go in ~/.botmux/.env. This page lists those switches and where botmux keeps its key files, for backup and troubleshooting.
When to read this page: the Dashboard or web terminal won't open, you need to change a bind address or port, terminal links show the wrong address, you want the pty backend, or you're looking for config / logs / data.
This page covers botmux's own processes. To control which variables the CLI inside a session receives, use the Dashboard: "Settings → Session environment" (global) or "Bot settings → Advanced → Startup environment → Session environment" (per bot). See bots.json → Session environment.
How to change a setting
-
Edit
~/.botmux/.env, oneKEY=valueper line: -
Restart to apply:
Put values in the file instead of only exporting them in a shell. A restart that a bot runs from inside a Feishu session reads only ~/.botmux/.env and does not inherit your shell. A value you only exported is lost on the next in-session restart.
Network and access addresses
These decide whether other people can open web terminal and Dashboard links.
Which address Dashboard links use: central platform (when remote access is on) >
BOTMUX_PUBLIC_URL> Devbox short link > localhost:port. Terminal links follow the same order, minus the Devbox short link.
Dashboard access control
Open the Dashboard from Feishu without logging in (optional)
Off by default. When on, you can open the Dashboard straight from a Feishu H5 app without a token in the link; only users on the allow list get in.
These variables (including the app secret) are used only by the Dashboard process. Bot background processes and session CLIs never receive them.
Sessions and behavior
BOTMUX_ASK_TIMEOUT_MS and BOTMUX_PERMISSION_TIMEOUT_MS are read by the CLI inside the session, which inherits them from ~/.botmux/.env by default. Because they start with BOTMUX, they are botmux-reserved and can't be set per bot in the session environment. When a bot uses strict process environment, they don't reach the session and the defaults apply.
Set BOTMUX_WORKTREE_CREATE_TIMEOUT_MS=180000 in ~/.botmux/.env and restart botmux to give slow checkout hooks a 3-minute budget. This applies to shared creation flows: automatic session worktrees, the repository picker, /repo wt, /tw, multi-repository worktrees, isolated member worktrees, and restoration of deleted worktrees. It only changes each git worktree add budget, not fetch, push, cleanup, target lock waits, or the total creation time. Existing worktree reuse rules remain unchanged. When creation throws, ordinary automatic creation falls back to the default directory, the local oncall sandbox refuses to start, and explicit requests report the error to the caller.
Name worktrees with AI (optional)
Off by default. When botmux auto-names a new worktree branch (e.g. /repo wt), it uses a local naming rule. When on, it calls an OpenAI-compatible API you configure instead, and sends the topic title / first message to that API. When off, incomplete, or the request fails, the local rule is used.
Host overload alert
Turn the overload alert on and pick the notification bot on the Dashboard "Global Settings" page (see Global Settings). The variables below fine-tune the thresholds; the enter thresholds take priority over the values on the page.
Exit thresholds must be lower than enter thresholds. If one isn't, botmux sets it to 95% of the enter threshold and logs a warning.
Paths, logs, and GitHub
GITHUB_TOKEN / GH_TOKEN are used only for botmux's own GitHub requests and are not passed to session CLIs by default. If a bot's sessions need one, add it to that bot's session environment.
Advanced / special environments
Notes on BOTMUX_LOOPBACK_PEERS:
- Empty by default: only
127.0.0.1and::1are accepted, same as older versions. - It relaxes only the "request must come from this machine" check. Signature, timestamp, and replay checks still apply, so a badly signed request is still rejected.
- Entries that are too broad (
/0–/7) or malformed are ignored with a startup warning. - Prefer a single address (
/32) or the smallest real subnet. Write IPv4 addresses in IPv4 form:10.0.0.0/8covers both plain IPv4 and the dual-stack::ffff:10.xform.
File locations
For backups, keep at least bots.json, .env, config.json, and data/.
