本文へスキップ
Skillpedia
デプロイとクラウド(DevOps)394k · #86

tmux

できること

このスキルは、tmuxセッションの出力を読み、特に実行中の対話型ツールに入力を送る手順を、AIエージェントに示します。長く動くターミナル作業をtmuxで管理している開発者のためのものです。

使う場面

  • ✓実行中のターミナルツールが何を出力しているか見たいとき。
  • ✓tmuxセッション内のツールが入力を待っていて、返信が必要なとき。
  • ✓tmuxセッションを開始、名前変更、または閉じる必要があるとき。

スキルのリンク

https://github.com/openclaw/openclaw/blob/main/skills/tmux/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/openclaw/openclaw/blob/main/skills/tmux/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“workerという名前のtmuxセッションを確認して、今何を出力しているか教えてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

このスキルは、セッションとペインを一覧表示し、最近の出力を読み、依頼があったときにテキストやキーを送ります。承認や選択をする前に、プロンプトが正しく理解されていることを確認します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

tmux

Use for existing interactive tmux sessions. For one-shot commands, use normal shell. For new non-interactive background jobs, use background execution.

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 -

Target format: session:window.pane, e.g. shared:0.0.

Send input

Literal text, then Enter:

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. Split text and Enter to avoid paste/newline surprises.

Sessions

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

Prompt checks

tmux capture-pane -t worker-3 -p | tail -20
tmux capture-pane -t worker-3 -p | rg "proceed|permission|Yes|No|❯"

Approve/select only when the prompt is understood:

tmux send-keys -t worker-3 -l -- "y"
tmux send-keys -t worker-3 Enter

Helpers

  • scripts/find-sessions.sh: discover sessions.
  • scripts/wait-for-text.sh: wait until captured pane contents contain text.

wait-for-text.sh searches echoed input and scrollback as well as process output. For command completion, use a unique marker whose full text is split across arguments in the command sent to tmux:

nonce="$(od -An -N8 -tx1 /dev/urandom | tr -d ' \n')"
marker="OPENCLAW_DONE_${nonce}"
tmux send-keys -t shared:0.0 -l -- "sleep 4; printf '%s%s\n' 'OPENCLAW_DONE_' '$nonce'"
tmux send-keys -t shared:0.0 Enter
scripts/wait-for-text.sh -t shared:0.0 -p "$marker" -F -T 30

The echoed command never contains the complete marker, and the nonce prevents an older completion line from matching.

Notes

  • capture-pane -p prints to stdout for scripts.
  • -S - captures full scrollback.
  • tmux sessions persist across SSH disconnects.
よくある質問

依頼なしにコマンドを送りますか?

いいえ。プロンプトが理解でき、操作が明確な場合にのみ承認します。

一度きりのコマンドにもtmuxを使いますか?

いいえ。一度きりのコマンドには通常のシェルのほうが簡単で、tmuxは既存の対話型セッションのためのものです。

タスクが終わるまで待てますか?

はい。補助スクリプトは、ペインに特定のテキストが表示されるまで待てますが、一意のマーカーを使うのが最も確実です。

詳細

作者による元の説明

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

repo: openclaw/openclaw

人気

GitHubのスター
394k
ランキング
#86
ライセンス
MIT
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル