Reverse-engineered API documentation for cmux.dev — a native macOS terminal built on libghostty, designed for multi-agent AI coding workflows.
Started from their published docs, then systematically probed the live socket API to fill in undocumented methods, response schemas, error codes, and behavioral quirks.
| File | Description |
|---|---|
cmux-api-reference.json |
Core API reference — 131 socket methods across 13 namespaces, plus CLI docs, sidebar metadata, keyboard shortcuts, and code examples |
cmux-api-browser.json |
Browser automation API — 72 working methods + 13 WKWebView stubs, split out to keep the core reference lean |
144/144 live socket methods documented. Every response schema verified against the running API (protocol version 2).
| Namespace | Methods | Notes |
|---|---|---|
system |
4 | ping, capabilities, identify, tree |
window |
5 | CRUD + focus |
workspace |
12 | CRUD, navigation, reorder, action dispatcher (12 actions) |
pane |
9 | CRUD, resize, swap, break/join |
surface |
17 | CRUD, split, read/send text, flash, action dispatcher (13 actions) |
tab |
1 | Action dispatcher (shares surface actions) |
notification |
5 | Create, list, clear + surface/target variants |
browser |
85 | DOM, inspection, JS, frames, state, cookies, tabs (13 are WKWebView stubs) |
app |
2 | Focus override, simulate active |
auth |
1 | Login/auth check |
markdown |
1 | Open rendered markdown in split |
settings |
1 | Open settings UI |
feedback |
2 | Open/submit feedback |
- Socket protocol (JSON-RPC over Unix socket, newline-terminated)
- Error envelope with optional
datafield and 5 error codes - Socket path (
~/Library/Application Support/cmux/cmux.sock, not/tmp/cmux.sock) - CLI
--jsonsupport matrix - Sidebar metadata commands (CLI-only: status pills, progress bar, logs)
- Sidebar state format
- Environment variables and detection patterns
- Keyboard shortcuts
- ID format system (refs vs UUIDs)
- Code examples (Python, shell, Claude Code hooks)
→ {"id":"1","method":"workspace.list","params":{}}\n
← {"id":"1","ok":true,"result":{"workspaces":[...]}}
Minimal Python client:
import json, socket, os
def rpc(method, params=None):
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
s.settimeout(3) # server keeps connections open — timeout required
s.connect(os.environ.get('CMUX_SOCKET_PATH',
os.path.expanduser('~/Library/Application Support/cmux/cmux.sock')))
s.sendall(json.dumps({'id': 1, 'method': method, 'params': params or {}}).encode() + b'\n')
return json.loads(s.recv(65536))- Fetched published docs from cmux.com
- Probed
system.capabilitiesto get the full method list - Hit every method with empty params to discover required fields from error messages
- Iterated with parameter variations to map full schemas
- Diffed documented vs live responses to find discrepancies
- Folded everything into structured JSON
This is unofficial documentation created through API probing. Not affiliated with cmux/manaflow.