Token导航 LogoToken导航TokenDH.com
前端设计敏感数据github未标认证来源可访问许可证需确认审计提醒

cmuxcmux 控制

Agent Skill

cmux 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

212

周安装

9

GitHub Stars

81

下载量

74
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:cmux(cmux 控制)
来源仓库:https://github.com/dagster-io/erk
仓库路径:skills/cmux
安装命令:
npx skills add https://github.com/dagster-io/erk --skill cmux
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/dagster-io/erk --skill cmux

简介

cmux 是一个原生 macOS 终端多路复用器应用,支持工作区、面板分割及 GPU 加速渲染。

  • 适用于需要在终端内管理多个会话、窗口或浏览器实例的场景,尤其适合开发调试环境。
  • 通过 Unix 域套接字 /tmp/cmux.sock 与 CLI 通信,提供类似 tmux 但更现代化的交互体验。
  • 安装前请确认是否为 macOS 环境,并检查是否有权限访问临时目录及运行 Swift 应用。
  • 该技能主要面向本地终端使用,不涉及远程 API 调用或网络请求。

SKILL.md

cmux - Terminal Multiplexer

Overview

cmux is a native macOS terminal application (Swift/AppKit) that provides terminal multiplexing with workspaces, panes, and splits. It uses Ghostty's rendering engine (libghostty) for GPU-accelerated terminal output. The CLI communicates with the running app via a Unix domain socket at /tmp/cmux.sock.

Think of cmux as "tmux reimagined as a native macOS app" -- it has workspaces (like tmux windows), panes (like tmux panes), and surfaces (individual terminal or browser instances within panes), all controllable via a rich CLI.

When to Load the Reference

This skill covers the mental model, common commands, gotchas, and erk integration. Load references/cmux-reference.md when you need:

  • Browser automation syntax (40+ subcommands: navigation, forms, cookies, storage, console, waiting, dialogs, downloads, state)
  • Window management (list-windows, new-window, focus-window, close-window, move-workspace-to-window)
  • Surface management (move-surface, reorder-surface, drag-surface-to-split, surface-health)
  • Panel/Tab commands (list-panels, focus-panel, tab-action, rename-tab)
  • Sidebar metadata (clear-status, list-status, clear-progress, clear-log, list-log, sidebar-state)
  • Full tmux compat (20+ commands: pipe-pane, wait-for, copy-mode, set-hook, bind-key, popup, etc.)
  • Utility/diagnostic (ping, capabilities, claude-hook, set-app-focus)
  • Workflow recipes (browser automation, layout scripting, notification workflows)

Core Concepts

Object Hierarchy

Window (top-level OS window)
  +-- Workspace (vertical tab, like a tmux window)
        +-- Pane (a split region)
              +-- Surface (terminal or browser instance)
  • Window: macOS application window. Multiple windows supported.
  • Workspace: A tab in the sidebar. Contains one or more panes.
  • Pane: A split region within a workspace. Can be split left/right/up/down.
  • Surface: An actual terminal or browser instance inside a pane.

Addressing / Refs

Objects are referenced by UUID (A1B2C3D4-...), short ref (workspace:1, pane:2, surface:3), or numeric index (0, 1). Use --id-format refs|uuids|both to control output format.

Environment Variables

cmux sets these inside managed terminals: CMUX_WORKSPACE_ID (current workspace UUID, used as default for --workspace), CMUX_SURFACE_ID, CMUX_TAB_ID, CMUX_SOCKET_PATH (default: /tmp/cmux.sock).

Socket Communication

Unix domain socket at /tmp/cmux.sock. V2 API uses newline-delimited JSON. CLI wraps socket calls into user-friendly commands.

Quick Command Reference

Global Flags

--socket PATH              Override socket path (default: /tmp/cmux.sock)
--window WINDOW            Target specific window
--password PASSWORD        Socket auth password
--json                     Output as JSON
--id-format refs|uuids|both  Control ID format
--version, -v              Show version
--help, -h                 Show help

Workspace Commands

CommandDescription
new-workspace [--command <text>]Create workspace (auto-appends \n). Returns OK <uuid>
list-workspacesList all workspaces
select-workspace --workspace <ref>Switch to workspace
rename-workspace [--workspace <ref>] <title>Rename workspace
close-workspace --workspace <ref>Close workspace
current-workspacePrint current workspace ID

Pane and Input Commands

CommandDescription
`new-split <left\right\up\down> [--workspace <ref>]`Split pane
`new-surface [--type <terminal\browser>] [--pane <ref>]`Add surface
list-panes [--workspace <ref>]List panes
focus-pane --pane <ref>Focus pane
close-surface [--surface <ref>]Close surface
send [--workspace <ref>] [--surface <ref>] <text>Send text (must include \n)
send-key [--workspace <ref>] [--surface <ref>] <key>Send keystroke
read-screen [--workspace <ref>] [--surface <ref>] [--scrollback] [--lines <n>]Read terminal content

Notification / Status Commands

CommandDescription
notify --title <text> [--subtitle <text>] [--body <text>]Send notification
set-status <key> <value> [--icon <name>] [--color <hex>]Set sidebar status
set-progress <0.0-1.0> [--label <text>]Set progress bar
log [--level <level>] [--source <name>] <message>Add log entry

Browser Subsystem (Summary)

The browser subsystem has 40+ commands for full web automation. Key categories:

  • Navigation: browser open, browser navigate/goto, browser back/forward/reload
  • Interaction: browser click, browser fill, browser type, browser select, browser press
  • Inspection: browser snapshot [--interactive], browser eval <js>, browser get, browser is
  • Waiting: browser wait --selector|--text|--url-contains|--function [--timeout-ms]
  • --snapshot-after flag: Most interaction commands accept this flag to automatically capture a snapshot after the action

Load references/cmux-reference.md for full browser command syntax.

Key Commands Not in Quick Reference

These are documented in the reference file:

  • wait-for <channel> -- Inter-process synchronization (tmux compat)
  • claude-hook <event> -- Claude Code integration hook
  • pipe-pane -- Pipe pane output to external command
  • popup -- Show popup overlay
  • set-hook / bind-key / unbind-key -- Hook and key binding management

Critical Gotchas

--command auto-appends newline

cmux new-workspace --command 'echo hello' automatically appends \n, so the command executes immediately. Do NOT add your own \n.

send requires explicit \n

Unlike --command, cmux send does NOT auto-append a newline. You must include it:

# WRONG - text is typed but not executed
cmux send --workspace "$WS" "echo hello"

# CORRECT - command executes
cmux send --workspace "$WS" $'echo hello\n'

Output format: OK <uuid>

cmux new-workspace returns OK <uuid>. Extract the workspace ID:

WS=$(cmux new-workspace | awk '{print $2}')

Shell quoting with --command

Use single quotes to prevent outer shell expansion of $():

# CORRECT - subshell runs inside workspace
cmux new-workspace --command 'source <(erk slot teleport 456 --new-slot --script --sync)'

# WRONG - subshell expands in current shell
cmux new-workspace --command "source <(erk slot teleport 456 --new-slot --script --sync)"

No --working-directory CLI flag

The CLI does not expose a working directory flag. Workaround:

cmux new-workspace --command 'cd /path/to/project'

Startup delay

There is a ~0.5s internal delay after workspace creation before commands are sent, to allow the shell to initialize. Keep this in mind when chaining commands.

Workspace names are just labels

cmux knows nothing about git branches. Branch names used as workspace titles via rename-workspace are purely cosmetic labels for human navigation.

Erk Integration

Configuration

cmux integration is gated on a global config flag:

# ~/.erk/config.toml
cmux_integration = true

Check/set via CLI:

erk config get cmux_integration
erk config set cmux_integration true

erk exec cmux-open-pr

Creates a cmux workspace that opens a PR with checkout or teleport mode:

erk exec cmux-open-pr --pr 8152
erk exec cmux-open-pr --pr 8152 --branch "my-branch"
erk exec cmux-open-pr --pr 8152 --mode teleport

What it does:

  1. Auto-detects PR head branch via gh pr view --json headRefName (if --branch omitted)
  2. Creates workspace with:

- checkout mode (default): source <(erk pr checkout <pr> --script) - teleport mode: source <(erk slot teleport <pr> --new-slot --script --sync)

  1. Renames workspace to the branch name
  2. Outputs JSON: {"success": true, "pr_number": N, "branch": "...", "workspace_name": "..."}

TUI Dashboard Commands

When cmux_integration is enabled, the erk dash TUI command palette exposes:

  • cmux checkout (action) -- Creates a cmux workspace for the selected plan's PR
  • copy cmux checkout (copy) -- Copies the cmux open command to clipboard

Both require a plan with pr_number and pr_head_branch.

Common Scripting Patterns

# Create workspace and run command
WS=$(cmux new-workspace --command 'cd ~/code/myproject && make build' | awk '{print $2}')
cmux rename-workspace --workspace "$WS" "build"

# Create workspace, then send commands separately
WS=$(cmux new-workspace | awk '{print $2}')
cmux send --workspace "$WS" $'cd ~/code/myproject\n'
cmux send --workspace "$WS" $'make test\n'

# Read terminal output
cmux read-screen --workspace "$WS" --lines 50
cmux read-screen --workspace "$WS" --scrollback

# Split workspace layout
WS=$(cmux new-workspace --command 'cd ~/code/project' | awk '{print $2}')
cmux new-split right --workspace "$WS"

# JSON output for scripting
cmux --json list-workspaces
cmux select-workspace --workspace workspace:0

Troubleshooting

IssueCauseFix
Connection refusedcmux app not runningLaunch cmux.app
Socket not foundWrong socket pathCheck /tmp/cmux.sock exists
Command typed but not executedMissing \n in sendUse $'command\n'
Wrong workspace targetedNo --workspace flagUse $CMUX_WORKSPACE_ID or explicit ref
--command text expanded too earlyDouble quotes around $()Use single quotes

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.22%
按下载量换算28

Claude

30.09%
按下载量换算22

Cursor

20.15%
按下载量换算15

Gemini CLI

10.12%
按下载量换算7

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills