botmux 2.52.0 → 2.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +22 -269
- package/README.md +21 -300
- package/dist/adapters/backend/session-backend-selector.d.ts +5 -1
- package/dist/adapters/backend/session-backend-selector.d.ts.map +1 -1
- package/dist/adapters/backend/session-backend-selector.js +15 -1
- package/dist/adapters/backend/session-backend-selector.js.map +1 -1
- package/dist/adapters/backend/tmux-backend.d.ts.map +1 -1
- package/dist/adapters/backend/tmux-backend.js +3 -0
- package/dist/adapters/backend/tmux-backend.js.map +1 -1
- package/dist/adapters/backend/types.d.ts +22 -0
- package/dist/adapters/backend/types.d.ts.map +1 -1
- package/dist/adapters/backend/types.js +7 -1
- package/dist/adapters/backend/types.js.map +1 -1
- package/dist/adapters/backend/zellij-backend.d.ts +132 -0
- package/dist/adapters/backend/zellij-backend.d.ts.map +1 -0
- package/dist/adapters/backend/zellij-backend.js +375 -0
- package/dist/adapters/backend/zellij-backend.js.map +1 -0
- package/dist/adapters/backend/zellij-observe-backend.d.ts +62 -0
- package/dist/adapters/backend/zellij-observe-backend.d.ts.map +1 -0
- package/dist/adapters/backend/zellij-observe-backend.js +218 -0
- package/dist/adapters/backend/zellij-observe-backend.js.map +1 -0
- package/dist/adapters/cli/claude-code.d.ts +39 -5
- package/dist/adapters/cli/claude-code.d.ts.map +1 -1
- package/dist/adapters/cli/claude-code.js +53 -31
- package/dist/adapters/cli/claude-code.js.map +1 -1
- package/dist/adapters/cli/registry.d.ts +2 -1
- package/dist/adapters/cli/registry.d.ts.map +1 -1
- package/dist/adapters/cli/registry.js +3 -1
- package/dist/adapters/cli/registry.js.map +1 -1
- package/dist/adapters/cli/seed.d.ts +29 -0
- package/dist/adapters/cli/seed.d.ts.map +1 -0
- package/dist/adapters/cli/seed.js +63 -0
- package/dist/adapters/cli/seed.js.map +1 -0
- package/dist/adapters/cli/types.d.ts +17 -1
- package/dist/adapters/cli/types.d.ts.map +1 -1
- package/dist/bot-registry.d.ts +1 -1
- package/dist/bot-registry.d.ts.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +79 -49
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +7 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +8 -0
- package/dist/config.js.map +1 -1
- package/dist/core/ask-hook/registry.d.ts.map +1 -1
- package/dist/core/ask-hook/registry.js +4 -0
- package/dist/core/ask-hook/registry.js.map +1 -1
- package/dist/core/command-handler.d.ts +4 -1
- package/dist/core/command-handler.d.ts.map +1 -1
- package/dist/core/command-handler.js +100 -8
- package/dist/core/command-handler.js.map +1 -1
- package/dist/core/dispatch.d.ts +33 -0
- package/dist/core/dispatch.d.ts.map +1 -1
- package/dist/core/dispatch.js +26 -0
- package/dist/core/dispatch.js.map +1 -1
- package/dist/core/pending-response.d.ts +31 -0
- package/dist/core/pending-response.d.ts.map +1 -0
- package/dist/core/pending-response.js +87 -0
- package/dist/core/pending-response.js.map +1 -0
- package/dist/core/session-discovery.d.ts +13 -4
- package/dist/core/session-discovery.d.ts.map +1 -1
- package/dist/core/session-discovery.js +5 -5
- package/dist/core/session-discovery.js.map +1 -1
- package/dist/core/session-manager.d.ts +10 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +59 -19
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/types.d.ts +8 -2
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/core/worker-pool.d.ts +2 -2
- package/dist/core/worker-pool.d.ts.map +1 -1
- package/dist/core/worker-pool.js +89 -15
- package/dist/core/worker-pool.js.map +1 -1
- package/dist/core/zellij-adopt-discovery.d.ts +28 -0
- package/dist/core/zellij-adopt-discovery.d.ts.map +1 -0
- package/dist/core/zellij-adopt-discovery.js +276 -0
- package/dist/core/zellij-adopt-discovery.js.map +1 -0
- package/dist/core/zellij-session-discovery.d.ts +73 -0
- package/dist/core/zellij-session-discovery.d.ts.map +1 -0
- package/dist/core/zellij-session-discovery.js +259 -0
- package/dist/core/zellij-session-discovery.js.map +1 -0
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +70 -4
- package/dist/daemon.js.map +1 -1
- package/dist/dashboard/web/i18n.js +1 -1
- package/dist/dashboard/web/i18n.js.map +1 -1
- package/dist/dashboard/web/sessions.d.ts.map +1 -1
- package/dist/dashboard/web/sessions.js +1 -0
- package/dist/dashboard/web/sessions.js.map +1 -1
- package/dist/dashboard/web/workflows.js +1 -1
- package/dist/dashboard/web/workflows.js.map +1 -1
- package/dist/dashboard-web/app.js +3 -3
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +12 -0
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/zh.d.ts.map +1 -1
- package/dist/i18n/zh.js +13 -1
- package/dist/i18n/zh.js.map +1 -1
- package/dist/im/lark/card-builder.d.ts +7 -1
- package/dist/im/lark/card-builder.d.ts.map +1 -1
- package/dist/im/lark/card-builder.js +92 -2
- package/dist/im/lark/card-builder.js.map +1 -1
- package/dist/im/lark/card-handler.d.ts.map +1 -1
- package/dist/im/lark/card-handler.js +78 -6
- package/dist/im/lark/card-handler.js.map +1 -1
- package/dist/im/lark/event-dispatcher.d.ts +8 -1
- package/dist/im/lark/event-dispatcher.d.ts.map +1 -1
- package/dist/im/lark/event-dispatcher.js +28 -0
- package/dist/im/lark/event-dispatcher.js.map +1 -1
- package/dist/im/lark/grant-command.d.ts +13 -0
- package/dist/im/lark/grant-command.d.ts.map +1 -1
- package/dist/im/lark/grant-command.js +93 -0
- package/dist/im/lark/grant-command.js.map +1 -1
- package/dist/services/codex-app-threads.d.ts +20 -0
- package/dist/services/codex-app-threads.d.ts.map +1 -0
- package/dist/services/codex-app-threads.js +165 -0
- package/dist/services/codex-app-threads.js.map +1 -0
- package/dist/services/pending-response-transaction-store.d.ts +12 -0
- package/dist/services/pending-response-transaction-store.d.ts.map +1 -0
- package/dist/services/pending-response-transaction-store.js +52 -0
- package/dist/services/pending-response-transaction-store.js.map +1 -0
- package/dist/services/session-store.d.ts.map +1 -1
- package/dist/services/session-store.js +15 -1
- package/dist/services/session-store.js.map +1 -1
- package/dist/setup/bot-config-editor.d.ts +1 -1
- package/dist/setup/bot-config-editor.d.ts.map +1 -1
- package/dist/setup/bot-config-editor.js +5 -4
- package/dist/setup/bot-config-editor.js.map +1 -1
- package/dist/setup/ensure-zellij.d.ts +48 -0
- package/dist/setup/ensure-zellij.d.ts.map +1 -0
- package/dist/setup/ensure-zellij.js +93 -0
- package/dist/setup/ensure-zellij.js.map +1 -0
- package/dist/types.d.ts +14 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/anchor-serializer.d.ts +3 -2
- package/dist/utils/anchor-serializer.d.ts.map +1 -1
- package/dist/utils/anchor-serializer.js +20 -5
- package/dist/utils/anchor-serializer.js.map +1 -1
- package/dist/utils/transient-snapshot.js +2 -2
- package/dist/utils/transient-snapshot.js.map +1 -1
- package/dist/worker.js +235 -32
- package/dist/worker.js.map +1 -1
- package/dist/workflows/attempt-resume.d.ts +1 -1
- package/dist/workflows/attempt-resume.d.ts.map +1 -1
- package/dist/workflows/attempt-resume.js +1 -1
- package/dist/workflows/attempt-resume.js.map +1 -1
- package/dist/workflows/events/payloads.d.ts +20 -20
- package/dist/workflows/events/schema.d.ts +48 -48
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -15,14 +15,15 @@
|
|
|
15
15
|
<a href="#design-philosophy">Design</a> ·
|
|
16
16
|
<a href="#key-advantages">Advantages</a> ·
|
|
17
17
|
<a href="#5-minute-setup">Quick Start</a> ·
|
|
18
|
-
<a href="
|
|
19
|
-
<a href="#configuration">Config</a>
|
|
18
|
+
<a href="https://magic.solutionsuite.cn/html-box/vkWHeJn1Fn2"><b>📖 Docs</b></a>
|
|
20
19
|
</p>
|
|
21
20
|
|
|
22
21
|
[中文](README.md) | English
|
|
23
22
|
|
|
24
23
|
**Plug any AI coding CLI into Lark (Feishu) topic groups — one thread per session, streaming cards, web terminal, zero glue code.**
|
|
25
24
|
|
|
25
|
+
> 📖 **Full docs** (commands / config / best practices / troubleshooting): **<https://magic.solutionsuite.cn/html-box/vkWHeJn1Fn2>** — this README only covers why and how to get started fast.
|
|
26
|
+
|
|
26
27
|
| Lark Streaming Cards | Web Terminal | tmux Session Management | Multi-Bot Collaboration |
|
|
27
28
|
|:-:|:-:|:-:|:-:|
|
|
28
29
|
| <img src="gif/fold&unfold.gif" width="220" /> | <img src="gif/web_terminal.gif" width="220" /> | <img src="gif/tmux.gif" width="220" /> | <img src="docs/setup/multi-bot-collab.png" width="220" /> |
|
|
@@ -63,7 +64,7 @@ Compared to OpenClaw-style approaches built on Agent SDKs:
|
|
|
63
64
|
## Prerequisites
|
|
64
65
|
|
|
65
66
|
- **Node.js** >= 20
|
|
66
|
-
- **AI coding CLI / local agent app** installed and authenticated (`claude`, `codex`, `coco`, `cursor-agent`, `gemini`, `opencode`, `hermes`, or `agy` (Antigravity) in PATH)
|
|
67
|
+
- **AI coding CLI / local agent app** installed and authenticated (`claude`, `codex`, `coco`, `cursor-agent`, `gemini`, `opencode`, `hermes`, `seed` (Seed CLI, a Claude Code fork), or `agy` (Antigravity) in PATH)
|
|
67
68
|
- **CoCo requires `0.120.32+`**: type-ahead (sending a new message while a turn is still running, parked in CoCo's own message queue) relies on 0.120.32+ behavior; earlier versions may drop or serialize input while busy — upgrade before use
|
|
68
69
|
- **tmux** >= 3.x (optional — auto-enabled when installed for persistent CLI sessions)
|
|
69
70
|
- **CJK fonts** (only needed for screenshot rendering of Chinese text / emoji):
|
|
@@ -122,8 +123,6 @@ After confirming the bot can send/receive messages, run:
|
|
|
122
123
|
botmux autostart enable
|
|
123
124
|
```
|
|
124
125
|
|
|
125
|
-
This registers the daemon with your user init system (macOS launchd / Linux user systemd) — **no sudo needed**. It restarts automatically on reboot. See [CLI Commands § Autostart](#autostart) below.
|
|
126
|
-
|
|
127
126
|
<details>
|
|
128
127
|
<summary><b>Manual Open Platform config: create app / permissions / redirect / publish (fallback)</b> —— handled automatically by botmux setup during the 2nd scan; expand only if auto-config failed or you want to verify manually</summary>
|
|
129
128
|
|
|
@@ -178,11 +177,13 @@ Then restart the daemon: `botmux restart`.
|
|
|
178
177
|
|
|
179
178
|
### Streaming Cards
|
|
180
179
|
|
|
181
|
-
Each conversation turn gets a live-updating Feishu card
|
|
180
|
+
Each conversation turn gets a live-updating Feishu card — your main window for sensing and driving the CLI from phone/Lark:
|
|
182
181
|
|
|
183
|
-
-
|
|
184
|
-
-
|
|
185
|
-
-
|
|
182
|
+
- **Live terminal screenshot streamed to the card** (rendered headlessly via xterm into a PNG, faithfully reproducing the CLI's TUI); one-tap "show/hide output", "export text", "page up/down"
|
|
183
|
+
- **Live status**: Starting → Analyzing → Working / Executing → Idle; marks "limit reached · retryable" when quota runs out
|
|
184
|
+
- **Act right from the card**: open (writable) terminal, 🔑 get write link, restart / close / take over the session, re-send last task
|
|
185
|
+
- **One new card per turn**, the previous one frozen as an archive; after `/relay` moves a session to another group, the old card auto-freezes as an archive
|
|
186
|
+
- **Closing leaves a resumable card** (with the CLI's native resume command) — click back in anytime
|
|
186
187
|
|
|
187
188
|
|
|
188
189
|
### Web Terminal (Interactive)
|
|
@@ -196,7 +197,7 @@ On mobile/tablet, a floating shortcut toolbar provides Esc, Ctrl+C, Tab, arrow k
|
|
|
196
197
|
|
|
197
198
|
### Multi-Bot Collaboration
|
|
198
199
|
|
|
199
|
-
Run multiple Lark bots on a single machine, each mapped to a different CLI. In the same group chat, messages are routed via @mention — each bot gets its own isolated CLI process. With a single bot in the group, it responds automatically without @. In a regular (non-topic) group, `@<bot1> @<bot2> /t xxx` spawns one independent thread per mentioned bot anchored at the same message. Send `@<bot1> @<bot2> /introduce` once so they register each other's open_id; afterwards each bot can explicitly @-mention the others from within its own session (
|
|
200
|
+
Run multiple Lark bots on a single machine, each mapped to a different CLI. In the same group chat, messages are routed via @mention — each bot gets its own isolated CLI process. With a single bot in the group, it responds automatically without @. In a regular (non-topic) group, `@<bot1> @<bot2> /t xxx` spawns one independent thread per mentioned bot anchored at the same message. Send `@<bot1> @<bot2> /introduce` once so they register each other's open_id; afterwards each bot can explicitly @-mention the others from within its own session (commands: [📖 Docs · Slash Commands](https://magic.solutionsuite.cn/html-box/vkWHeJn1Fn2#/slash-commands)).
|
|
200
201
|
|
|
201
202
|
### Multi-Topic Collaboration
|
|
202
203
|
|
|
@@ -326,270 +327,22 @@ Gemini / OpenCode / Antigravity), with no MCP protocol support required.
|
|
|
326
327
|
6. Click "Get Write Link" on the card to receive a write-enabled terminal URL via DM
|
|
327
328
|
7. The CLI replies in the thread via the `botmux send` command (wired through the `botmux-send` Skill)
|
|
328
329
|
|
|
329
|
-
### Slash Commands
|
|
330
|
-
|
|
331
|
-
Send these straight into a topic — the daemon intercepts them (no clash with the underlying CLI's own slash commands: any `/xxx` botmux doesn't recognize is forwarded verbatim to the CLI). Send `/help` anytime to see the same list inside the topic.
|
|
332
|
-
|
|
333
|
-
**📌 Session management**
|
|
334
|
-
|
|
335
|
-
| Command | Description |
|
|
336
|
-
|---------|-------------|
|
|
337
|
-
| `/repo` | While a repo is pending selection, launch in the default workingDir; mid-session, show the project selector card (interactive dropdown + text list) |
|
|
338
|
-
| `/repo <N>` | Switch to Nth project from last scan |
|
|
339
|
-
| `/repo <path\|name>` | Skip the selector card; pass a path (relative/absolute) or a first-level project name under workingDir |
|
|
340
|
-
| `/cd <path>` | Change working directory and restart the CLI process |
|
|
341
|
-
| `/status` | Show session info (uptime, terminal URL, etc.) |
|
|
342
|
-
| `/restart` | Restart CLI process (keeps the session context) |
|
|
343
|
-
| `/close` | Close session and send a resumable card (with the CLI's native resume command) |
|
|
344
|
-
| `/t <prompt>` / `/topic <prompt>` | Force-open a new topic from a non-topic group (shows the repo selector); empty prompt is allowed — fill it in after picking the repo |
|
|
345
|
-
|
|
346
|
-
**🔀 Forwarded to the underlying CLI**
|
|
347
|
-
|
|
348
|
-
| Command | Description |
|
|
349
|
-
|---------|-------------|
|
|
350
|
-
| `/compact` `/model` `/clear` `/plugin` `/usage` `/context` `/cost` `/mcp` `/diff` `/code-review` `/security-review` `/review` `/btw` | Sent verbatim to the underlying CLI for its own built-in slash commands (e.g. Claude Code's `/compact` / `/context`, Codex's `/diff` / `/btw`) |
|
|
351
|
-
|
|
352
|
-
**⏰ Scheduled tasks** (syntax & examples in [§ Scheduled Task Management](#scheduled-task-management))
|
|
353
|
-
|
|
354
|
-
| Command | Description |
|
|
355
|
-
|---------|-------------|
|
|
356
|
-
| `/schedule <natural language / cron>` | Create a task, e.g. `/schedule 每日17:50 check AI news` |
|
|
357
|
-
| `/schedule list` | List all scheduled tasks |
|
|
358
|
-
| `/schedule remove\|enable\|disable\|run <id>` | Remove / enable / disable / run once |
|
|
359
|
-
|
|
360
|
-
**📡 Session adoption**
|
|
361
|
-
|
|
362
|
-
| Command | Description |
|
|
363
|
-
|---------|-------------|
|
|
364
|
-
| `/adopt` | Scan local tmux and pop a card to adopt a running CLI session |
|
|
365
|
-
| `/adopt <tmux_pane>` | Adopt a specific tmux pane directly (e.g. `/adopt 0:2.0`) |
|
|
366
|
-
|
|
367
|
-
**🔐 User authorization**
|
|
368
|
-
|
|
369
|
-
| Command | Description |
|
|
370
|
-
|---------|-------------|
|
|
371
|
-
| `/login` | Lark user OAuth — afterwards you can download third-party card images and call cloud-doc/calendar APIs as yourself |
|
|
372
|
-
| `/login status` | Show current OAuth status |
|
|
373
|
-
|
|
374
|
-
**🛎️ Oncall mode (group chats)**
|
|
375
|
-
|
|
376
|
-
| Command | Description |
|
|
377
|
-
|---------|-------------|
|
|
378
|
-
| `/oncall bind <path>` | Bind current chat to a project dir, skip the repo card (any group member can @ the bot; buttons / daemon commands still gated by `allowedUsers`) |
|
|
379
|
-
| `/oncall unbind` | Unbind the current chat |
|
|
380
|
-
| `/oncall status` | Inspect the current chat's oncall binding |
|
|
381
|
-
|
|
382
|
-
**🔑 Access grants (owner only)**
|
|
383
|
-
|
|
384
|
-
| Command | Description |
|
|
385
|
-
|---------|-------------|
|
|
386
|
-
| `@bot /grant @someone` | Pop an authorization card to add the user to the "this chat" or "global" allowlist; you can @ several people/bots at once (one card lists every target, one scope click applies to all); if a granted target is a bot, it's auto-registered into the roster on success (an implicit `/introduce`) for cross-bot collaboration; also auto-pops (and @s the owner) when an unauthorized user @-mentions the bot |
|
|
387
|
-
| `@bot /grant @someone 5` | Same, but with a **5-message quota**: after 5 conversational messages the grant is auto-revoked and they can no longer talk. Without a number it uses `messageQuota.defaultLimit` (unlimited if unset). Re-running `/grant @someone 3` refills/resets it. Only real CLI conversation counts — commands like `/help` don't. |
|
|
388
|
-
| `@bot /revoke @someone` | Revoke the user's this-chat + global access; you can @ several people/bots at once; also clears their message-quota counters |
|
|
389
|
-
|
|
390
|
-
**🆕 One-shot session group**
|
|
391
|
-
|
|
392
|
-
| Command | Description |
|
|
393
|
-
|---------|-------------|
|
|
394
|
-
| `/group <name>` (alias `/g`) | Auto-create a new Lark group, invite you, transfer ownership; the whole group acts as one chat-scope CLI session. Empty name falls back to a timestamp. The group does **not** auto-start a session — just go in and start chatting with the bot. Any bots you @-mention in the command are pulled into the new group (the first mentioned bot does the creating). |
|
|
395
|
-
|
|
396
|
-
**👥 Multi-bot collaboration**
|
|
397
|
-
|
|
398
|
-
| Command | Description |
|
|
399
|
-
|---------|-------------|
|
|
400
|
-
| `@botA @botB /t <prompt>` | With multiple bots, each @-mentioned bot opens its own independent topic from the same message |
|
|
401
|
-
| `@botA @botB /introduce` | Bots register each other's open_id so they can later explicitly @-mention one another across sessions (any @ order, extra text allowed; roster-only, grants no permission — **anyone in the chat can run it, no authorization needed**) |
|
|
402
|
-
|
|
403
|
-
**❓ Help**
|
|
404
|
-
|
|
405
|
-
| Command | Description |
|
|
406
|
-
|---------|-------------|
|
|
407
|
-
| `/help` | Show the full command list above, inside the topic |
|
|
408
|
-
|
|
409
|
-
### Scheduled Task Management
|
|
410
|
-
|
|
411
|
-
Two creation paths are covered above in [Scheduled Tasks](#scheduled-tasks); below is just the slash-command syntax and management commands.
|
|
412
|
-
|
|
413
|
-
```bash
|
|
414
|
-
# Chinese NL
|
|
415
|
-
/schedule 每日17:50 check AI news
|
|
416
|
-
/schedule 工作日每天9:00 run health check
|
|
417
|
-
/schedule 每周一10:00 generate weekly report
|
|
418
|
-
|
|
419
|
-
# One-shot
|
|
420
|
-
/schedule 30分钟后 verify deployment
|
|
421
|
-
/schedule 明天9:00 standup reminder
|
|
422
|
-
|
|
423
|
-
# English / cron
|
|
424
|
-
/schedule every 2h probe services
|
|
425
|
-
/schedule 30m remind me to drink water
|
|
426
|
-
/schedule 0 9 * * * good morning
|
|
427
|
-
|
|
428
|
-
# Manage
|
|
429
|
-
/schedule list
|
|
430
|
-
/schedule remove|enable|disable|run <id>
|
|
431
|
-
```
|
|
432
|
-
|
|
433
|
-
**Execution behavior**: the task fires inside the **original thread where it was created** — no new topic per run. Working directory is preserved. If the original session is still alive, the prompt is injected into it; otherwise a fresh worker spawns bound to the same thread root.
|
|
434
|
-
|
|
435
330
|
---
|
|
436
331
|
|
|
437
|
-
##
|
|
332
|
+
## 📖 Documentation
|
|
438
333
|
|
|
439
|
-
|
|
334
|
+
The full reference — commands, config, best practices, troubleshooting — lives in the docs site; not duplicated here —
|
|
440
335
|
|
|
441
|
-
|
|
442
|
-
# Interactive setup
|
|
443
|
-
botmux setup
|
|
444
|
-
```
|
|
336
|
+
### 👉 https://magic.solutionsuite.cn/html-box/vkWHeJn1Fn2
|
|
445
337
|
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
[
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
"larkAppSecret": "secret_1",
|
|
455
|
-
"name": "claude-main",
|
|
456
|
-
"cliId": "claude-code",
|
|
457
|
-
"model": "sonnet",
|
|
458
|
-
"disableCliBypass": true,
|
|
459
|
-
"workingDir": "~/projects",
|
|
460
|
-
"allowedUsers": ["alice@company.com"],
|
|
461
|
-
"allowedChatGroups": ["oc_xxx_team"]
|
|
462
|
-
},
|
|
463
|
-
{
|
|
464
|
-
"larkAppId": "cli_xxx_bot2",
|
|
465
|
-
"larkAppSecret": "secret_2",
|
|
466
|
-
"cliId": "codex",
|
|
467
|
-
"model": "gpt-5-codex",
|
|
468
|
-
"workingDir": "~/work"
|
|
469
|
-
}
|
|
470
|
-
]
|
|
471
|
-
```
|
|
472
|
-
|
|
473
|
-
| Field | Required | Description |
|
|
474
|
-
|-------|----------|-------------|
|
|
475
|
-
| `larkAppId` | Yes | Lark app ID |
|
|
476
|
-
| `larkAppSecret` | Yes | Lark app secret |
|
|
477
|
-
| `name` | No | Process name suffix shown by `botmux status`; e.g. `claude-main` appears as `botmux-claude-main`, defaults to `botmux-<index>` |
|
|
478
|
-
| `cliId` | No | CLI adapter, defaults to `claude-code` (options: `aiden`, `coco`, `codex`, `codex-app`, `cursor`, `gemini`, `opencode`, `antigravity`, `hermes`) |
|
|
479
|
-
| `model` | No | Model name used when spawning the CLI. Currently honored by: `claude-code`, `codex`, `coco`, `cursor`, `gemini`, `opencode`; other adapters ignore the field. Leave empty to use the CLI default. `botmux setup` proposes per-CLI candidates plus a free-form Other option. |
|
|
480
|
-
| `cliPathOverride` | No | Absolute path to the CLI entry, for wrappers / routers; typical use: `ccr`, `claude-w`, `aiden-x-claude`, etc. |
|
|
481
|
-
| `disableCliBypass` | No | Whether to disable botmux's default CLI bypass / weak-sandbox flag injection. Missing or `false` keeps the legacy behavior: botmux still adds flags such as `--yolo`, `--dangerously-*`, `--force`, or `--permission-mode agentFull`. When `true`, botmux stops adding those flags. For a custom approval/sandbox policy, point `cliPathOverride` at a wrapper script that passes the desired CLI-specific args |
|
|
482
|
-
| `backendType` | No | Session backend: `pty` or `tmux` (auto-detected by default) |
|
|
483
|
-
| `workingDir` | No | Default working directory, supports comma-separated. The new-topic repo-select card scans for git repos **from this directory downward** (recursive, up to 3 levels), no longer climbing to the parent: point it at a repos root (e.g. `~/projects`) to list every repo beneath it, or at a single repo to list just that repo (and its linked worktrees) |
|
|
484
|
-
| `defaultWorkingDir` | No | Single-repo default: new topics with no oncall binding and no peer-session inheritance spawn directly here, skipping the repo-select card. `/cd <path>` still switches mid-session; the next new topic falls back to this default. **Difference from `defaultOncall`:** does NOT write `oncallChats` and does NOT change the `canTalk` / `canOperate` permission model |
|
|
485
|
-
| `allowedUsers` | No | Allowed users (**full emails** like `alice@example.com`, or open_ids `ou_xxx`). Email prefixes can't be resolved and are dropped. Required (at least one entry, as owner) when `allowedChatGroups` is set |
|
|
486
|
-
| `allowedChatGroups` | No | Talk-open chats (`chat_id`, for example `oc_xxx`). Any member talking **inside these chats** can use the bot (decided by the message's chat — new members work immediately, removed members lose access, no restart needed); grants `canTalk` only, sensitive ops still require `allowedUsers`. Equivalent to the owner running `/grant` (no target) in that chat. |
|
|
487
|
-
| `globalGrants` | No | Global talk allowlist (`open_id` list, e.g. `ou_xxx`; humans or bots). Listed entries can talk to the bot in **any** chat; grants `canTalk` only, sensitive ops still require `allowedUsers`. Usually written via the owner's `/grant` card (the "grant talk globally" button); can also be set manually here. |
|
|
488
|
-
| `messageQuota` | No | Message quota (off by default). Shape `{ "defaultLimit": 20 }`: setting a positive integer enables the **default quota** — a bare `/grant @someone` then applies it. An explicit `/grant @someone 5` **always** takes effect, regardless of this field. Only constrains per-user talk grants (`chatGrants`/`globalGrants`); owner / `allowedUsers` / whole-chat / oncall are never metered. |
|
|
489
|
-
| `quotaState` | No | Message-quota counters (runtime state, auto-maintained; rarely hand-edited). Keys look like `chat:<chatId>:<openId>` / `global:<openId>`, value `{ "limit": N, "used": M }`. When `used` reaches `limit`, the matching-scope grant is auto-revoked and the record deleted. |
|
|
490
|
-
| `restrictGrantCommands` | No | Default `false`. When on, **per-user grantees (`chatGrants`/`globalGrants`) are restricted to plain conversation** — all slash commands are blocked (botmux's own commands, passthrough commands, every `/workflow` subcommand, `/introduce`, `/t`). Owner / `allowedUsers` / oncall / whole-chat `allowedChatGroups` members are unaffected. Decided by slash-command invocation match (won't misfire on normal chat that merely discusses command usage). Recommended alongside quotas so grantees can't bypass the cap via commands. |
|
|
491
|
-
| `oncallChats` | No | Oncall bindings (written by `/oncall bind`), e.g. `[{ "chatId": "oc_xxx", "workingDir": "~/projects/foo" }]`; any group member can @ the bot |
|
|
492
|
-
|
|
493
|
-
**Config priority:** `BOTS_CONFIG` env var > `~/.botmux/bots.json`
|
|
494
|
-
|
|
495
|
-
### Environment Variables
|
|
496
|
-
|
|
497
|
-
| Variable | Default | Description |
|
|
498
|
-
|----------|---------|-------------|
|
|
499
|
-
| `BOTS_CONFIG` | _(unset)_ | Path to bots.json (overrides default location) |
|
|
500
|
-
| `WEB_HOST` | `0.0.0.0` | HTTP server bind address |
|
|
501
|
-
| `WEB_EXTERNAL_HOST` | _(auto-detect LAN IP)_ | External hostname/IP for terminal URLs |
|
|
502
|
-
| `SESSION_DATA_DIR` | `~/.botmux/data` | Where sessions and queues are stored |
|
|
503
|
-
| `DEBUG` | _(unset)_ | Set to `1` for debug logging |
|
|
504
|
-
|
|
505
|
-
### File Locations
|
|
506
|
-
|
|
507
|
-
| Path | Description |
|
|
508
|
-
|------|-------------|
|
|
509
|
-
| `~/.botmux/bots.json` | Bot configuration |
|
|
510
|
-
| `~/.botmux/data/` | Session data, message queues |
|
|
511
|
-
| `~/.botmux/logs/` | Daemon logs |
|
|
512
|
-
|
|
513
|
-
---
|
|
514
|
-
|
|
515
|
-
## CLI Commands
|
|
516
|
-
|
|
517
|
-
| Command | Description |
|
|
518
|
-
|---------|-------------|
|
|
519
|
-
| `botmux setup` | Interactive setup (first-time / add / edit / delete bots) |
|
|
520
|
-
| `botmux start` | Start daemon (PM2 managed) |
|
|
521
|
-
| `botmux stop` | Stop daemon |
|
|
522
|
-
| `botmux restart` | Restart daemon (auto-restores active sessions) |
|
|
523
|
-
| `botmux logs` | View daemon logs (`--lines N` for more) |
|
|
524
|
-
| `botmux status` | Show daemon status |
|
|
525
|
-
| `botmux upgrade` | Upgrade to latest version |
|
|
526
|
-
| `botmux list` | List all active sessions (alias: `ls`) |
|
|
527
|
-
| `botmux delete <id>` | Close a session by ID prefix (alias: `del`/`rm`) |
|
|
528
|
-
| `botmux delete all` | Close all active sessions |
|
|
529
|
-
| `botmux delete stopped` | Clean up zombie sessions with dead processes |
|
|
530
|
-
| `botmux autostart enable` | Register boot-time autostart (macOS launchd / Linux user systemd, no sudo) |
|
|
531
|
-
| `botmux autostart disable` | Unregister boot-time autostart |
|
|
532
|
-
| `botmux autostart status` | Show autostart status |
|
|
533
|
-
| `botmux dashboard` | Print a fresh Web Dashboard URL (rotates the token; previous URL becomes invalid) |
|
|
534
|
-
| `botmux dispatch` | Open a sub-project topic and @-mention the chosen bots to spawn their sessions (the dispatch command for [Multi-Topic Collaboration](#multi-topic-collaboration); supports `--title`, repeatable `--bot`, `--brief` / `--brief-file`, `--repo`, `--standby`, `--into`, with `--chat-id` / `--session-id` as advanced overrides; see `botmux dispatch --help`) |
|
|
535
|
-
| `botmux report` | From inside a dispatched sub-project session, report progress/completion back to the orchestrator's own session ([Multi-Topic Collaboration](#multi-topic-collaboration); routes the report into the orchestrator's context-rich thread instead of @-mentioning it in the sub-topic; `--content-file` to read the report from a file; see `botmux report --help`) |
|
|
536
|
-
|
|
537
|
-
### Boot-time Autostart
|
|
538
|
-
|
|
539
|
-
`botmux autostart enable` registers the daemon with your user's init system so it comes back automatically after a reboot:
|
|
540
|
-
|
|
541
|
-
- **macOS**: writes `~/Library/LaunchAgents/com.botmux.daemon.plist` and loads it via `launchctl bootstrap`. **No sudo required.**
|
|
542
|
-
- **Linux**: writes `~/.config/systemd/user/botmux.service` and runs `systemctl --user enable --now`. **No sudo required.**
|
|
543
|
-
- On servers / headless boxes the user systemd manager stops when you log out. To survive logouts and reboots, also run `sudo loginctl enable-linger <your-user>` — `autostart enable` warns when linger is off.
|
|
544
|
-
- Containers / SSH-only sessions without a user DBus fall back to printing manual instructions.
|
|
545
|
-
- The `node` and `cli.js` paths baked into the unit come from `process.execPath` at install time. After switching nvm/fnm versions, run `botmux autostart enable` once to rewrite. `botmux start`/`restart` also detect path drift and refresh the unit in place — no manual step needed.
|
|
546
|
-
- `enable` / `disable` **only manage the autostart hook — they do not touch a running daemon**. To start the daemon right away run `botmux start`; to stop it run `botmux stop`. This avoids the "I just wanted to turn off autostart, why did my service also die" footgun.
|
|
547
|
-
- If you prefer letting systemd own the lifecycle (`systemctl --user start/stop botmux`), that works too — the unit declares `ExecStop=botmux stop` for a clean shutdown path.
|
|
548
|
-
|
|
549
|
-
### Agent-facing subcommands
|
|
550
|
-
|
|
551
|
-
Run from inside a botmux-spawned CLI session — session context is auto-detected via ancestor process markers:
|
|
552
|
-
|
|
553
|
-
| Subcommand | Description |
|
|
554
|
-
|------------|-------------|
|
|
555
|
-
| `botmux send [content]` | Send a message to the current thread (stdin / heredoc / `--content-file`; `--images` / `--files` / `--mention` flags) |
|
|
556
|
-
| `botmux bots list` | List bots in the current chat (includes `open_id` for `--mention`) |
|
|
557
|
-
| `botmux history [--limit N]` | Fetch session message history (JSON); topic groups → in-thread, regular groups → whole chat |
|
|
558
|
-
| `botmux quoted <message_id>` | Fetch a single quoted message (JSON); the ID comes from the daemon-injected `[用户引用了消息 用 botmux quoted om_xxx 查看]` prefix |
|
|
559
|
-
| `botmux schedule add <schedule> <prompt>` | Create a scheduled task bound to the current thread |
|
|
560
|
-
| `botmux schedule list/remove/pause/resume/run` | Manage scheduled tasks |
|
|
561
|
-
|
|
562
|
-
These require the `~/.botmux/bin/botmux` wrapper, which the daemon writes at startup and prepends to the worker's `PATH` — always matches the running daemon's version (no `npm i -g` needed).
|
|
563
|
-
|
|
564
|
-
---
|
|
565
|
-
|
|
566
|
-
## Web Dashboard
|
|
567
|
-
|
|
568
|
-
botmux ships a LAN-accessible Web Dashboard for managing all sessions and scheduled tasks across every configured bot.
|
|
569
|
-
|
|
570
|
-
```bash
|
|
571
|
-
botmux dashboard
|
|
572
|
-
# prints: http://<lan-ip>:7891/?t=<token>
|
|
573
|
-
```
|
|
574
|
-
|
|
575
|
-
Each invocation rotates the token — previous URLs are invalidated immediately. This is by design, so a leaked link stops working as soon as you fetch a new one.
|
|
576
|
-
|
|
577
|
-
v1 features:
|
|
578
|
-
- **Sessions board** — every active and closed session across every bot, filterable by CLI / status / adopt / free-text. The detail drawer exposes a "📍 定位到飞书话题" button that posts a marker into the original thread (workaround for Feishu having no public topic deep-link), then opens AppLink to the chat. Also: copy IDs, close session, open xterm.
|
|
579
|
-
- **Schedules board** — every scheduled task across every bot, with Run-now / Pause / Resume actions.
|
|
580
|
-
|
|
581
|
-
Environment variables (set in `~/.botmux/.env`):
|
|
582
|
-
|
|
583
|
-
| Variable | Default | Purpose |
|
|
584
|
-
|----------|---------|---------|
|
|
585
|
-
| `BOTMUX_DASHBOARD_HOST` | `0.0.0.0` | Dashboard HTTP bind address |
|
|
586
|
-
| `BOTMUX_DASHBOARD_PORT` | `7891` | Dashboard HTTP port |
|
|
587
|
-
| `BOTMUX_DASHBOARD_EXTERNAL_HOST` | `WEB_EXTERNAL_HOST` or LAN-IP autodetect | Host used in the printed URL |
|
|
588
|
-
| `BOTMUX_DAEMON_IPC_BASE_PORT` | `7892` | Per-daemon IPC port = base + botIndex |
|
|
589
|
-
|
|
590
|
-
The dashboard runs as its own pm2 process (`botmux-dashboard`) — `pnpm daemon:restart` brings it up alongside every bot daemon. Each daemon exposes a localhost-only IPC at `127.0.0.1:7892+botIndex`; the dashboard process is a thin reverse proxy + token gate. The HMAC secret at `~/.botmux/.dashboard-secret` (mode `0600`) is generated on first start and is used only to sign `botmux dashboard` rotation requests — it never reaches the browser.
|
|
591
|
-
|
|
592
|
-
---
|
|
338
|
+
| Topic | Docs |
|
|
339
|
+
|-------|------|
|
|
340
|
+
| Slash commands / CLI commands / agent-facing subcommands | [Commands](https://magic.solutionsuite.cn/html-box/vkWHeJn1Fn2#/slash-commands) |
|
|
341
|
+
| `bots.json` fields / env vars / file locations | [Configuration](https://magic.solutionsuite.cn/html-box/vkWHeJn1Fn2#/bots-json) |
|
|
342
|
+
| Multi-CLI adapters (incl. wrapper / gateway integration) | [Adapters](https://magic.solutionsuite.cn/html-box/vkWHeJn1Fn2#/adapters) |
|
|
343
|
+
| Scenario-based best practices (Oncall / alerting-ops / solo dev / team) | [Best Practices](https://magic.solutionsuite.cn/html-box/vkWHeJn1Fn2#/best-practices) |
|
|
344
|
+
| Common pitfalls / FAQ | [Pitfalls](https://magic.solutionsuite.cn/html-box/vkWHeJn1Fn2#/pitfalls) · [FAQ](https://magic.solutionsuite.cn/html-box/vkWHeJn1Fn2#/faq) |
|
|
345
|
+
| Features: scheduled tasks / Oncall / Dashboard / multi-bot / session relay | [Schedule](https://magic.solutionsuite.cn/html-box/vkWHeJn1Fn2#/schedule) · [Oncall](https://magic.solutionsuite.cn/html-box/vkWHeJn1Fn2#/oncall) · [Dashboard](https://magic.solutionsuite.cn/html-box/vkWHeJn1Fn2#/dashboard) · [Multi-bot](https://magic.solutionsuite.cn/html-box/vkWHeJn1Fn2#/multi-bot) · [Relay](https://magic.solutionsuite.cn/html-box/vkWHeJn1Fn2#/relay) |
|
|
593
346
|
|
|
594
347
|
## Contributing
|
|
595
348
|
|