Expand description
RPC JSONL mode: bidirectional command/event protocol over stdin/stdout.
RPC mode enables headless operation of the coding agent via a strict JSONL protocol. Commands arrive on stdin (one JSON object per line), responses and events are emitted on stdout (one JSON object per line). Diagnostics go to stderr.
§Protocol version
This is an unstable 0.x protocol. The schema may change between minor
versions without notice. Clients MUST check schema_version in the
rpc_ready header.
§Framing
LF (\n) is the only record delimiter. Clients MUST split on \n only
and SHOULD strip a trailing \r if present.
§Commands
| Command | Description |
|---|---|
prompt | Send user prompt, stream agent events |
continue | Continue conversation with additional text |
steer | Queue steering message during agent operation |
follow_up | Queue follow-up message for after agent stops |
abort | Cancel current agent operation |
set_model | Switch provider:model |
set_thinking_level | Set reasoning/thinking level |
compact | Trigger manual compaction |
session_info | Query session metadata |
quit | Shut down the RPC session |
§Responses and Errors
Every command produces at most one response object. For prompt and
continue, success: true means the turn was accepted; subsequent agent
output arrives as asynchronous event lines. Errors after acceptance are
surfaced as events, not as a second response.
abort cancels the active operation and succeeds immediately when a turn is
running. A second abort while idle is a successful no-op.
Structs§
- RpcRunner
- RPC runner that owns the harness and processes commands.
Constants§
- RPC_
SCHEMA_ VERSION - Re-export the SDK schema version for crate-level access (e.g. tests).
Type Aliases§
- RpcCommand
- Re-export the SDK command type as the RPC command type.