cmux
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseThis skill provides complete knowledge of the CLI so you can control the cmux terminal multiplexer without needing to rediscover its interface.
cmux本技能提供了完整的 CLI相关知识,让你无需重新摸索其接口即可控制cmux终端复用器。
cmuxBinary Location
二进制文件位置
/Applications/cmux.app/Contents/Resources/bin/cmuxUsually on PATH as .
cmux/Applications/cmux.app/Contents/Resources/bin/cmux通常在PATH中可直接使用调用。
cmuxGlobal Options
全局选项
cmux [--socket PATH] [--window WINDOW] [--password PASSWORD] [--json] [--id-format refs|uuids|both] [--version] <command> [options]- : Output JSON (use this when you need to parse results programmatically)
--json - : Control ID format in output (defaults to refs)
--id-format refs|uuids|both - : Override Unix socket path
--socket PATH - : Socket auth password
--password PASSWORD
cmux [--socket PATH] [--window WINDOW] [--password PASSWORD] [--json] [--id-format refs|uuids|both] [--version] <command> [options]- :输出JSON格式结果(当你需要通过程序解析结果时使用)
--json - :控制输出中的ID格式(默认是refs)
--id-format refs|uuids|both - :覆盖Unix套接字路径
--socket PATH - :套接字认证密码
--password PASSWORD
Environment Variables
环境变量
- - Auto-set in cmux terminals. Default
CMUX_WORKSPACE_IDfor all commands.--workspace - - Optional alias for
CMUX_TAB_ID/tab-actiondefaultrename-tab.--tab - - Auto-set in cmux terminals. Default
CMUX_SURFACE_ID.--surface - - Override the default Unix socket path (
CMUX_SOCKET_PATH)./tmp/cmux.sock
Important: Because and are auto-set, most commands work without explicit / flags when run from within a cmux terminal. They default to the caller's context.
CMUX_WORKSPACE_IDCMUX_SURFACE_ID--workspace--surface- - 在cmux终端中自动设置,所有命令的默认
CMUX_WORKSPACE_ID参数值--workspace - - 可选别名,用于
CMUX_TAB_ID/tab-action命令的默认rename-tab参数--tab - - 在cmux终端中自动设置,默认
CMUX_SURFACE_ID参数值--surface - - 覆盖默认Unix套接字路径(
CMUX_SOCKET_PATH)/tmp/cmux.sock
重要提示:由于和是自动设置的,在cmux终端内运行大多数命令时无需显式指定/参数,会默认使用调用者的上下文。
CMUX_WORKSPACE_IDCMUX_SURFACE_ID--workspace--surfaceID/Ref System
ID/引用系统
Most commands accept IDs in these formats:
- UUIDs: Full unique identifiers
- Short refs: ,
window:1,workspace:2,pane:3surface:4 - Indexes: Numeric indexes
tab-actiontab:<n>surface:<n>大多数命令接受以下格式的ID:
- UUIDs:完整的唯一标识符
- 短引用:、
window:1、workspace:2、pane:3surface:4 - 索引:数字索引
tab-actionsurface:<n>tab:<n>Commands Reference
命令参考
Discovery & Status
发现与状态
| Command | Description |
|---|---|
| Show cmux version |
| Check if cmux is running |
| List supported capabilities |
| Identify current context |
| Command | Description |
|---|---|
| 显示cmux版本 |
| 检查cmux是否正在运行 |
| 列出支持的功能 |
| 识别当前上下文 |
Windows
窗口
| Command | Description |
|---|---|
| List all windows |
| Get the current window |
| Create a new window |
| Focus a window |
| Close a window |
| Rename a window |
| Navigate windows |
| Command | Description |
|---|---|
| 列出所有窗口 |
| 获取当前窗口 |
| 创建新窗口 |
| 聚焦到指定窗口 |
| 关闭指定窗口 |
| 重命名窗口 |
| 窗口导航 |
Workspaces (tabs in the UI)
工作区(UI中的标签页)
| Command | Description |
|---|---|
| List all workspaces |
| Get current workspace |
| Create workspace, optionally run a command |
| Switch to workspace |
| Close workspace |
| Rename workspace |
| Trigger workspace action |
| Move workspace to another window |
| Reorder workspace |
| Command | Description |
|---|---|
| 列出所有工作区 |
| 获取当前工作区 |
| 创建工作区,可选运行指定命令 |
| 切换到指定工作区 |
| 关闭指定工作区 |
| 重命名工作区 |
| 触发工作区动作 |
| 将工作区移动到其他窗口 |
| 重排工作区顺序 |
Panes & Surfaces
窗格与表层
| Command | Description |
|---|---|
| List panes in workspace |
| List surfaces in a pane |
| Focus a pane |
| Create a new pane |
| Split current pane |
| Add surface (tab) to pane |
| Close a surface |
| Move surface between panes |
| Reorder surface within pane |
| Drag surface into a new split |
| Resize pane |
| Swap two panes |
| Break pane into new workspace |
| Join pane into another |
| Focus previous pane |
| Refresh all surfaces |
| Check surface health |
| Respawn a pane |
| Command | Description |
|---|---|
| 列出工作区中的所有窗格 |
| 列出指定窗格中的所有表层 |
| 聚焦到指定窗格 |
| 创建新窗格 |
| 拆分当前窗格 |
| 向窗格添加表层(标签页) |
| 关闭指定表层 |
| 在窗格之间移动表层 |
| 在窗格内重排表层顺序 |
| 将表层拖动到新分屏 |
| 调整窗格大小 |
| 交换两个窗格 |
| 将窗格拆分到新工作区 |
| 将窗格合并到另一个窗格 |
| 聚焦到上一个窗格 |
| 刷新所有表层 |
| 检查表层健康状态 |
| 重启窗格 |
Tabs (Surface-level)
标签页(表层级别)
| Command | Description |
|---|---|
| Trigger tab action |
| Rename a tab |
| Flash a surface |
| Command | Description |
|---|---|
| 触发标签页动作 |
| 重命名标签页 |
| 闪烁指定表层 |
Panels
面板
| Command | Description |
|---|---|
| List panels |
| Focus a panel |
| Send text to panel |
| Send keypress to panel |
| Command | Description |
|---|---|
| 列表面板 |
| 聚焦到指定面板 |
| 向面板发送文本 |
| 向面板发送按键 |
Reading & Sending to Terminals
终端内容读取与指令发送
| Command | Description |
|---|---|
| Read terminal screen content |
| Alias for read-screen |
| Send text to a terminal |
| Send a keypress to a terminal |
| Pipe pane output to a command |
| Clear scrollback history |
| Find window by content or title |
| Command | Description |
|---|---|
| 读取终端屏幕内容 |
| read-screen的别名 |
| 向终端发送文本 |
| 向终端发送按键 |
| 将窗格输出管道到指定命令 |
| 清除回滚历史 |
| 按内容或标题查找窗口 |
Clipboard / Buffers
剪贴板/缓冲区
| Command | Description |
|---|---|
| Store text in a named buffer |
| List all buffers |
| Paste buffer into surface |
| Command | Description |
|---|---|
| 将文本存储到命名缓冲区 |
| 列出所有缓冲区 |
| 将缓冲区内容粘贴到表层 |
Notifications
通知
| Command | Description |
|---|---|
| Send a notification |
| List notifications |
| Clear notifications |
| Command | Description |
|---|---|
| 发送通知 |
| 列出通知 |
| 清除通知 |
Sidebar Metadata
侧边栏元数据
| Command | Description |
|---|---|
| Set sidebar status |
| Clear a status key |
| List all status entries |
| Set progress bar |
| Clear progress bar |
| Write to sidebar log |
| Clear sidebar log |
| List log entries |
| Get sidebar state |
| Command | Description |
|---|---|
| 设置侧边栏状态 |
| 清除指定状态键 |
| 列出所有状态条目 |
| 设置进度条 |
| 清除进度条 |
| 写入侧边栏日志 |
| 清除侧边栏日志 |
| 列出日志条目 |
| 获取侧边栏状态 |
Browser Control
浏览器控制
Create and control browser panes within cmux.
Opening browsers:
cmux browser open [url] # Open browser in caller's workspace
cmux browser open-split [url] # Open as a split
cmux new-pane --type browser [--url <url>] [--direction left|right|up|down]Navigation:
cmux browser goto|navigate <url> [--snapshot-after]
cmux browser back|forward|reload [--snapshot-after]
cmux browser url|get-urlReading page content:
cmux browser snapshot [--interactive|-i] [--cursor] [--compact] [--max-depth <n>] [--selector <css>]
cmux browser get <url|title|text|html|value|attr|count|box|styles> [...]
cmux browser console <list|clear>
cmux browser errors <list|clear>Interacting with elements:
cmux browser click|dblclick|hover|focus|check|uncheck|scroll-into-view <selector> [--snapshot-after]
cmux browser type <selector> <text> [--snapshot-after]
cmux browser fill <selector> [text] [--snapshot-after] # empty text clears input
cmux browser press|keydown|keyup <key> [--snapshot-after]
cmux browser select <selector> <value> [--snapshot-after]
cmux browser scroll [--selector <css>] [--dx <n>] [--dy <n>] [--snapshot-after]Querying elements:
cmux browser is <visible|enabled|checked> <selector>
cmux browser find <role|text|label|placeholder|alt|title|testid|first|last|nth> ...
cmux browser highlight <selector>Waiting:
cmux browser wait [--selector <css>] [--text <text>] [--url-contains <text>] [--load-state <interactive|complete>] [--function <js>] [--timeout-ms <ms>]JavaScript execution:
cmux browser eval <script>Page manipulation:
cmux browser frame <selector|main>
cmux browser dialog <accept|dismiss> [text]
cmux browser viewport <width> <height>
cmux browser geolocation|geo <lat> <lon>
cmux browser offline <true|false>
cmux browser addscript <script>
cmux browser addstyle <css>
cmux browser addinitscript <script>State & network:
cmux browser state <save|load> <path>
cmux browser cookies <get|set|clear> [...]
cmux browser storage <local|session> <get|set|clear> [...]
cmux browser download [wait] [--path <path>] [--timeout-ms <ms>]
cmux browser network <route|unroute|requests> [...]
cmux browser trace <start|stop> [path]
cmux browser screencast <start|stop>
cmux browser input <mouse|keyboard|touch>Browser tabs:
cmux browser tab <new|list|switch|close|<index>> [...]Browser identity:
cmux browser identify [--surface <id|ref|index>]在cmux中创建和控制浏览器窗格。
打开浏览器:
cmux browser open [url] # 在调用者的工作区打开浏览器
cmux browser open-split [url] # 作为分屏打开
cmux new-pane --type browser [--url <url>] [--direction left|right|up|down]导航:
cmux browser goto|navigate <url> [--snapshot-after]
cmux browser back|forward|reload [--snapshot-after]
cmux browser url|get-url读取页面内容:
cmux browser snapshot [--interactive|-i] [--cursor] [--compact] [--max-depth <n>] [--selector <css>]
cmux browser get <url|title|text|html|value|attr|count|box|styles> [...]
cmux browser console <list|clear>
cmux browser errors <list|clear>与元素交互:
cmux browser click|dblclick|hover|focus|check|uncheck|scroll-into-view <selector> [--snapshot-after]
cmux browser type <selector> <text> [--snapshot-after]
cmux browser fill <selector> [text] [--snapshot-after] # 空文本会清空输入框
cmux browser press|keydown|keyup <key> [--snapshot-after]
cmux browser select <selector> <value> [--snapshot-after]
cmux browser scroll [--selector <css>] [--dx <n>] [--dy <n>] [--snapshot-after]查询元素:
cmux browser is <visible|enabled|checked> <selector>
cmux browser find <role|text|label|placeholder|alt|title|testid|first|last|nth> ...
cmux browser highlight <selector>等待:
cmux browser wait [--selector <css>] [--text <text>] [--url-contains <text>] [--load-state <interactive|complete>] [--function <js>] [--timeout-ms <ms>]JavaScript执行:
cmux browser eval <script>页面操作:
cmux browser frame <selector|main>
cmux browser dialog <accept|dismiss> [text]
cmux browser viewport <width> <height>
cmux browser geolocation|geo <lat> <lon>
cmux browser offline <true|false>
cmux browser addscript <script>
cmux browser addstyle <css>
cmux browser addinitscript <script>状态与网络:
cmux browser state <save|load> <path>
cmux browser cookies <get|set|clear> [...]
cmux browser storage <local|session> <get|set|clear> [...]
cmux browser download [wait] [--path <path>] [--timeout-ms <ms>]
cmux browser network <route|unroute|requests> [...]
cmux browser trace <start|stop> [path]
cmux browser screencast <start|stop>
cmux browser input <mouse|keyboard|touch>浏览器标签页:
cmux browser tab <new|list|switch|close|<index>> [...]浏览器识别:
cmux browser identify [--surface <id|ref|index>]Hooks & Signals
钩子与信号
| Command | Description |
|---|---|
| Set/list/unset hooks |
| Wait for or send a signal |
| Command | Description |
|---|---|
| 设置/列出/取消钩子 |
| 等待或发送信号 |
Other
其他
| Command | Description |
|---|---|
| Set app focus state |
| Simulate app becoming active |
| Claude session hooks |
| Display a message |
| Key binding controls |
| Show popup |
| Command | Description |
|---|---|
| 设置应用聚焦状态 |
| 模拟应用变为活跃状态 |
| Claude会话钩子 |
| 显示消息 |
| 按键绑定控制 |
| 显示弹窗 |
Common Patterns
常用场景示例
Discover current layout
查看当前布局
bash
cmux identify # Who am I?
cmux list-workspaces --json # All workspaces
cmux list-panes --json # All panes in current workspacebash
cmux identify # 查看当前上下文
cmux list-workspaces --json # 查看所有工作区
cmux list-panes --json # 查看当前工作区的所有窗格Run a command in a new split
在新分屏中运行命令
bash
cmux new-split right # Create split to the rightbash
cmux new-split right # 在右侧创建分屏Then send a command to it (need to target the new surface)
然后向新分屏发送命令(需要指定新的表层)
cmux send --surface <new-surface-ref> "npm run dev"
cmux send-key --surface <new-surface-ref> Enter
undefinedcmux send --surface <new-surface-ref> "npm run dev"
cmux send-key --surface <new-surface-ref> Enter
undefinedRead what's on another terminal
读取其他终端的内容
bash
cmux read-screen --surface <ref> # Current visible content
cmux read-screen --surface <ref> --scrollback --lines 200 # With scrollbackbash
cmux read-screen --surface <ref> # 当前可见内容
cmux read-screen --surface <ref> --scrollback --lines 200 # 包含回滚历史Open a browser alongside terminal
在终端旁打开浏览器
bash
cmux browser open http://localhost:3000bash
cmux browser open http://localhost:3000or as a directional split:
或者作为定向分屏打开:
cmux new-pane --type browser --direction right --url http://localhost:3000
undefinedcmux new-pane --type browser --direction right --url http://localhost:3000
undefinedShow progress in sidebar
在侧边栏显示进度
bash
cmux set-progress 0.5 --label "Building..."
cmux log --level info --source claude -- "Step 3/5 complete"
cmux set-status task "Running tests" --icon checkmark --color "#00ff00"bash
cmux set-progress 0.5 --label "构建中..."
cmux log --level info --source claude -- "步骤3/5完成"
cmux set-status task "运行测试" --icon checkmark --color "#00ff00"Tips
提示
- Always use when you need to parse output programmatically.
--json - When creating splits/panes, capture the output to get the new surface/pane ID for subsequent commands.
- is invaluable for checking what's happening in other terminals.
read-screen - sends raw text; remember to follow with
sendto execute a command.send-key Enter - Browser gives you a DOM snapshot — use
snapshotfor a smaller representation.--compact - Use on browser interaction commands to get the page state after the action.
--snapshot-after
- 当你需要通过程序解析输出时始终使用参数。
--json - 创建分屏/窗格时,捕获输出以获取新的表层/窗格ID,供后续命令使用。
- 对于检查其他终端的运行状态非常有用。
read-screen - 发送原始文本;记得后续调用
send来执行命令。send-key Enter - 浏览器命令会返回DOM快照——使用
snapshot参数可以获得更小的返回内容。--compact - 在浏览器交互命令上使用参数可以获取操作后的页面状态。
--snapshot-after