Architecture¶
How the tmuxp CLI dispatches commands to the underlying library.
Request Flow¶
tmuxp CLI (argparse)
│
├── tmuxp load ──→ workspace.loader ──→ workspace.builder ──→ libtmux
├── tmuxp freeze ──→ workspace.freezer ──→ libtmux
├── tmuxp convert ──→ _internal.config_reader
├── tmuxp shell ──→ libtmux (interactive)
└── tmuxp ls/search ──→ workspace.finders
Key Components¶
CLI Layer (tmuxp.cli)¶
The CLI uses Python’s argparse with a custom formatter (tmuxp.cli._formatter).
Each subcommand lives in its own module under tmuxp.cli.
The entry point is tmuxp.cli.cli(), registered as a console script in pyproject.toml.
Workspace Layer (tmuxp.workspace)¶
The workspace layer handles configuration lifecycle:
Finding:
tmuxp.workspace.finderslocates config filesLoading:
tmuxp.workspace.loaderreads and validates configsBuilding:
tmuxp.workspace.buildercreates tmux sessions via libtmuxFreezing:
tmuxp.workspace.freezerexports running sessions
Library Layer (libtmux)¶
tmuxp delegates all tmux operations to libtmux.
The WorkspaceBuilder creates libtmux Server, Session, Window, and Pane
objects to construct the requested workspace.