Loading...
Loading...
Use this skill for ANY multi-pane or multi-agent terminal orchestration in cmux. Required when the user wants to: run things in parallel in separate terminal panes, split the terminal, spawn a sub-agent (Claude Code, Codex) in another pane, fan out tasks across splits, send keystrokes or text to another pane (including ctrl-c), read terminal output from another pane, update sidebar status or progress bar, open a URL in cmux's built-in browser pane, or display markdown preview alongside the terminal. The cmux CLI is the ONLY way to do these things — Bash cannot split panes or spawn agents. Trigger phrases: 'in parallel', 'split pane', 'spawn agent', 'fan out', 'new pane', 'browser pane', 'sidebar', 'send to pane', 'read from pane', 'show the plan', 'ctrl-c to', '分屏', '并行', '开个 pane'. NOT for: single command execution, basic bash operations, or questions about tmux.
npx skill4agent add jiahao-shao1/sjh-skills cmuxCMUX_WORKSPACE_IDCMUX_WORKSPACE_IDCMUX_SURFACE_IDCMUX_SOCKET_PATHworkspace:1pane:1surface:2cmux identify --json # your current context
cmux list-workspaces # all workspaces
cmux list-panes # panes in current workspace
cmux list-pane-surfaces --pane <ref> # surfaces in a pane
cmux tree --all # full hierarchy view
cmux trigger-flash --surface <ref> # flash surface for visual confirmation
cmux surface-health # detect hidden/detached surfacescmux new-split <left|right|up|down> # split current pane
cmux new-workspace --cwd <path> # new workspace tab
cmux new-surface # new tab in current panecmux sendsend# Claude Code — interactive mode (user can switch to this pane and intervene)
cmux send --surface <ref> 'export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 HTTPS_PROXY=http://127.0.0.1:7890 HTTP_PROXY=http://127.0.0.1:7890 ALL_PROXY=socks5://127.0.0.1:7890 && claude --dangerously-skip-permissions\n'
# Claude Code — non-interactive mode (run task, capture output, signal completion)
cmux send --surface <ref> 'export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 HTTPS_PROXY=http://127.0.0.1:7890 HTTP_PROXY=http://127.0.0.1:7890 ALL_PROXY=socks5://127.0.0.1:7890 && claude -p "your prompt" --model haiku 2>&1 | tee /tmp/agent-output.txt; echo "AGENT_DONE"\n'
# Codex — interactive mode (full-auto, user can intervene)
cmux send --surface <ref> 'export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 HTTPS_PROXY=http://127.0.0.1:7890 HTTP_PROXY=http://127.0.0.1:7890 ALL_PROXY=socks5://127.0.0.1:7890 && codex --dangerously-bypass-approvals-and-sandbox\n'
# Codex — with initial prompt
cmux send --surface <ref> 'export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 HTTPS_PROXY=http://127.0.0.1:7890 HTTP_PROXY=http://127.0.0.1:7890 ALL_PROXY=socks5://127.0.0.1:7890 && codex --dangerously-bypass-approvals-and-sandbox -p "your prompt"\n'cmux new-split <direction>cmux send --surface <new-ref> '<export https_proxy=... && agent command>\n'cmux send --surface <new-ref> 'prompt'cmux send-key --surface <new-ref> entercmux send --surface <ref> 'text\n' # send text + Enter (for shell commands)
cmux send --surface <ref> 'text' # send text only (no Enter)
cmux send-key --surface <ref> <key> # send special key (ctrl-c, enter, etc.)
cmux read-screen --surface <ref> --lines <n> # read last n lines of terminal output\n\n\nsend-key enter# Shell command — \n works as Enter
cmux send --surface <ref> 'ls -la\n'
# Interactive program — use send-key enter to submit
cmux send --surface <ref> 'your message here'
cmux send-key --surface <ref> entercmux set-status <key> <value> --icon <name> --color <#hex>
cmux set-progress <0.0-1.0> --label "text"
cmux log --level <info|success|warning|error> --source "agent" -- "message"
cmux notify --title "Title" --body "Body" # desktop notification
cmux clear-status <key> / cmux clear-progress / cmux clear-logcmux rename-workspace "name"
cmux rename-tab --surface <ref> "name"
cmux close-surface --surface <ref>
cmux close-workspace --workspace <ref>cmux --json browser open https://example.com # open browser split, returns surface ref
cmux browser <surface> wait --load-state complete --timeout-ms 15000
cmux browser <surface> snapshot --interactive # get clickable element refs
cmux browser <surface> click e1 # click element by ref
cmux browser <surface> fill e2 "text" # fill input field
cmux browser <surface> screenshot --out /tmp/s.png # take screenshot
cmux browser <surface> get url # current URL
cmux browser <surface> get title # page title
cmux browser <surface> navigate <url> # go to URLcmux markdown open plan.md # open preview panel (auto-reloads on file change)
cmux markdown open plan.md --workspace workspace:2 # target specific workspacecmux new-split right
cmux send --surface surface:2 'export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 HTTPS_PROXY=http://127.0.0.1:7890 HTTP_PROXY=http://127.0.0.1:7890 ALL_PROXY=socks5://127.0.0.1:7890 && claude -p "analyze project structure" --model haiku > /tmp/a1.txt; echo "DONE"\n'
cmux new-split down
cmux send --surface surface:3 'export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 HTTPS_PROXY=http://127.0.0.1:7890 HTTP_PROXY=http://127.0.0.1:7890 ALL_PROXY=socks5://127.0.0.1:7890 && claude -p "count code lines" --model haiku > /tmp/a2.txt; echo "DONE"\n'
cmux set-status task "Running" --icon hammer --color "#1565C0"
# Poll: cmux read-screen --surface surface:2 --lines 5
# Collect: cat /tmp/a1.txt /tmp/a2.txt
# Clean up: cmux close-surface --surface surface:2 && cmux close-surface --surface surface:3# Claude Code in right split
cmux new-split right
cmux send --surface surface:2 'export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 HTTPS_PROXY=http://127.0.0.1:7890 HTTP_PROXY=http://127.0.0.1:7890 ALL_PROXY=socks5://127.0.0.1:7890 && claude --dangerously-skip-permissions\n'
# Codex in right split (full-auto mode)
cmux new-split right
cmux send --surface surface:2 'export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 HTTPS_PROXY=http://127.0.0.1:7890 HTTP_PROXY=http://127.0.0.1:7890 ALL_PROXY=socks5://127.0.0.1:7890 && codex --dangerously-bypass-approvals-and-sandbox\n'# Wait for the agent to be ready, then send context
sleep 5
cmux send --surface surface:2 'Here is the task: ...'
cmux send-key --surface surface:2 enter⌥⌘→cmux set-progress 0.0 --label "Starting"
# ... work ...
cmux set-progress 0.5 --label "Testing"
# ... work ...
cmux set-progress 1.0 --label "Complete"
cmux clear-progress
cmux notify --title "Done" --body "All tasks finished"--surface <ref>select-workspacefocus-paneidentify --json