Connection
Socket path
Default socket locations:- Production:
/tmp/cmux.sock - Debug build:
/tmp/cmux-debug.sock - Nightly:
/tmp/cmux-nightly.sock - Staging:
/tmp/cmux-staging.sock
CMUX_SOCKET_PATH environment variable.
Security
Socket permissions:0600 (owner-only) in all modes except allowAll.
Socket ownership validation:
The socket must be owned by the current user. Connection attempts to sockets owned by other users are rejected to prevent fake-socket attacks.
Authentication
Depending on the configured socket mode:- Off: Socket not available
- cmux processes only (default): Only processes with cmux ancestry can connect
- Automation mode: Any local process from the same macOS user
- Password mode: Requires password authentication via
authcommand - Full open access: Any local process (unsafe)
auth command before any other requests:
--passwordCLI flagCMUX_SOCKET_PASSWORDenvironment variable- Password file:
~/Library/Application Support/cmux/socket-control-password
Protocol
V2 JSON-RPC format
All modern commands use JSON-RPC requests and responses. Request:V1 legacy format
Older commands use plain text requests:- Success:
OKor data - Error:
ERROR: <message>
New integrations should use V2 methods. V1 commands are maintained for backward compatibility.
System methods
system.capabilities
Get supported API capabilities:system.identify
Get current context information:Window methods
window.list
List all windows:window.current
Get current window:window.focus
Focus a window:Workspace methods
workspace.list
List workspaces:workspace.create
Create a new workspace:workspace.current
Get current workspace:workspace.select
Switch to a workspace:workspace.close
Close a workspace:workspace.rename
Rename a workspace:workspace.move_to_window
Move workspace to another window:workspace.reorder
Reorder workspace position:workspace.action
Perform workspace action:Pane methods
pane.list
List panes in a workspace:pane.create
Create a new pane:pane.focus
Focus a pane:pane.surfaces
List surfaces in a pane:Surface methods
surface.list
List surfaces in a workspace:surface.create
Create a new surface in a pane:surface.split
Create a split from a surface:surface.close
Close a surface:surface.focus
Focus a surface:surface.move
Move a surface:surface.reorder
Reorder surface within pane:surface.read_text
Read terminal screen content:surface.send_text
Send text to terminal:surface.send_key
Send key to terminal:surface.trigger_flash
Flash surface visually:surface.health
Check surface health status:Tab methods
tab.action
Perform tab action:Browser methods
All browser methods require asurface_id parameter identifying the browser surface.
browser.open_split
Open URL in new browser split:browser.navigate
Navigate to URL:browser.back / browser.forward / browser.reload
Browser navigation:browser.url.get
Get current URL:browser.snapshot
Capture page accessibility tree:browser.eval
Execute JavaScript:browser.wait
Wait for page conditions:browser.click / browser.hover / browser.focus
Interact with elements:browser.type
Type text into element:browser.fill
Fill input (clears first):browser.press
Press keyboard key:browser.select
Select dropdown option:browser.get.*
Extract element data:browser.is.*
Check element state:browser.find.*
Find elements by locator:browser.screenshot
Capture screenshot:browser.focus_webview
Focus the browser webview:browser.is_webview_focused
Check if webview is focused:Example client (Python)
Error codes
Common error codes in error responses:error: Generic errorinvalid_params: Invalid or missing parametersnot_found: Resource not foundunauthorized: Authentication required or failedtimeout: Operation timed outinternal_error: Internal server error