---
title: "wezterm cli - Wez's Terminal Emulator"
source: "https://wezterm.org/cli/cli/index.html"
author:
published:
created: 2026-04-17
description: "Wez's Terminal Emulator"
tags:
  - "clippings"
---
## wezterm cli

The *cli* subcommand interacts with a running wezterm GUI or multiplexer instance, and can be used to spawn programs and manipulate tabs and panes.

## Targeting the correct instance

There may be multiple GUI processes running in addition to a multiplexer server. wezterm uses the following logic to decide which one it should connect to.

- If the `--prefer-mux` flag is passed, then the `wezterm.lua` config file is consulted to determine the first *unix domain* defined by the config.
- If the `$WEZTERM_UNIX_SOCKET` environment variable is set, use that location to identify the running instance
- Try to locate a running GUI instance. The `--class` argument specifies an optional window class that can be used to select the appropriate GUI window if that GUI window was also spawned using `--class` to override the default.

## Targeting Panes

Various subcommands target panes via a (typically optional) `--pane-id` argument.

The following rules are used to determine a pane if `--pane-id` is not specified:

- If the `$WEZTERM_PANE` environment variable is set, it will be used
- The list of clients is retrieved and sorted by the most recently interacted session. The focused pane id from that session is used

See also: [wezterm cli list](https://wezterm.org/cli/cli/list.html)

## Available Subcommands

- [activate-pane-direction](https://wezterm.org/cli/cli/activate-pane-direction.html)
- [activate-pane](https://wezterm.org/cli/cli/activate-pane.html)
- [activate-tab](https://wezterm.org/cli/cli/activate-tab.html)
- [adjust-pane-size](https://wezterm.org/cli/cli/adjust-pane-size.html)
- [get-pane-direction](https://wezterm.org/cli/cli/get-pane-direction.html)
- [get-text](https://wezterm.org/cli/cli/get-text.html)
- [kill-pane](https://wezterm.org/cli/cli/kill-pane.html)
- [list-clients](https://wezterm.org/cli/cli/list-clients.html)
- [list](https://wezterm.org/cli/cli/list.html)
- [move-pane-to-new-tab](https://wezterm.org/cli/cli/move-pane-to-new-tab.html)
- [rename-workspace](https://wezterm.org/cli/cli/rename-workspace.html)
- [send-text](https://wezterm.org/cli/cli/send-text.html)
- [set-tab-title](https://wezterm.org/cli/cli/set-tab-title.html)
- [set-window-title](https://wezterm.org/cli/cli/set-window-title.html)
- [spawn](https://wezterm.org/cli/cli/spawn.html)
- [split-pane](https://wezterm.org/cli/cli/split-pane.html)
- [zoom-pane](https://wezterm.org/cli/cli/zoom-pane.html)