libtmux
Typed library that provides an ORM wrapper for tmux, a terminal multiplexer.
Decision gist · record as of 2026-08-14
Yes. libtmux is actively maintained, has no external dependencies, supports current Python versions (3.10–3.14, PyPy), and solves a real problem for anyone automating tmux or testing tmux-aware tools. The MIT license imposes no restrictions. Start with a pinned version range (e.g., `libtmux==0.62.*`) since the package is pre-1.0.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- tmux >= 3.2a must be installed on the system; Python >= 3.10 required.
- Low friction: pure Python wheel with no runtime dependencies.
- Active maintenance (last commit 2026-08-13, release 33 days ago).
License · maintenance · safety
MIT (permissive) — MIT license (permissive). No restrictions on commercial or proprietary use; attribution appreciated but not required.
last release 2026-07-12 (33 days) · last repo commit 2026-08-13 · 1,204 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 13,140,422 downloads/mo, #1,294 on PyPI
Alternatives
Verify before relying
pip install libtmux
import libtmux
server = libtmux.Server()
session = server.sessions.get(session_name="my-session")
window = session.new_window(window_name="work")
pane = window.active_pane
pane.send_keys("echo hello", enter=True)- Whether the pytest plugin is automatically available or requires separate installation.
- Performance characteristics when managing many sessions/windows/panes concurrently.
- Compatibility with tmux forks or non-standard tmux builds.
What it is and what it does
libtmux is a typed Python wrapper around tmux that replaces shell command parsing with real object-oriented control. Instead of running `tmux ls` and parsing output, you work with `Server`, `Session`, `Window`, and `Pane` objects that reflect live tmux state. The library supports querying and filtering collections, traversing the hierarchy (pane → window → session), sending keystrokes to panes, and capturing output—all with full type hints.
The package is battle-tested in production through tmuxp (a declarative workspace manager built on top of it) and includes a pytest plugin for writing isolated tmux tests. It also supports context managers for cleanup, multiple tmux sockets, and a `.cmd()` escape hatch for raw tmux commands when needed. Code running inside a tmux pane can use `from_env()` to locate itself in the hierarchy.
Use it for
- Automate tmux session setup and teardown in deployment or development scripts without shell parsing.
- Write pytest tests for tools that interact with tmux, using isolated fixtures for each test.
- Build terminal UI tools or dashboards that need to query and control live tmux state programmatically.
- Capture pane output and send commands to tmux from Python applications or background agents.
- Implement tmux-based workflow orchestration (e.g., spawning parallel tasks in separate panes).
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
libtmux is actively maintained, has no external dependencies, supports current Python versions (3.10–3.14, PyPy), and solves a real problem for anyone automating tmux or testing tmux-aware tools. The MIT license imposes no restrictions. Start with a pinned version range (e.g., `libtmux==0.62.*`) since the package is pre-1.0.
Install
libtmux on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. Active maintenance (last commit 2026-08-13, release 33 days ago). Requires tmux >= 3.2a and Python >= 3.10; older versions available on maintenance branches for Python 2.x and tmux 1.8–3.1c.
tmux >= 3.2a must be installed on the system; Python >= 3.10 required.
License in practice
MIT license (permissive). No restrictions on commercial or proprietary use; attribution appreciated but not required.
Quickstart
pip install libtmux
import libtmux
server = libtmux.Server()
session = server.sessions.get(session_name="my-session")
window = session.new_window(window_name="work")
pane = window.active_pane
pane.send_keys("echo hello", enter=True)
Verify before relying
- Whether the pytest plugin is automatically available or requires separate installation.
- Performance characteristics when managing many sessions/windows/panes concurrently.
- Compatibility with tmux forks or non-standard tmux builds.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release <4.0,>=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 33 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 13,140,422 / month, #1,294 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: MacOS :: MacOS XOperating System :: POSIXProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python ModulesTopic :: System :: ShellsTopic :: UtilitiesTyping :: Typed |
Evidence: libtmux-0.62.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “tmux python api”
- libtmuxlibtmux provides a typed Python API to control tmux (the terminal…
- tmuxptmuxp saves and loads tmux sessions from YAML or JSON configuration…
- pairmuxpairmux lets AI agents control interactive terminal programs through…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also pairmux · tmuxp · imgcat · iterm2 · ptpython · ms-fabric-cli · textual-image · ptyprocess · browser-use-core · colorama