← Demos
Embedding and integrations
Drive pig over RPC
pig --mode rpc takes JSON commands on stdin and answers with JSON events on stdout.
What you are seeing
- pig --mode rpc reads one JSON command per line on stdin and writes JSON events on stdout.
- get_state returns the session state; prompt starts a run, and the events stream back until agent_settled.
- Output lines are cut to the width of the terminal with cut -c1-48. Ctrl+D closes stdin and pig exits. The model is scripted.
Try it yourself
Start RPC mode
pig --mode rpc --no-sessionSend a command (one JSON line)
{"id":"1","type":"get_state"}
Files: MP4 · WebM · Captions (VTT) · PiG source
Next: Resume a 366 MB session