跳到正文
Skillpedia
部署与云(DevOps)12k · #11578

tmux

它能做什么

这项技能让智能体查看并输入由 tmux 管理的终端会话内容。适合在持久终端中运行长时间或需要交互的命令行工具的开发者。

适用场景

  • ✓当某个命令已经在 tmux 会话中运行,而你希望智能体检查其输出时。
  • ✓当某个交互式命令行工具需要你回复一段文字时。
  • ✓当你希望为一项持续运行的任务启动后台终端会话的时候。

技能链接

https://github.com/EKKOLearnAI/ekko-studio/blob/main/packages/ekko-agent/skills/tmux/SKILL.md

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“请检查名为 worker 的 tmux 会话,告诉我构建是否仍在运行。”

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

工作原理

智能体会列出会话和窗格,读取屏幕上显示的内容,并在被要求时发送按键或文字。在没有弄清确认提示的作用之前,它不会批准该提示。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

tmux

Use for interactive commands that are already running in tmux or need a persistent terminal. Use normal terminal execution for one-shot commands.

Prerequisite

command -v tmux

If the command is absent, tell the user that tmux must be installed; do not silently install it.

Basics

tmux ls
tmux list-windows -t shared
tmux list-panes -t shared:0
tmux capture-pane -t shared:0.0 -p
tmux capture-pane -t shared:0.0 -p -S -

Targets use session:window.pane, for example shared:0.0.

Send input

Send literal text and Enter separately:

tmux send-keys -t shared:0.0 -l -- "Please continue"
tmux send-keys -t shared:0.0 Enter

Special keys:

tmux send-keys -t shared:0.0 C-c
tmux send-keys -t shared:0.0 C-d
tmux send-keys -t shared:0.0 Escape

Use -l -- for arbitrary text. Never approve a confirmation prompt until its target and consequences are understood.

Sessions

tmux new-session -d -s worker
tmux rename-session -t old new
tmux kill-session -t worker

Killing a session is destructive. Do it only when the user requested that outcome or the session was created solely for the current task and is no longer needed.

Helpers

skill_view returns this Skill's baseDirectory. Use it to run:

  • <baseDirectory>/scripts/find-sessions.sh to discover sessions, including custom socket paths.
  • <baseDirectory>/scripts/wait-for-text.sh to wait until pane output contains a pattern.

capture-pane -p writes to stdout, -S - includes full scrollback, and tmux sessions persist across SSH disconnects.

常见问题

它会安装 tmux 吗?

不会。如果缺少 tmux,智能体会告诉你需要先安装,而不会悄悄安装。

它可以关闭会话吗?

可以,但只有在你明确要求时,或会话仅为当前任务而创建且已不再需要时才会关闭。

会话和窗格是如何命名的?

目标使用 session:window.pane 的格式,例如 shared:0.0。

详情

作者的原始描述

Control tmux sessions and panes for interactive CLIs: discover sessions, capture output, send keys, paste text, and monitor prompts.

repo: EKKOLearnAI/ekko-studio

热度

GitHub 星标
12k
排名
#11578
许可证
—
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能