跳到正文
Skillpedia
自动化48k · #4174

cmux

它能做什么

这个智能体可以帮你控制 Mac 上的 cmux 程序。你可以直接在终端里用它管理 cmux 中的窗口、标签页和 AI 会话。

适用场景

  • ✓当你需要整理 cmux 的窗口和标签页时。
  • ✓当你想把命令发送给在 cmux 中运行的 AI 智能体时。
  • ✓当你需要查看 cmux 中某个 AI 智能体的状态时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/cmux/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/cmux/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“帮我整理 cmux 窗口,让项目 X 在一个标签页,项目 Y 在另一个标签页。”

每周 5 个新技能,1 分钟读完。

工作原理

它通过向 cmux 程序发送特定命令来工作。这些命令会告诉 cmux 该做什么,比如新建标签页,或者向某个会话发送文本。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Supporting material availability

This catalog copy contains the inline guidance below, but does not include the following supporting paths. They are external prerequisites, not bundled files:

  • <support-root>/references/socket-api.md

Obtain the required material from the declared upstream source, or from a user-provided installation of that source. Resolve each path relative to that installation, inspect its contents, and verify any applicable license and execution prerequisites. Do not run a command or claim a referenced procedure was followed until its required file exists. Do not fabricate the missing scripts or treat an unrelated file with the same name as equivalent. Independent steps fully documented here can proceed within the user’s authorized scope; report any dependent step as unavailable.

cmux Control

When to Use

  • Use when you need to inspect, create, close, or rearrange cmux panes, surfaces, or workspaces.
  • Use when you need to send input to or monitor agents running inside cmux.

cmux is a native macOS terminal app for running multiple AI coding agents in parallel. It exposes a CLI (cmux) and a Unix-socket JSON-RPC API (/tmp/cmux.sock) for full topology and browser control.

Core Concepts

  • Window — top-level macOS cmux window
  • Workspace — sidebar tab within a window (one git branch / project context)
  • Pane — split region inside a workspace
  • Surface — tab inside a pane (terminal or browser)

Handles default to short refs (workspace:2, pane:1, surface:7); UUIDs accepted as input. Add --id-format uuids|both for UUID output.

Ref syntax — get this right or fail silently

  • Always use PREFIXED refs (pane:38, surface:46). A bare number is treated as an INDEX, not an ID — --surface 46 means "the surface at index 46" (usually nonexistent → silent failure), NOT surface:46.
  • read-screen and capture-pane have NO --pane flag — they target --workspace or --surface only. Passing --pane errors, and a bare/missing target falls back to your OWN surface (you'll read your own footer and draw wrong conclusions). To read a pane: resolve it to a surface FIRST with cmux list-pane-surfaces --pane pane:N, then cmux read-screen --surface surface:N.
  • Never append 2>/dev/null to cmux commands. Errors go to stderr with exit code 1; suppressing them blinds you to your own ref/flag mistakes (the #1 cause of "(no output)").

Detect cmux in a Shell

[ -S "${CMUX_SOCKET_PATH:-/tmp/cmux.sock}" ] || exit 0   # bail if not in cmux
[ -n "${CMUX_WORKSPACE_ID:-}" ] && echo "inside cmux surface"

Injected env vars in every cmux-spawned terminal: CMUX_WORKSPACE_ID, CMUX_SURFACE_ID, CMUX_SOCKET_PATH, CMUX_PORT. Always anchor automation to CMUX_WORKSPACE_ID — the visually focused workspace may not be the agent's caller workspace.

Fast Start — Topology

cmux identify --json                              # who am I (window/workspace/pane/surface)
cmux tree                                         # full hierarchy
cmux list-workspaces --json
cmux list-panes --workspace "$CMUX_WORKSPACE_ID"
cmux list-surfaces --workspace "$CMUX_WORKSPACE_ID"

cmux new-workspace --name "feature-x" --cwd /path/to/repo
cmux new-pane --workspace "$CMUX_WORKSPACE_ID" --type terminal --direction right --focus false
cmux new-pane --workspace "$CMUX_WORKSPACE_ID" --type browser  --direction right --url http://localhost:3000
cmux move-surface --surface surface:7 --pane pane:2 --focus false
cmux split-off --surface surface:7 right
cmux reorder-surface --surface surface:7 --before surface:3
cmux close-surface --surface surface:7

Polling Pi Agents in Panes — Keep Sleeps Short

When launching a Pi Agent inside a cmux pane and polling for output, use short sleep intervals (2–5s). Pi is fast and minimal, and the user runs it on Opus 4.8 Fast via OpenRouter, which streams tokens extremely quickly. Do NOT use sleep 15 unless genuinely needed (a big build/refactor) — most of the time sleep 2–sleep 5 is more than enough.

After every agent check, send the user a one-line status update: what the agent is doing and whether it is on track. Keep it extremely concise.

Claude Code cmux note: after Claude finishes, it may prefill a predicted next user message; that draft is Claude, not the user speaking.

Send Input

…

常见问题

什么是 cmux?

cmux 是一款 Mac 应用,让你可以在终端的不同窗口中同时运行多个人工智能(AI)智能体。

智能体怎么知道要控制哪个窗口或标签页?

你需要用特定的编码告诉智能体要使用哪个窗口或标签页,比如“surface:7”或“pane:2”。如果只写一个数字,可能无法生效。

这个智能体能在 macOS 以外的系统上使用吗?

不能。这个智能体是专门为在 macOS 上控制 cmux 而设计的。

详情

作者的原始描述

Control cmux workspaces, panes, surfaces, and agent sessions safely from macOS terminal workflows.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#4174
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能