Skip to main content
Manage cmux windows using the command-line interface. Windows contain workspaces and can be controlled programmatically.

list-windows

List all open windows with their IDs, indexes, and workspace counts.
cmux list-windows
Flags:
--json
boolean
Output results in JSON format
--id-format
string
Control ID output format: refs, uuids, or both (default: refs)
Output (text):
* 1: window:1 selected_workspace=workspace:1 workspaces=3
  2: window:2 selected_workspace=workspace:4 workspaces=2
Output (JSON):
[
  {
    "index": 1,
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "key": true,
    "workspace_count": 3,
    "selected_workspace_id": "550e8400-e29b-41d4-a716-446655440001"
  }
]

current-window

Get the ID of the currently focused window.
cmux current-window
Flags:
--json
boolean
Output results in JSON format
Output (text):
window:1
Output (JSON):
{
  "window_id": "window:1"
}

new-window

Create a new window.
cmux new-window
Output:
OK window:2

focus-window

Focus a specific window by ID, ref, or index.
cmux focus-window --window <id|ref|index>
Flags:
--window
string
required
Window ID (UUID), ref (window:1), or index (1)
Examples:
cmux focus-window --window window:1
Output:
OK

close-window

Close a specific window by ID, ref, or index.
cmux close-window --window <id|ref|index>
Flags:
--window
string
required
Window ID (UUID), ref (window:1), or index (1)
Examples:
cmux close-window --window window:1
Output:
OK

Global Flags

These flags can be used with any window command:
--socket
string
Path to the cmux socket (default: /tmp/cmux.sock or $CMUX_SOCKET_PATH)
--password
string
Socket authentication password (or use $CMUX_SOCKET_PASSWORD)