Skip to main content

pairmux

Let AI agents drive interactive terminal programs — and hand off to a human when they can't.

Documentation · CLI reference · Changelog · Source

pairmux is a small Agent-Computer Interface layer over tmux with no separate service to supervise. Agents get a real PTY with persistent shell state and actionable command outcomes; humans keep normal access to the same live terminal — watch, take over, hand back.

Why pairmux

  • A real PTY. Exec-style agent shell tools run commands without a terminal, so REPLs, psql, ssh password prompts, docker exec -it, git rebase -i, pagers, and TUIs are impossible there. pairmux makes them drivable.
  • Human handoff on credentials and judgment calls. A recognized secret prompt never suggests an answer; wait --human --notify, attach, and note turn a blocked credential prompt into a resumable checkpoint — and the wait ends as soon as the human answers, note or no note.
  • Persistent shell state. source venv/bin/activate, export, and nvm use happen once in a live shell instead of being re-composed into every command.
  • Actionable waits and captured history. run blocks until completion, a recognized prompt, or timeout (never killing the command); journals retain full output with exit codes, and --json emits a versioned pairmux.v1 envelope with ordered next steps.

Install

uv tool install pairmux
# or
pipx install pairmux
# or, inside a dedicated environment
python -m pip install pairmux

The wheel contains a prebuilt native Go binary, so installation needs no Go toolchain or source build. Wheel installers must select Python 3.9 or newer; the installed pairmux executable itself contains no Python code.

PyPI package requirements and wheel targets:

  • tmux 3.2 or newer
  • macOS 12+ or manylinux_2_17 (glibc 2.17+)
  • x86-64 or ARM64 (aarch64)
  • no native Windows wheel; use a compatible Linux distribution inside WSL

Check the local environment after installation:

pairmux doctor

60-second quickstart

Create one managed terminal, then run commands in it:

pairmux --json new --name demo
pairmux --json run demo "echo hello from pairmux"

# A timeout returns status=running; it does not kill the command.
pairmux --json run demo "sleep 2; echo finished" --timeout 1s

# When status is running, keep waiting without sleep-and-guess polling.
pairmux --json wait demo --idle 800
pairmux --json peek demo

wait --idle refreshes terminal state after output becomes quiet; silence alone is not treated as completion. peek and log are read-only, so other agents can inspect the same terminal without taking its writer lock.

Teach your agent

pairmux embeds its Agent Skill, including the new → run → wait/send/log loop and safe human handoff guidance:

pairmux skill install --target codex --dry-run
pairmux skill install --target codex

Use --target all to update only the supported agent configuration directories that already exist. See the Agent Skills guide for all targets and install locations.

MCP clients can launch the built-in stdio server and use the core terminal operations as typed tools:

{
  "command": "pairmux",
  "args": ["mcp", "serve"]
}

Interactive work and human handoff

After 800 ms of output quiet, pairmux recognizes supported prompt patterns: confirmations, password/passphrase/passcode prompts, pager markers, press-key messages, and Python's >>>. It reports awaiting-input and never auto-answers. Replace the uppercase placeholders below before sending ordinary input:

pairmux send NAME --text VALUE --enter

For a secret-shaped prompt, the response recommends pairmux wait NAME --human --notify. A human can enter the same live pane with pairmux attach NAME, provide the input, and detach with the configured tmux binding (default Ctrl-b d). Running pairmux note NAME "ready" afterward records a message and releases an agent waiting with --human; it does not itself detach or enforce control ownership. This avoids routing the input through the agent-facing send command. Prompt recognition is heuristic, desktop notification is best-effort, and whether an application echoes or records input remains application-dependent.

How it works

pairmux does not implement another PTY or add a background service of its own. tmux remains the terminal-state engine; short-lived pairmux commands add completion detection, captured output, model-friendly shaping, and coordination around the live pane. pairmux attach starts a native tmux client against the correct managed session whenever a human needs to observe or take over.

pairmux is open source under the MIT License.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pairmux-0.5.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

pairmux-0.5.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

pairmux-0.5.1-py3-none-macosx_12_0_x86_64.whl (1.4 MB view details)

Uploaded Python 3macOS 12.0+ x86-64

pairmux-0.5.1-py3-none-macosx_12_0_arm64.whl (1.3 MB view details)

Uploaded Python 3macOS 12.0+ ARM64

File details

Details for the file pairmux-0.5.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: pairmux-0.5.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: Python 3, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pairmux-0.5.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dc383409b81a0735b98c475b1c1a2748af84eda09c06ca118ad6d9baed137095
MD5 8ece307147889f134db0c452becc44e4
BLAKE2b-256 9ae50ff5e8002b13b75900ed9d9109d89133abbc93d0173b1712ca7f6846b436

See more details on using hashes here.

File details

Details for the file pairmux-0.5.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

  • Download URL: pairmux-0.5.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 3, manylinux: glibc 2.17+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pairmux-0.5.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0993dd361c9a4db33bada1afb3502fb23c871af7bdd5b37175cd6b3ee3602e70
MD5 11c8e81cdfaf5bba33c7f8d6b93d5a90
BLAKE2b-256 40907f070ae53a62759011dafbf646ea8368568119db1c33399d510847c35973

See more details on using hashes here.

File details

Details for the file pairmux-0.5.1-py3-none-macosx_12_0_x86_64.whl.

File metadata

  • Download URL: pairmux-0.5.1-py3-none-macosx_12_0_x86_64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: Python 3, macOS 12.0+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pairmux-0.5.1-py3-none-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 315fb1387649d26339f7018088a9ef1c7cb511620bcc9502765abb51558603ea
MD5 ae6150cce1c06f3538da6a7630430e9f
BLAKE2b-256 30b7f18e73af20284f2a0687dc259d94ac5e80931292cc81d9bb0844195d54ac

See more details on using hashes here.

File details

Details for the file pairmux-0.5.1-py3-none-macosx_12_0_arm64.whl.

File metadata

  • Download URL: pairmux-0.5.1-py3-none-macosx_12_0_arm64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 3, macOS 12.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pairmux-0.5.1-py3-none-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 30dc08791c81ebadff35774b7293cafb925002cd11fe20f7dec47c6b0f0daba6
MD5 9bbbe954d62b462251c796b325fcb6e6
BLAKE2b-256 74ceb0003b9fd4ae1d3cecd5ec259ebfe679d15d4b7440efce4a3c497f1b904e

See more details on using hashes here.

Release history Release notifications | RSS feed

0.5.2

4 files

This release

0.5.1 This release

4 files

0.5.0

4 files

0.4.0

4 files

0.3.0

4 files

0.2.0

4 files

0.1.1

4 files

0.1.0

4 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page