Skip to content

PI RPC

glib starts PI as a subprocess:

Terminal window
pi --mode rpc --cwd <repo>

Communication is newline-delimited JSON (JSONL) over stdin/stdout.

  • prompt
  • abort
  • steer
  • new_session
  • get_state
  • set_model
  • agent_start
  • text_delta
  • tool_execution_start
  • tool_execution_update
  • tool_execution_end
  • agent_end
  • auto_compaction_start
  • auto_compaction_end
  • auto_retry_start
  • auto_retry_end
  • extension_ui_request
  • One PI process per repo session.
  • Process is killed on repo change or app quit.
  • Single stdout reader goroutine handles framing.
  • Each message is delimited by \n and parsed as strict JSONL.