Multi-CLI Adapters
botmux bridges different CLIs through adapters, selected via cliId in bots.json. One-click switching, process isolation.
Supported CLIs
There are also community-contributed integrations such as MTR, ttadk, and Mira. The
modelfield only takes effect for adapters that support a model parameter; others ignore it.
Mir CLI and MCP Bridge
When you choose Mira -> Mir CLI (local mircli) in botmux setup, the bot is configured with cliId: "mir". This adapter runs the local mircli -p --lean, so the same system user that runs the botmux daemon must already have Mir CLI authenticated and initialized.
BotMux does not need any DevBox-specific configuration. The same rules apply on DevBox, local macOS, or other Linux machines:
mirclican be found by botmux, or the bot config pointscliPathOverrideat the absolutemirclipath.~/.mira/config.jsonalready contains adevice_id. This is usually written bymircli mcp --device-id <id>or Mir CLI's own initialization flow.miramcpis installed in a standard Mir CLI location such as~/.local/bin/miramcpor~/.local/bin/mira_cli, orMIRAMCP_BINpoints at the executable.
When a cliId: "mir" session starts and receives a message, BotMux best-effort starts the MCP Bridge before invoking mircli:
It first checks ~/.mira/miramcp/miramcp.pid and local port 9801, so an already-running bridge is reused instead of started twice. To inspect the bridge, run this as the same user that runs the botmux daemon:
To disable this autostart behavior, either set this in ~/.mira/config.json:
or disable it only for BotMux:
Wrapping a wrapper / gateway integration
In many cases you don't run the native CLI directly but wrap it with a gateway / router (internal proxy + SSO, model routing, etc.), such as ccr, ttadk, aiden x claude, aiden x codex. In this case you don't need a new adapter: cliId still holds the real underlying CLI (claude-code / codex …), and you only swap the launch entry point for a wrapper script, pointing to it with cliPathOverride (the "CLI executable path override" when editing a bot in botmux setup is exactly this).
Four general steps:
- Log in to the gateway first (one-time): complete the SSO login as the same system user that runs the daemon; the token is cached in that user's home directory. An expired token will pop an interactive login that blocks the PTY, so keep the login state alive.
- Write the wrapper script in
~/.botmux/bin/, passing the arguments botmux injects through to the real CLI (note: some gateways reject the--settingsbotmux injects, so strip it in the script). chmod +xto add the executable bit (the easiest one to miss!) — botmux uses node-pty to exec the script directly; without the executable bit you getEACCES, the CLI exits immediately on launch, and the bot crashes and restarts.- Verify by executing the script directly (use
~/.botmux/bin/xxx --version, don't test withbash xxx— running via bash doesn't need the executable bit and will mask the problem in step 3). Then configurecliPathOverrideinbots.json(use an absolute path, not~), and runbotmux restartto take effect.
For the specific wrapper scripts of each gateway, use the docs published by the corresponding CLI / gateway team. This public repository intentionally does not include internal document links or copied internal content.
- aiden × claude / aiden × codex — aiden×codex needs
scriptto force a PTY - ttadk — pay attention to wrapper argument forwarding and login state
- MTR — community-contributed,
npm i -g @metamove-code/mtr-cli@latest
A general technique for troubleshooting wrapper issues: run
botmux logs, find theSpawning fresh CLI:line, copy the full command, and run it manually locally to pinpoint the problem (permissions / argument blacklist / login state).
Adding a new adapter (contributors)
- Create a new file under
src/adapters/cli/implementing theCliAdapterinterface - Add the new ID to the
CliIdunion type insrc/adapters/cli/types.ts - Add the import / switch case / export in
src/adapters/cli/registry.ts - Add the display name to
CLI_DISPLAY_NAMESinsrc/worker.tsandcliDisplayNamesincard-builder.ts - Add an option to the setup interactive menu in
src/cli.ts - Update the README
See CONTRIBUTING.md for details.