Communityコーディング&開発github.com

tmux

対話型CLI向けにtmuxセッション/ペインを制御:一覧表示、出力取得、キー送信、テキスト貼り付け、プロンプト監視。

tmux とは?

このスキルは、tmuxの既存の対話型セッションを制御するためのものです。セッション、ウィンドウ、ペインの一覧表示や出力のキャプチャ、任意のテキストや特殊キー(C-c、C-d、Escapeなど)の送信、プロンプトの確認と応答が可能です。シェルワンショットコマンドやバックグラウンドジョブには通常のシェルやバックグラウンド実行を使用します。tmuxセッションはSSH切断後も持続するため、長時間のタスクに適しています。スクリプトヘルパーとして`scripts/find-sessions.sh`(セッション発見)や`scripts/wait-for-text.sh`(ペイン内容のテキスト待機)が用意されており、固有のマーカーを用いてコマンド完了を確実に検出できます。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/clawdbot/clawdbot/tree/main/skills/tmux

Installed? Explore more コーディング&開発 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

tmux は何をしますか?

既存の対話型tmuxセッションに使用します。ワンショットコマンドには通常のシェルを、新規の非対話型バックグラウンドジョブにはバックグラウンド実行を使用してください。

基本

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 -

形式: session:window.pane (例: shared:0.0)

入力送信

リテラルテキスト、その後Enter:

tmux send-keys -t shared:0.0 -l -- "続けてください"
tmux send-keys -t shared:0.0 Enter

特殊キー:

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

任意のテキストには -l -- を使用します。テキストとEnterは分けて送信し、ペーストや改行の不意の動作を避けます。

セッション

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

プロンプト確認

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

プロンプトを理解した場合のみ承認/選択:

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

ヘルパー

  • scripts/find-sessions.sh: セッションを発見します。
  • scripts/wait-for-text.sh: キャプチャしたペインの内容にテキストが含まれるまで待機します。

wait-for-text.sh は、プロセス出力だけでなく、エコーされた入力やスクロールバックも検索します。コマンド完了を検出するには、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

エコーされるコマンドには完全なマーカーが含まれず、nonceによって古い完了行との一致を防ぎます。

注意点

  • capture-pane -p は標準出力に出力するため、スクリプトで利用できます。
  • -S - は完全なスクロールバックをキャプチャします。
  • tmuxセッションはSSH切断後も持続します。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

acp-router

Route plain-language requests for Claude Code, Cursor, Copilot, OpenClaw ACP, OpenCode, Gemini CLI, Grok Build, Qwen, Kiro, Kimi, iFlow, Factory Droid, Kilocode, or explicit ACP harness work into either OpenClaw ACP runtime sessions or direct acpx-driven sessions ("telephone game" flow). For coding-agent thread requests, read this skill first, then use only `sessions_spawn` for thread creation. Codex chat binding defaults to the native Codex app-server plugin unless ACP is explicit or background spawn needs ACP.

add-model-provider

Add and live-prove a model provider with non-interactive config one-liners, without exposing credentials.

agent-transcript

Requested GitHub PR/issue agent transcripts: redact, trim, preview, and insert safely.

apple-notes

Create, view, edit, delete, search, move, or export Apple Notes via the memo CLI on macOS.

apple-reminders

List, add, edit, complete, or delete Apple Reminders and reminder lists via remindctl.

auto-qa

Run OpenClaw-wide autonomous QA and live/stress campaigns across independent subsystem lanes, with verified fixes and a resumable evidence report.

autoreview

Structured code review through the shared OpenClaw agent-skills installation.

bear-notes

Create, search, and manage Bear notes via grizzly CLI.

blacksmith-testbox

Run Blacksmith Testbox for CI-parity checks, secrets, hosted services, migrations, or builds local cannot reproduce.

block-kit

Use proactively for structured or interactive Slack replies, and when asked to author or validate native Slack Block Kit JSON.

blogwatcher

Monitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.

blucli

BluOS CLI (blu) for discovery, playback, grouping, and volume.

bluebubbles

Send and manage iMessages via BlueBubbles, including attachments, tapbacks, edits, replies, and groups.

browser-automation

Use when controlling web pages with the OpenClaw browser tool, especially multi-step flows, login checks, tab management, or recovery from stale refs/timeouts.

camsnap

Capture frames or clips from RTSP/ONVIF cameras and local webcams, including USB pan/tilt/zoom control.

canvas

Present HTML on connected OpenClaw node canvases, navigate/eval/snapshot, and debug canvas host URLs.

channel-message-flows

Use when running QA Lab channel message flow evidence.

clawdtributor

Clawtributor PRs here, last week or another window: discover conversation refs, recheck GitHub, rank by impact.

clawhub

Search ClawHub for plugins by default, or skills when explicitly requested; install, verify, update, uninstall, publish, or sync skills.

関連スキル