Introducing rmux: An Open‑Source API‑Driven Terminal Multiplexer for AI Agents
rmux is a Rust‑written, tmux‑compatible terminal multiplexer that adds a typed SDK in Rust, Python, and TypeScript, supports native Linux, macOS, and Windows without WSL, offers web‑based pane sharing, Ratatui integration, and a Claude teammate mode, providing a programmable alternative to traditional tmux workflows.
What rmux Is
rmux is a terminal multiplexer with an API, written from scratch in Rust. It implements more than 90 tmux commands, keeping the familiar tmux workflow while exposing typed SDKs for Rust ( rmux-sdk), Python ( librmux) and TypeScript ( @rmux/sdk) that let programs drive a terminal like Playwright drives a browser.
Feature Details
Compatibility Layer
rmux does not reinvent tmux commands; it directly re‑exports the most common ones such as new-session, split-window, send-keys, and attach-session. Compatibility tests ensure the command set works as expected, so existing muscle memory is preserved.
When a dedicated rmux configuration is missing, rmux falls back to parsing the user's existing tmux.conf. Unsupported plugins are reported without crashing.
Scripting: Playwright‑Style Terminal SDKs
The SDK connects to a local rmux daemon and exposes session, pane, stream, wait, and snapshot interfaces. Code can create sessions, send text to panes, wait for specific output, and capture screen snapshots without using sleep or manual string parsing.
Cross‑Platform Support
Unlike tmux, which relies on WSL for Windows, rmux uses Rust’s native IPC: Unix sockets on Linux/macOS and Named Pipes on Windows, delivering a true native experience on all three OSes.
Web Share
rmux can stream a single pane or an entire session to a browser via an end‑to‑end encrypted WebSocket. Execution stays on the local machine; the browser only renders the stream. Both loopback preview and tunnel‑based exposure are supported, using hybrid post‑quantum encryption.
Ratatui Integration
For Rust TUI applications, rmux provides the ratatui-rmux widget, allowing live pane snapshots to be rendered directly inside a Ratatui buffer, giving a true embedded terminal pane.
Claude Teammate Mode
The built‑in rmux claude command adds --teammate-mode tmux when running Claude Code, inserting a private tmux shim into Claude’s PATH without affecting the system tmux.
Quick Start
Installation options include a one‑click script for macOS/Linux, PowerShell for Windows, Homebrew, and Cargo:
curl -fsSL https://rmux.io/install.sh | sh irm https://rmux.io/install.ps1 | iex brew install rmux cargo install rmux --lockedAfter installation, list supported commands and run a simple workflow:
rmux list-commands
rmux new-session -d -s work
rmux split-window -h -t work
rmux send-keys -t work 'echo "hello from rmux"' Enter
rmux attach-session -t workTo drive rmux from Rust, add dependencies:
cargo add rmux-sdk
cargo add ratatui-rmuxPython and TypeScript SDKs are available as librmux and @rmux/sdk respectively.
Author's Opinion
rmux is still evolving rapidly, so bugs are expected and heavy tmux‑plugin users should not expect a seamless migration yet. Nevertheless, the API‑first design aligns with the broader trend of treating terminal control as a programmable interface, similar to how Playwright solved browser automation. The author, being an agent user himself, built rmux to solve daily pain points, and finds the wait_for_text API far more comfortable than tmux’s expect scripts.
GitHub repository:
https://github.com/Helvesec/rmux
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
