Unix domain socket server at /tmp/maquake.sock. Send JSON, receive JSON.
Connect to the socket, send a single JSON object with an "action" field, read the response. Each response has "ok": true/false. On error: "error": "message".
echo '{"action":"state"}' | nc -U /tmp/maquake.sock| Action | Description | Params | Response |
|---|---|---|---|
toggle |
Toggle show/hide | — | {"ok":true} |
show |
Show terminal | — | {"ok":true} |
hide |
Hide terminal | — | {"ok":true} |
pin |
Pin (stay visible) | — | {"ok":true} |
unpin |
Unpin (auto-hide) | — | {"ok":true} |
Returns current window state.
{"action":"state"}Response:
{
"ok": true,
"visible": true,
"pinned": false,
"tab_count": 2,
"active_tab_index": 0,
"active_session_id": "UUID",
"width_percent": 75,
"height_percent": 50
}Returns all tabs.
{"action":"list"}Response:
{
"ok": true,
"count": 2,
"tabs": [
{
"session_id": "UUID",
"index": 0,
"title": "zsh",
"active": true,
"cwd": "/Users/user"
}
]
}Create a new terminal tab. Optionally specify starting directory.
{"action":"new-tab"}
{"action":"new-tab", "directory":"/tmp"}Response: {"ok":true, "session_id":"UUID"}
Switch to a tab by session ID or index.
{"action":"focus", "session_id":"UUID"}
{"action":"focus", "index": 1}Close a tab. If no session_id, closes the active tab.
{"action":"close-session"}
{"action":"close-session", "session_id":"UUID"}All I/O actions target the active tab by default. Pass "session_id" to target a specific tab.
Send a command (appends \n).
{"action":"execute", "command":"ls -la"}
{"action":"execute", "command":"ls", "session_id":"UUID"}Send raw text (no newline appended). Useful for multi-line content.
{"action":"paste", "text":"hello world"}Read terminal screen content. Returns last N lines (default 20).
{"action":"read"}
{"action":"read", "lines": 50}
{"action":"read", "session_id":"UUID"}Response:
{
"ok": true,
"session_id": "UUID",
"lines": ["$ ls", "file1 file2"],
"rows": 24,
"cols": 80
}Send a control character or special key.
{"action":"control-char", "key":"c"}Supported keys: c (Ctrl+C), d (Ctrl+D), z (Ctrl+Z), a, e, k, l, u, w, enter, esc, tab.
{"ok":false, "error":"session not found"}
{"ok":false, "error":"not a terminal tab"}
{"ok":false, "error":"missing command"}
{"ok":false, "error":"unknown action: foo"}