# Python

Source: https://libtmux.org/en/py/stable/

> libtmux for Python, version stable.

![](https://libtmux.org/en/brand/python/library/logo.svg)

Drive a real tmux from Python.

libtmux

You are reading the **stable** documentation. Use the version control in the header to move between releases, or the port dropdown to find a corresponding page in another language.

## Install

### Library `libtmux`

Dependency cooldowns

The checkbox turns a cooldown on and off for every picker on the site. It applies to what an install pulls in; the package itself, and the libtmux it pins, stay current.

Cooldown type

Apply a cooldown of days Bypass any global cooldown

What are cooldowns?

Cooldowns delay picking up newly uploaded packages so the community has time to spot supply-chain attacks before you install. Most package managers don't apply one by default; you opt in through a global setting in your tool's configuration.

Learn more at [cooldowns.dev](https://cooldowns.dev/) · [Datadog Security Labs writeup](https://securitylabs.datadoghq.com/articles/dependency-cooldowns/).

```console
$ pip install libtmux
```

```console
$ pip install libtmux
```

pip cannot exempt libtmux from its own cooldown, so a cooldown here would also hold back the release this installs. This command runs without one.

```console
$ pip install libtmux
```

pip cannot exempt libtmux from its own cooldown, so a cooldown here would also hold back the release this installs. This command runs without one.

### [Workspace Manager](https://libtmux.org/en/py/stable/workspace/) `tmuxp`

The workspace package is separate from the core library.

```console
$ uv tool install tmuxp
```

Installs tmuxp in an isolated Python environment. Run tmuxp load ./workspace.yaml.

### [MCP](https://libtmux.org/en/py/stable/mcp/) `libtmux-mcp`

Choose your client and configuration scope, then run the command or paste the configuration.

With [uvx ](https://docs.astral.sh/uv/)installed:

```console
$ claude mcp add tmux -- uvx libtmux-mcp
```

Config file: `~/.claude.json (this project)`

### [Topics](https://libtmux.org/en/py/stable/topics/)

[Subject-by-subject, with Python in every code block.](https://libtmux.org/en/py/stable/topics/)

### [Guides](https://libtmux.org/en/py/stable/guides/)

[Task guides for Python.](https://libtmux.org/en/py/stable/guides/)

### [Examples](https://libtmux.org/en/py/stable/examples/)

[Complete programs, sourced from the code each port tests.](https://libtmux.org/en/py/stable/examples/)

### [Concepts](https://libtmux.org/en/py/stable/concepts/)

[The domain model every port shares.](https://libtmux.org/en/py/stable/concepts/)

## Packages and integrations

### [Workspace Manager](https://libtmux.org/en/py/stable/workspace/)

[Load workspace configuration files with tmuxp load.](https://libtmux.org/en/py/stable/workspace/)

### [MCP](https://libtmux.org/en/py/stable/mcp/)

[In development. Connect an MCP client to tmux tools and inspect the server API.](https://libtmux.org/en/py/stable/mcp/)

## API references

### [Official reference](https://libtmux.org/en/py/stable/reference/)

[Python API signatures and documentation, with links to related guides and APIs in other languages.](https://libtmux.org/en/py/stable/reference/)

### [Upstream reference](https://libtmux.org/en/py/stable/api/)

[Python documentation with upstream guides and API reference.](https://libtmux.org/en/py/stable/api/)

[All Python versions and install instructions](https://libtmux.org/en/py/)
