# RPC commands

The commands `pic --mode rpc` reads on stdin, one JSON object per line, with Pi's fields, responses
and errors (Pi's `docs/rpc.md` and `docs/rpc-commands.md`). How the mode behaves is in [RPC
mode](../manual/rpc.md).

| Command | What it does |
|---|---|
| `prompt` | send a message (with `images` and `streamingBehavior`) |
| `steer` | steer the running request |
| `follow_up` | queue a message for after the running request |
| `abort` | stop the running request |
| `clear_queue` | drop queued steering and follow-ups |
| `new_session` | start a new conversation |
| `get_state` | the session's state |
| `get_messages` | the conversation's messages |
| `set_model` | switch model; applies from the next request |
| `cycle_model` | the next model |
| `get_available_models` | models whose provider has a key |
| `set_thinking_level` | set the thinking level; applies from the next request |
| `cycle_thinking_level` | the next thinking level |
| `get_available_thinking_levels` | the model's supported levels |
| `set_steering_mode` | how steering is delivered |
| `set_follow_up_mode` | how follow-ups are delivered |
| `compact` | compact now, outside any request |
| `set_auto_compaction` | the `compaction.enabled` setting |
| `set_auto_retry` | saved as Pi's `retry.enabled` |
| `abort_retry` | stop waiting for a retry |
| `bash` | run a command and journal it |
| `abort_bash` | stop the running bash command |
| `get_session_stats` | tokens and cost |
| `export_html` | the conversation as an HTML page |
| `switch_session` | continue another conversation: a conversation id, or a file `pic export --pi` wrote, as `sessionPath` |
| `fork` | fork from an entry |
| `clone` | duplicate the conversation |
| `get_fork_messages` | the messages a fork can start from |
| `get_entries` | the conversation's own path |
| `get_tree` | the conversation's own path, as a tree |
| `get_last_assistant_text` | the last reply's text |
| `set_session_name` | name the conversation |
| `get_commands` | prompt templates and skills |
| `extension_ui_response` | answered with an error: pic has no extensions |
| `login` | answered with an error: pic has no subscription login |
| `logout` | answered with an error: pic has no subscription login |
