# JSON Output Contract Use this file when parsing `--format json` output. ## Spawn / Run - `agent-tui run ...` returns: ```json { "session_id": "", "pid": 123 } ``` ## Screenshot (text) - `agent-tui screenshot ...` returns: ```json { "session_id": "", "screenshot": "", "rendered": "" } ``` - `cursor` is only present when `--include-cursor` is passed: ```json { "cursor": { "row": 0, "col": 0, "visible": true } } ``` ## Wait - `agent-tui wait ...` returns: ```json { "found": true, "elapsed_ms": 1200 } ``` ## Resize - `agent-tui resize ...` returns: ```json { "success": true, "session_id": "", "cols": 120, "rows": 40 } ``` ## Restart / Kill - `restart` returns: ```json { "old_session_id": "", "new_session_id": "", "command": "", "pid": 123 } ``` - `kill` returns: ```json { "success": true, "session_id": "" } ``` ## Sessions - `agent-tui sessions` returns: ```json { "sessions": [ { "id": "", "command": "", "pid": 123, "running": true, "created_at": "", "size": { "cols": 120, "rows": 40 } } ], "active_session": "" } ```