Socket API
Unix socket API for programmatic control of cmuxterm
Socket API
cmuxterm exposes a Unix socket for programmatic control, enabling automation and integration with tools like Claude Code.
Socket Location
| Build | Socket Path |
|---|---|
| Release | /tmp/cmuxterm.sock |
| Debug | /tmp/cmuxterm-debug.sock |
You can override the path with the CMUX_SOCKET_PATH environment variable.
Access Modes
cmuxterm has three access modes, configurable in Settings:
| Mode | Description |
|---|---|
| Off | Socket disabled |
| Notifications only | Only notification commands allowed |
| Full control | All commands enabled |
On shared machines, use "Notifications only" mode to prevent other users from controlling your terminals.
Protocol
Commands are sent as newline-terminated JSON:
Responses are newline-terminated JSON:
Commands Reference
Tab Management
list-tabs
List all open tabs.
Response:
new-tab
Create a new tab.
select-tab
Switch to a specific tab.
current-tab
Get the currently active tab.
close-tab
Close a specific tab.
Split Management
new-split
Create a new split pane.
Direction options: left, right, up, down
list-panels
List all panes in the current tab.
focus-panel
Focus a specific pane.
Input Control
send
Send text input to a terminal.
send-key
Send a key press.
Key options: enter, tab, escape, backspace, delete, up, down, left, right
send-panel
Send text to a specific panel.
send-key-panel
Send a key press to a specific panel.
Notifications
notify
Send a notification.
list-notifications
List all notifications.
clear-notifications
Clear all notifications.
App Control
ping
Check if the socket is responsive.
Response:
set-app-focus
Simulate app focus/unfocus (for testing).