cmux-terminal-multiplexer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecmux — AI-Native Terminal Multiplexer
cmux — 原生AI终端多路复用器
Skill by ara.so — Daily 2026 Skills collection
cmux is a terminal multiplexer with a programmable socket API designed for AI coding agents. It provides full Playwright-equivalent browser automation, real-time terminal split management, sidebar status reporting, and agent team coordination — all via a simple CLI.
由ara.so开发的Skill — 2026每日技能合集
cmux是一款为AI编码Agent设计的、具备可编程Socket API的终端多路复用器。它提供完全等效于Playwright的浏览器自动化、实时终端分屏管理、侧边栏状态报告以及Agent团队协作功能 —— 所有功能均可通过简单的CLI调用。
What cmux Does
cmux的功能
- Terminal splits — create side-by-side or stacked panes, send commands, capture output
- Browser automation — full headless Chromium with snapshot-based element refs (no CSS selectors)
- Status sidebar — live progress bars, log messages, and icon badges visible to the user
- Notifications — native OS notifications from agent workflows
- Agent teams — coordinate parallel subagents, each with their own visible split
- 终端分屏 — 创建并排或堆叠窗格,发送命令,捕获输出
- 浏览器自动化 — 完整的无头Chromium引擎,基于快照的元素引用(无需CSS选择器)
- 状态侧边栏 — 实时进度条、日志消息和图标徽章,用户可直接查看
- 通知功能 — 来自Agent工作流的原生系统通知
- Agent团队协作 — 协调并行子Agent,每个Agent拥有独立的可视分屏
Orient Yourself
快速定位当前环境
bash
cmux identify --json # current window/workspace/pane/surface context
cmux list-panes # all panes in current workspace
cmux list-pane-surfaces --pane pane:1 # surfaces within a pane
cmux list-workspaces # all workspaces (tabs) in current windowEnvironment variables set automatically:
- — your current surface ref
$CMUX_SURFACE_ID - — your current workspace ref
$CMUX_WORKSPACE_ID
Handles use short refs: , , , .
surface:Npane:Nworkspace:Nwindow:Nbash
cmux identify --json # 当前窗口/工作区/窗格/上下文信息
cmux list-panes # 当前工作区的所有窗格
cmux list-pane-surfaces --pane pane:1 # 某窗格内的所有上下文
cmux list-workspaces # 当前窗口的所有工作区(标签页)自动设置的环境变量:
- — 当前上下文引用
$CMUX_SURFACE_ID - — 当前工作区引用
$CMUX_WORKSPACE_ID
句柄采用短引用格式:、、、。
surface:Npane:Nworkspace:Nwindow:NTerminal Splits
终端分屏
Create splits
创建分屏
bash
cmux --json new-split right # side-by-side (preferred for parallel work)
cmux --json new-split down # stacked (good for logs)Always capture the returned :
surface_refbash
WORKER=$(cmux --json new-split right | python3 -c "import sys,json; print(json.load(sys.stdin)['surface_ref'])")bash
cmux --json new-split right # 并排分屏(适合并行工作)
cmux --json new-split down # 堆叠分屏(适合查看日志)务必捕获返回的:
surface_refbash
WORKER=$(cmux --json new-split right | python3 -c "import sys,json; print(json.load(sys.stdin)['surface_ref'])")Send commands and read output
发送命令与读取输出
bash
cmux send-surface --surface surface:22 "npm run build\n"
cmux capture-pane --surface surface:22 # current screen
cmux capture-pane --surface surface:22 --scrollback # with full history
cmux send-key-surface --surface surface:22 ctrl-c # send key
cmux send-key-surface --surface surface:22 enterGolden rule: never steal focus. Always use targeting.
--surfacebash
cmux send-surface --surface surface:22 "npm run build\n"
cmux capture-pane --surface surface:22 # 当前屏幕内容
cmux capture-pane --surface surface:22 --scrollback # 包含完整历史记录
cmux send-key-surface --surface surface:22 ctrl-c # 发送按键
cmux send-key-surface --surface surface:22 enter黄金准则:绝不抢占焦点。始终使用指定目标。
--surfaceWorker split pattern
工作进程分屏模式
bash
WORKER=$(cmux --json new-split right | python3 -c "import sys,json; print(json.load(sys.stdin)['surface_ref'])")
cmux send-surface --surface "$WORKER" "make test 2>&1; echo EXIT_CODE=\$?\n"
sleep 3
cmux capture-pane --surface "$WORKER"
cmux close-surface --surface "$WORKER" # clean up when donebash
WORKER=$(cmux --json new-split right | python3 -c "import sys,json; print(json.load(sys.stdin)['surface_ref'])")
cmux send-surface --surface "$WORKER" "make test 2>&1; echo EXIT_CODE=\$?\n"
sleep 3
cmux capture-pane --surface "$WORKER"
cmux close-surface --surface "$WORKER" # 完成后清理Pane management
窗格管理
bash
cmux focus-pane --pane pane:2
cmux close-surface --surface surface:22
cmux swap-pane --pane pane:1 --target-pane pane:2
cmux move-surface --surface surface:7 --pane pane:2 --focus true
cmux reorder-surface --surface surface:7 --before surface:3bash
cmux focus-pane --pane pane:2
cmux close-surface --surface surface:22
cmux swap-pane --pane pane:1 --target-pane pane:2
cmux move-surface --surface surface:7 --pane pane:2 --focus true
cmux reorder-surface --surface surface:7 --before surface:3Browser Automation
浏览器自动化
cmux embeds a full headless Chromium engine with a Playwright-style API. No external Chrome required. Every command targets a browser surface by ref.
cmux内置完整的无头Chromium引擎,提供类Playwright风格的API。无需外部Chrome,所有命令通过上下文引用目标浏览器分屏。
Workflow pattern
工作流模式
navigate → wait for load → snapshot --interactive → act with refs → re-snapshot导航 → 等待加载 → 快照--interactive → 基于引用操作 → 重新快照Open and navigate
打开与导航
bash
cmux --json browser open https://example.com # opens browser split, returns surface ref
cmux browser surface:23 goto https://other.com
cmux browser surface:23 back
cmux browser surface:23 forward
cmux browser surface:23 reload
cmux browser surface:23 get url
cmux browser surface:23 get titleCapture the surface ref:
bash
BROWSER=$(cmux --json browser open https://docs.example.com | python3 -c "import sys,json; print(json.load(sys.stdin)['surface_ref'])")bash
cmux --json browser open https://example.com # 打开浏览器分屏,返回上下文引用
cmux browser surface:23 goto https://other.com
cmux browser surface:23 back
cmux browser surface:23 forward
cmux browser surface:23 reload
cmux browser surface:23 get url
cmux browser surface:23 get title捕获上下文引用:
bash
BROWSER=$(cmux --json browser open https://docs.example.com | python3 -c "import sys,json; print(json.load(sys.stdin)['surface_ref'])")Snapshot and element refs
快照与元素引用
Instead of CSS selectors, snapshot to get stable element refs (, , ...):
e1e2bash
cmux browser surface:23 snapshot --interactive # full interactive snapshot
cmux browser surface:23 snapshot --interactive --compact # compact output
cmux browser surface:23 snapshot --selector "form#login" --interactive # scopedRefs are invalidated after DOM mutations — always re-snapshot after navigation or clicks. Use to auto-get a fresh snapshot:
--snapshot-afterbash
cmux --json browser surface:23 click e1 --snapshot-after无需CSS选择器,通过快照获取稳定的元素引用(、、...):
e1e2bash
cmux browser surface:23 snapshot --interactive # 完整交互式快照
cmux browser surface:23 snapshot --interactive --compact # 精简输出
cmux browser surface:23 snapshot --selector "form#login" --interactive # 范围快照DOM变更后引用会失效 —— 导航或点击后务必重新快照。使用自动获取新快照:
--snapshot-afterbash
cmux --json browser surface:23 click e1 --snapshot-afterInteract with elements
元素交互
bash
undefinedbash
undefinedClick and hover
点击与悬停
cmux browser surface:23 click e1
cmux browser surface:23 dblclick e2
cmux browser surface:23 hover e3
cmux browser surface:23 focus e4
cmux browser surface:23 click e1
cmux browser surface:23 dblclick e2
cmux browser surface:23 hover e3
cmux browser surface:23 focus e4
Text input
文本输入
cmux browser surface:23 fill e5 "hello@example.com" # clear + type
cmux browser surface:23 fill e5 "" # clear input
cmux browser surface:23 type e6 "search query" # type without clearing
cmux browser surface:23 fill e5 "hello@example.com" # 清空后输入
cmux browser surface:23 fill e5 "" # 清空输入框
cmux browser surface:23 type e6 "search query" # 不清空直接输入
Keys
按键操作
cmux browser surface:23 press Enter
cmux browser surface:23 press Tab
cmux browser surface:23 keydown Shift
cmux browser surface:23 press Enter
cmux browser surface:23 press Tab
cmux browser surface:23 keydown Shift
Forms
表单操作
cmux browser surface:23 check e7 # checkbox
cmux browser surface:23 uncheck e7
cmux browser surface:23 select e8 "option-value"
cmux browser surface:23 check e7 # 复选框
cmux browser surface:23 uncheck e7
cmux browser surface:23 select e8 "option-value"
undefinedScroll
等待状态
cmux browser surface:23 scroll --dy 500
cmux browser surface:23 scroll --selector ".container" --dy 300
cmux browser surface:23 scroll-into-view e9
undefinedbash
cmux browser surface:23 wait --load-state complete --timeout-ms 15000
cmux browser surface:23 wait --selector "#ready" --timeout-ms 10000
cmux browser surface:23 wait --text "Success" --timeout-ms 10000
cmux browser surface:23 wait --url-contains "/dashboard" --timeout-ms 10000
cmux browser surface:23 wait --function "document.readyState === 'complete'" --timeout-ms 10000Wait for state
读取页面内容
bash
cmux browser surface:23 wait --load-state complete --timeout-ms 15000
cmux browser surface:23 wait --selector "#ready" --timeout-ms 10000
cmux browser surface:23 wait --text "Success" --timeout-ms 10000
cmux browser surface:23 wait --url-contains "/dashboard" --timeout-ms 10000
cmux browser surface:23 wait --function "document.readyState === 'complete'" --timeout-ms 10000bash
cmux browser surface:23 get text body # 可见文本
cmux browser surface:23 get html body # 原始HTML
cmux browser surface:23 get value "#email" # 输入框值
cmux browser surface:23 get attr "#link" --attr href
cmux browser surface:23 get count ".items" # 元素数量
cmux browser surface:23 get box "#button" # 边界框
cmux browser surface:23 get styles "#el" --property colorRead page content
状态检查
bash
cmux browser surface:23 get text body # visible text
cmux browser surface:23 get html body # raw HTML
cmux browser surface:23 get value "#email" # input value
cmux browser surface:23 get attr "#link" --attr href
cmux browser surface:23 get count ".items" # element count
cmux browser surface:23 get box "#button" # bounding box
cmux browser surface:23 get styles "#el" --property colorcmux browser surface:23 is visible "#modal"
cmux browser surface:23 is enabled "#submit"
cmux browser surface:23 is checked "#agree"
undefinedState checks
定位器(类Playwright风格)
cmux browser surface:23 is visible "#modal"
cmux browser surface:23 is enabled "#submit"
cmux browser surface:23 is checked "#agree"
undefinedbash
cmux browser surface:23 find role button
cmux browser surface:23 find text "Sign In"
cmux browser surface:23 find label "Email"
cmux browser surface:23 find placeholder "Enter email"
cmux browser surface:23 find testid "submit-btn"
cmux browser surface:23 find first ".item"
cmux browser surface:23 find last ".item"
cmux browser surface:23 find nth ".item" 3Locators (Playwright-style)
JavaScript执行
bash
cmux browser surface:23 find role button
cmux browser surface:23 find text "Sign In"
cmux browser surface:23 find label "Email"
cmux browser surface:23 find placeholder "Enter email"
cmux browser surface:23 find testid "submit-btn"
cmux browser surface:23 find first ".item"
cmux browser surface:23 find last ".item"
cmux browser surface:23 find nth ".item" 3bash
cmux browser surface:23 eval "document.title"
cmux browser surface:23 eval "document.querySelectorAll('.item').length"
cmux browser surface:23 eval "window.scrollTo(0, document.body.scrollHeight)"JavaScript evaluation
框架与对话框
bash
cmux browser surface:23 eval "document.title"
cmux browser surface:23 eval "document.querySelectorAll('.item').length"
cmux browser surface:23 eval "window.scrollTo(0, document.body.scrollHeight)"bash
cmux browser surface:23 frame "#iframe-selector" # 切换到iframe
cmux browser surface:23 frame main # 返回主框架
cmux browser surface:23 dialog accept
cmux browser surface:23 dialog dismiss
cmux browser surface:23 dialog accept "prompt text"Frames and dialogs
Cookie、存储与状态
bash
cmux browser surface:23 frame "#iframe-selector" # switch to iframe
cmux browser surface:23 frame main # back to main frame
cmux browser surface:23 dialog accept
cmux browser surface:23 dialog dismiss
cmux browser surface:23 dialog accept "prompt text"bash
undefinedCookies, storage, and state
Cookie操作
bash
undefinedcmux browser surface:23 cookies get
cmux browser surface:23 cookies set session_token "abc123"
cmux browser surface:23 cookies clear
Cookies
本地/会话存储
cmux browser surface:23 cookies get
cmux browser surface:23 cookies set session_token "abc123"
cmux browser surface:23 cookies clear
cmux browser surface:23 storage local get
cmux browser surface:23 storage local set myKey "myValue"
cmux browser surface:23 storage session clear
Local/session storage
保存/恢复完整浏览器状态(Cookie+存储+标签页)
cmux browser surface:23 storage local get
cmux browser surface:23 storage local set myKey "myValue"
cmux browser surface:23 storage session clear
cmux browser surface:23 state save ./auth-state.json
cmux browser surface:23 state load ./auth-state.json
undefinedSave/restore full browser state (cookies + storage + tabs)
认证流程示例
cmux browser surface:23 state save ./auth-state.json
cmux browser surface:23 state load ./auth-state.json
undefinedbash
BROWSER=$(cmux --json browser open https://app.example.com/login | python3 -c "import sys,json; print(json.load(sys.stdin)['surface_ref'])")
cmux browser $BROWSER wait --load-state complete --timeout-ms 15000
cmux browser $BROWSER snapshot --interactive
cmux browser $BROWSER fill e1 "user@example.com"
cmux browser $BROWSER fill e2 "my-password"
cmux browser $BROWSER click e3
cmux browser $BROWSER wait --url-contains "/dashboard" --timeout-ms 20000Authentication flow
保存认证状态供后续使用
bash
BROWSER=$(cmux --json browser open https://app.example.com/login | python3 -c "import sys,json; print(json.load(sys.stdin)['surface_ref'])")
cmux browser $BROWSER wait --load-state complete --timeout-ms 15000
cmux browser $BROWSER snapshot --interactive
cmux browser $BROWSER fill e1 "user@example.com"
cmux browser $BROWSER fill e2 "my-password"
cmux browser $BROWSER click e3
cmux browser $BROWSER wait --url-contains "/dashboard" --timeout-ms 20000cmux browser $BROWSER state save ./auth-state.json
undefinedSave auth for reuse
诊断功能
cmux browser $BROWSER state save ./auth-state.json
bash
cmux browser surface:23 console list # JS控制台输出
cmux browser surface:23 console clear
cmux browser surface:23 errors list # JS错误信息
cmux browser surface:23 errors clear
cmux browser surface:23 highlight "#el" # 视觉高亮元素
cmux browser surface:23 screenshot # 捕获截图Reuse in a new surface
脚本与样式注入
BROWSER2=$(cmux --json browser open https://app.example.com | python3 -c "import sys,json; print(json.load(sys.stdin)['surface_ref'])")
cmux browser $BROWSER2 state load ./auth-state.json
cmux browser $BROWSER2 goto https://app.example.com/dashboard
undefinedbash
cmux browser surface:23 addscript "console.log('已注入')"
cmux browser surface:23 addstyle "body { background: red; }"
cmux browser surface:23 addinitscript "window.__injected = true" # 每次导航时运行Diagnostics
侧边栏状态与进度
bash
cmux browser surface:23 console list # JS console output
cmux browser surface:23 console clear
cmux browser surface:23 errors list # JS errors
cmux browser surface:23 errors clear
cmux browser surface:23 highlight "#el" # visual highlight
cmux browser surface:23 screenshot # capture screenshot无需打断用户即可展示实时状态:
bash
cmux set-status agent "工作中" --icon hammer --color "#ff9500"
cmux set-status agent "已完成" --icon checkmark --color "#34c759"
cmux clear-status agent
cmux set-progress 0.3 --label "运行测试中..."
cmux set-progress 1.0 --label "完成"
cmux clear-progress
cmux log "开始构建"
cmux log --level success "所有测试通过"
cmux log --level error --source build "编译失败"Script and style injection
通知功能
bash
cmux browser surface:23 addscript "console.log('injected')"
cmux browser surface:23 addstyle "body { background: red; }"
cmux browser surface:23 addinitscript "window.__injected = true" # runs on every navbash
cmux notify --title "任务完成" --body "所有测试通过"
cmux notify --title "需要输入" --subtitle "权限请求" --body "是否批准部署?"Sidebar Status and Progress
基于cmux的Agent团队协作
Show live status to the user without interrupting their flow:
bash
cmux set-status agent "working" --icon hammer --color "#ff9500"
cmux set-status agent "done" --icon checkmark --color "#34c759"
cmux clear-status agent
cmux set-progress 0.3 --label "Running tests..."
cmux set-progress 1.0 --label "Complete"
cmux clear-progress
cmux log "Starting build"
cmux log --level success "All tests passed"
cmux log --level error --source build "Compilation failed"使用cmux分屏为每个Agent队友提供独立的可视工作区。通过和任务列表协作 —— 绝不要通过读取彼此的终端输出协作。
SendMessageNotifications
协作模式
bash
cmux notify --title "Task Complete" --body "All tests passing"
cmux notify --title "Need Input" --subtitle "Permission" --body "Approve deployment?"- 为每个队友创建分屏
- 通过Agent工具生成队友,为每个队友分配cmux上下文引用
- 队友通过在各自分屏中运行命令
cmux send-surface - 队友通过和
cmux set-status报告状态cmux log - 用户可并排查看所有工作进程
Agent Teams with cmux
示例:3-Agent团队
Use cmux splits to give each agent teammate a visible workspace. Coordinate via and task lists — never via reading each other's terminal output.
SendMessagebash
undefinedThe pattern
为每个队友创建可视分屏
- Create splits for each teammate
- Spawn teammates via Agent tool — pass each their cmux surface ref
- Teammates run commands in their split via
cmux send-surface - Teammates report status via and
cmux set-statuscmux log - User sees all work side-by-side
SPLIT_1=$(cmux --json new-split right | python3 -c "import sys,json; print(json.load(sys.stdin)['surface_ref'])")
SPLIT_2=$(cmux --json new-split down | python3 -c "import sys,json; print(json.load(sys.stdin)['surface_ref'])")
SPLIT_3=$(cmux --json new-split down | python3 -c "import sys,json; print(json.load(sys.stdin)['surface_ref'])")
然后在每个队友的提示词中加入:你拥有一个cmux终端分屏,上下文为surface:42。
运行命令:cmux send-surface --surface surface:42 "command\n"
读取输出:cmux capture-pane --surface surface:42
设置状态:cmux set-status myagent "工作中" --icon hammer
记录进度:cmux log "消息"
绝不抢占焦点 —— 始终使用--surface指定目标。
undefinedExample: 3-agent team
混合布局:终端+浏览器
bash
undefinedbash
BUILD=$(cmux --json new-split right | python3 -c "import sys,json; print(json.load(sys.stdin)['surface_ref'])")
DOCS=$(cmux --json browser open https://docs.example.com | python3 -c "import sys,json; print(json.load(sys.stdin)['surface_ref'])")
TEST=$(cmux --json new-split down | python3 -c "import sys,json; print(json.load(sys.stdin)['surface_ref'])")Create visible splits for each teammate
核心规则
SPLIT_1=$(cmux --json new-split right | python3 -c "import sys,json; print(json.load(sys.stdin)['surface_ref'])")
SPLIT_2=$(cmux --json new-split down | python3 -c "import sys,json; print(json.load(sys.stdin)['surface_ref'])")
SPLIT_3=$(cmux --json new-split down | python3 -c "import sys,json; print(json.load(sys.stdin)['surface_ref'])")
Then in each teammate's prompt:You have a cmux terminal split at surface:42.
Run commands: cmux send-surface --surface surface:42 "command\n"
Read output: cmux capture-pane --surface surface:42
Set status: cmux set-status myagent "working" --icon hammer
Log progress: cmux log "message"
Never steal focus — always use --surface targeting.
undefined- 绝不要在分屏中运行—— 改用带
claude -p的Agent工具team_name - 先创建分屏再生成队友 —— 在提示词中传递上下文引用
- 每个队友一个分屏 —— 每个Agent拥有独立的可视工作区
- 通过SendMessage协作,不要读取彼此的终端输出
- 完成后清理:
cmux close-surface --surface <ref>
Mixed layout: terminals + browsers
速查手册
bash
BUILD=$(cmux --json new-split right | python3 -c "import sys,json; print(json.load(sys.stdin)['surface_ref'])")
DOCS=$(cmux --json browser open https://docs.example.com | python3 -c "import sys,json; print(json.load(sys.stdin)['surface_ref'])")
TEST=$(cmux --json new-split down | python3 -c "import sys,json; print(json.load(sys.stdin)['surface_ref'])")| 任务 | 命令 |
|---|---|
| 定位当前环境 | |
| 向右分屏 | |
| 向下分屏 | |
| 发送命令 | |
| 读取输出 | |
| 打开浏览器 | |
| 页面快照 | |
| 点击元素 | |
| 填充输入框 | |
| 等待加载 | |
| 读取页面文本 | |
| 执行JS | |
| 保存认证状态 | |
| 设置状态 | |
| 进度条 | |
| 发送日志 | |
| 发送通知 | |
| 关闭分屏 | |
| 捕获截图 | |
Key rules
常见模式
—
在后台分屏运行构建并查看日志
- Never spawn in splits — use the Agent tool with
claude -pinsteadteam_name - Create splits before spawning teammates — pass refs in their prompts
- One split per teammate — each owns their visible workspace
- Coordinate via SendMessage, not by reading each other's terminal output
- Clean up: when done
cmux close-surface --surface <ref>
bash
LOG=$(cmux --json new-split down | python3 -c "import sys,json; print(json.load(sys.stdin)['surface_ref'])")
cmux send-surface --surface "$LOG" "cargo build --release 2>&1 | tee /tmp/build.log\n"Quick Reference
... 处理其他工作 ...
| Task | Command |
|---|---|
| Where am I? | |
| Split right | |
| Split down | |
| Send command | |
| Read output | |
| Open browser | |
| Page snapshot | |
| Click element | |
| Fill input | |
| Wait for load | |
| Read page text | |
| Evaluate JS | |
| Find by role | |
| Save auth | |
| Load auth | |
| Set status | |
| Progress bar | |
| Log message | |
| Notify | |
| Close split | |
| Screenshot | |
cmux capture-pane --surface "$LOG" --scrollback | tail -20
undefinedCommon Patterns
QA测试流程
Run build in background split, tail logs
—
bash
LOG=$(cmux --json new-split down | python3 -c "import sys,json; print(json.load(sys.stdin)['surface_ref'])")
cmux send-surface --surface "$LOG" "cargo build --release 2>&1 | tee /tmp/build.log\n"bash
BROWSER=$(cmux --json browser open https://myapp.vercel.app | python3 -c "import sys,json; print(json.load(sys.stdin)['surface_ref'])")
cmux browser $BROWSER wait --load-state complete --timeout-ms 15000
cmux browser $BROWSER snapshot --interactive... do other work ...
使用e1、e2、e3等引用进行交互...
cmux capture-pane --surface "$LOG" --scrollback | tail -20
undefinedcmux browser $BROWSER screenshot
cmux browser $BROWSER errors list
cmux close-surface --surface $BROWSER
undefinedQA test flow
状态驱动的长任务
bash
BROWSER=$(cmux --json browser open https://myapp.vercel.app | python3 -c "import sys,json; print(json.load(sys.stdin)['surface_ref'])")
cmux browser $BROWSER wait --load-state complete --timeout-ms 15000
cmux browser $BROWSER snapshot --interactivebash
cmux set-status task "启动中" --icon clock --color "#ff9500"
cmux set-progress 0.0 --label "初始化..."Interact using e1, e2, e3 refs...
... 步骤1 ...
cmux browser $BROWSER screenshot
cmux browser $BROWSER errors list
cmux close-surface --surface $BROWSER
undefinedcmux set-progress 0.33 --label "构建中..."
Status-driven long task
... 步骤2 ...
bash
cmux set-status task "starting" --icon clock --color "#ff9500"
cmux set-progress 0.0 --label "Initializing..."cmux set-progress 0.66 --label "测试中..."
... step 1 ...
... 步骤3 ...
cmux set-progress 0.33 --label "Building..."
cmux set-progress 1.0 --label "完成"
cmux set-status task "已完成" --icon checkmark --color "#34c759"
cmux clear-progress
cmux notify --title "任务完成" --body "所有步骤已通过"
undefined... step 2 ...
—
cmux set-progress 0.66 --label "Testing..."
—
... step 3 ...
—
cmux set-progress 1.0 --label "Done"
cmux set-status task "complete" --icon checkmark --color "#34c759"
cmux clear-progress
cmux notify --title "Task complete" --body "All steps passed"
undefined—