tmux-automation

Execute commands and send keys in detached tmux sessions while capturing pane output.

7|1|Updated Jul 27, 2021
One-click install
npx skills add https://github.com/podcodar/webapp --skill tmux-automation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tmux-automation
Source: https://github.com/podcodar/webapp/tree/main/.opencode/skills/tmux-automation
Command: npx skills add https://github.com/podcodar/webapp --skill tmux-automation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the problem of running interactive or long-running command workflows without losing progress when your terminal disconnects or you need to orchestrate multiple steps programmatically.

Core Features & Use Cases

  • Detached session automation: Start commands in persistent tmux sessions that keep running in the background.
  • Programmatic input and key sending: Send commands and special keystrokes to a target session to drive interactive CLIs (REPLs, vim, git flows).
  • Output capture and session control: Capture pane/scrollback output for verification and manage the lifecycle by checking existence and killing sessions.

What problem does it solve?

Run a Django migration or a Python REPL flow that requires multiple interactive commands while capturing output for later inspection, then cleanly tear down the session when done.

Quick Start

Create a detached tmux session for a long-running command, wait briefly for initialization, send input commands followed by Enter as separate key arguments, capture the resulting output, and finally kill the session.

Frequently Asked Questions about tmux-automation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate sending commands to an interactive CLI using tmux?

You can automate interactive CLI sessions by creating a detached tmux session and using send-keys to programmatically input commands and special keystrokes, then using capture-pane to retrieve the resulting output for verification.

How do I keep long-running terminal processes running after disconnecting?

To keep long-running terminal processes running after a disconnect, start them in a detached tmux session. This creates a persistent background environment that maintains process state independently of your active terminal connection.

Can I capture scrollback output from a tmux session programmatically?

Yes, you can capture scrollback output from a tmux session programmatically by using the tmux capture-pane command. This allows you to retrieve and verify the resulting output from automated interactive commands executed within the session.

Does tmux send-keys support special key names for driving REPLs?

Yes, tmux send-keys supports special key names for driving REPLs and interactive tools. It allows you to send specific keystrokes separately from the Enter key argument, ensuring reliable programmatic input for complex terminal workflows.

What is the best way to manage the lifecycle of a detached tmux session?

The best way to manage a detached tmux session lifecycle is using tmux has-session to check if a session exists before interacting, and tmux kill-session to cleanly tear down the session and its processes when the automation workflow is complete.

Can I run a Python REPL flow in a specific working directory using tmux?

Yes, you can run a Python REPL flow in a specific working directory by creating a detached tmux session with an optional working directory parameter, then sending interactive commands and capturing the output before killing the session.