import type { Metadata } from "next"; import { CodeBlock } from "../../components/code-block"; import { Callout } from "../../components/callout"; export const metadata: Metadata = { title: "API Reference", description: "CLI and socket API reference for cmux", }; function Cmd({ name, desc, cli, socket, }: { name: string; desc: string; cli: string; socket: string; }) { return (
{desc}
cmux provides both a CLI tool and a Unix socket for programmatic control. Every command is available through both interfaces.
| Build | Path |
|---|---|
| Release |
/tmp/cmux.sock
|
| Debug |
/tmp/cmux-debug.sock
|
Override with the CMUX_SOCKET_PATH environment variable.
Commands are newline-terminated JSON:
| Mode | Description |
|---|---|
| Off | Socket disabled |
| Notifications only | Only notification commands allowed |
| Full control | All commands enabled |
| Flag | Description |
|---|---|
--socket PATH
|
Custom socket path |
--json
|
Output in JSON format |
--workspace ID
|
Target a specific workspace |
--surface ID
|
Target a specific surface |
| Variable | Description |
|---|---|
CMUX_SOCKET_PATH
|
Override the default socket path |
CMUX_SOCKET_ENABLE
|
Enable/disable socket (1/0)
|
CMUX_SOCKET_MODE
|
Override access mode (full,{" "}
notifications, off)
|
CMUX_WORKSPACE_ID
|
Auto-set: current workspace ID |
CMUX_SURFACE_ID
|
Auto-set: current surface ID |
TERM_PROGRAM
|
Set to ghostty
|
TERM
|
Set to xterm-ghostty
|