tmux

Controlar sessões/painéis do tmux para CLIs interativas: listar, capturar saída, enviar teclas, colar texto, monitorar prompts.

O que é tmux?

Esta habilidade permite que agentes de IA (como Claude Code, Cursor, Codex) interajam diretamente com sessões existentes do tmux, um multiplexador de terminais amplamente utilizado. O agente pode listar janelas e painéis, capturar seu conteúdo, enviar teclas (incluindo especiais como Ctrl+C), colar texto e monitorar a saída em busca de prompts específicos. É útil para automação de tarefas interativas em terminais remotos (ex.: via SSH), onde comandos únicos não são suficientes. A habilidade suporta os terminais mais comuns (Linux, macOS) e inclui scripts auxiliares para descobrir sessões e aguardar por textos. Ela usa identificadores únicos (nonce) para evitar falsos positivos e garante que a saída completa seja capturada, mesmo com scrollback.

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

Installed? Explore more Programação e Desenvolvimento skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

Perguntar na sua IA favorita

Abre um novo chat com esta habilidade de agente já pré-carregada.

Documentação

O que tmux faz?

Usar para sessões interativas existentes do tmux. Para comandos únicos, use o shell normal. Para novos trabalhos em segundo plano não interativos, use execução em segundo plano.

Básico

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 -

Formato alvo: session:window.pane, ex.: shared:0.0.

Enviar entrada

Texto literal, depois Enter:

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

Teclas especiais:

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 -- para texto arbitrário. Separe o texto e Enter para evitar surpresas com colagem/nova linha.

Sessões

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

Verificações de prompt

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

Aprovar/selecionar apenas quando o prompt for compreendido:

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

Auxiliares

  • scripts/find-sessions.sh: descobrir sessões.
  • scripts/wait-for-text.sh: aguardar até que o conteúdo do painel capturado contenha o texto.

wait-for-text.sh pesquisa entrada ecoada e histórico de rolagem, bem como a saída do processo. Para conclusão de comando, use um marcador único cujo texto completo é dividido entre argumentos no comando enviado ao 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

O comando ecoado nunca contém o marcador completo, e o nonce impede que uma linha de conclusão antiga corresponda.

Notas

  • capture-pane -p imprime na saída padrão para scripts.
  • -S - captura todo o histórico de rolagem.
  • As sessões do tmux persistem mesmo após desconexões 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.

Habilidades Relacionadas