tmux-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

tmux-cli

tmux-cli

Instructions

使用说明

Use the
tmux-cli
command to communicate with other CLI Agents or Scripts in other tmux panes. Do
tmux-cli --help
to see how to use it!
This command depends on installing the
claude-code-tools
. If you get an error indicating that the command is not available, ask the user to install it using:
uv tool install claude-code-tools
.
使用
tmux-cli
命令与其他tmux窗格中的CLI Agent或脚本进行通信。执行
tmux-cli --help
查看使用方法!
该命令依赖于安装
claude-code-tools
。如果您收到命令不可用的错误提示,请要求用户通过以下命令安装:
uv tool install claude-code-tools

Key Commands

核心命令

Execute with Exit Code Detection

带退出码检测的执行

Use
tmux-cli execute
when you need to know if a shell command succeeded or failed:
bash
tmux-cli execute "make test" --pane=2
当您需要知道shell命令执行成功或失败时,使用
tmux-cli execute
bash
tmux-cli execute "make test" --pane=2

Returns JSON: {"output": "...", "exit_code": 0}

返回JSON: {"output": "...", "exit_code": 0}

tmux-cli execute "npm install" --pane=ops:1.3 --timeout=60
tmux-cli execute "npm install" --pane=ops:1.3 --timeout=60

Returns exit_code=0 on success, non-zero on failure, -1 on timeout

成功时返回exit_code=0,失败时返回非零值,超时返回-1


This is useful for:

- Running builds and knowing if they passed
- Running tests and detecting pass/fail
- Multi-step automation that should abort on failure

**Note**: `execute` is for shell commands only, not for agent-to-agent chat.
For communicating with another Claude Code instance, use `send` + `wait_idle` +
`capture` instead.

这适用于:

- 运行构建并了解是否通过
- 运行测试并检测通过/失败情况
- 失败时应终止的多步骤自动化流程

**注意**:`execute`仅适用于shell命令,不适用于Agent间聊天。
若要与另一个Claude Code实例通信,请改用`send` + `wait_idle` + `capture`组合。