Synopsis
Description
Thewezterm cli command provides programmatic control over WezTerm’s multiplexer. It allows you to script window, tab, and pane management, send text to panes, and query the state of your terminal sessions.
This is an experimental interface that may change in future releases.
Global Options
Don’t automatically start the server if it’s not running.
Prefer connecting to a background mux server rather than a GUI instance.
When connecting to a GUI instance started with
--class SOMETHING, specify the same class name here.Subcommands
Thewezterm cli command has numerous subcommands for controlling the multiplexer:
list
List windows, tabs, and panes:list-clients
List connected clients:split-pane
Split the current pane:spawn-command
Spawn a new command in a new tab or pane:send-text
Send text to a pane:get-text
Get text from a pane’s scrollback:activate-pane
Activate a specific pane:activate-pane-direction
Activate a pane in a direction:activate-tab
Activate a specific tab:kill-pane
Kill a pane:adjust-pane-size
Adjust pane size:zoom-pane
Toggle pane zoom:move-pane-to-new-tab
Move a pane to a new tab:set-tab-title
Set a tab’s title:set-window-title
Set a window’s title:rename-workspace
Rename a workspace:Output Formats
Many subcommands support--format to control output:
table(default): Human-readable table formatjson: Machine-readable JSON format
Examples
Script Window Layout
Send Commands to Panes
Monitor Pane Output
Use Cases
- Automation: Script complex window layouts
- Testing: Send commands and capture output programmatically
- Monitoring: Query pane state and content
- Integration: Connect WezTerm to external tools and workflows