Skip to main content

pairmux

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

Homepage · 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

Quick run without a persistent command on PATH:

uvx pairmux version
uvx pairmux doctor

uvx runs pairmux in a temporary tool environment (which uv may cache). For a persistent installation that exposes pairmux on PATH:

uv tool install pairmux
pairmux doctor

Or use the inspectable installer, which installs pairmux with uv from the public PyPI index:

curl -fsSL https://pairmux.treeleaves30760.com/install.sh | bash

To review it before execution, download successfully first, inspect the file, then run it:

curl -fsSL https://pairmux.treeleaves30760.com/install.sh -o install-pairmux.sh && \
  less install-pairmux.sh && \
  bash install-pairmux.sh

The one-line pipe executes downloaded code; it is not a substitute for that review. The installer uses public PyPI explicitly; normal uv commands default to PyPI, but local uv configuration can change their index. See installation guidance for PATH setup and other supported methods (pipx install pairmux or python -m pip install pairmux in a dedicated environment).

The PyPI pairmux wheels contain a prebuilt native Go binary, so installation needs no Go toolchain or source build. Wheel installers require Python 3.9 or newer; the installed pairmux executable itself contains no Python code. If needed, the installer obtains uv from Astral's official installer, and uv may obtain managed Python from Astral's upstream Python distributions. Only the pairmux wheel comes from PyPI in that installer flow; uv/Python may come from Astral upstream.

PyPI package requirements and wheel targets:

  • tmux 3.2 or newer, installed separately with your system package manager; neither the wheel nor the installer supplies tmux or runs sudo to install it
  • 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

The quickstart below assumes the persistent pairmux command is on PATH. For temporary use, prefix each command with uvx.

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.

Metadata

Release files for pairmux 0.5.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for pairmux 0.5.3
File
pairmux-0.5.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
pairmux-0.5.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
pairmux-0.5.3-py3-none-macosx_12_0_x86_64.whl Python 3 none macOS 12.0+ x86-64 Details
pairmux-0.5.3-py3-none-macosx_12_0_arm64.whl Python 3 none macOS 12.0+ ARM64 Details

Total release size: 5.5 MB

Release files / pairmux-0.5.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pairmux-0.5.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.5 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
3cf0898f5a0918743a5ca9f638b792d19b06f2f995f709a67453b4755b3c9e5a
BLAKE2b-256 checksum
How to use checksums
220a3d69c895a44ad9d2d0378c4abbe3b4f6f9400bc30239df83f4855074c7ef
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / pairmux-0.5.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL pairmux-0.5.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.3 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
c86b48e9fe92a06d1a0403221b03ee3c3d548e34d465cbeb1fa89e98fb066339
BLAKE2b-256 checksum
How to use checksums
d194a9b2be6ba70c3893c66d2a657c82460c6e04f8396840b43e6f0029cb2daa
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / pairmux-0.5.3-py3-none-macosx_12_0_x86_64.whl

Download URL pairmux-0.5.3-py3-none-macosx_12_0_x86_64.whl
Size 1.4 MB
Tags Python 3 macOS 12.0+ x86-64
SHA-256 checksum
How to use checksums
5985e5948715d12f23af4a6931f7b9fdaf867c68b21d4f11aa99cf67dbdc2a44
BLAKE2b-256 checksum
How to use checksums
52afd4f742e89dc2dc8bd839baf9276070d0071297d11454d5da9a58e1f5e279
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / pairmux-0.5.3-py3-none-macosx_12_0_arm64.whl

Download URL pairmux-0.5.3-py3-none-macosx_12_0_arm64.whl
Size 1.3 MB
Tags Python 3 macOS 12.0+ ARM64
SHA-256 checksum
How to use checksums
510ecdafbd7ac1de0c5ff2b9cac192eba664491ea2892dc50482ae326872c7df
BLAKE2b-256 checksum
How to use checksums
a7022f673531d6ee1cd3787519133bcc625c043cda42a842e9784e5c6fd42db4
Upload date
Uploaded using Trusted Publishing?
What is 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}

Security for pairmux 0.5.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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