New version of pi. Download from npm or view release on GitHub.
Added
-p, --print Flag: Run in non-interactive batch mode. Processes input message or piped stdin without TUI, prints agent response directly to stdout. Ideal for scripting, piping, and CI/CD integration. Exits after first response.
-P, --print-streaming Flag: Like -p, but streams response tokens as they arrive. Use --print-streaming --no-markdown for raw unformatted output.
--print-turn Flag: Continue processing tool calls and agent turns until the agent naturally finishes or requires user input. Combine with -p for complete multi-turn conversations.
--no-markdown Flag: Output raw text without Markdown formatting. Useful when piping output to tools that expect plain text.
- Streaming Print Mode: Added internal
printStreaming option for streaming output in non-TUI mode.
- RPC Mode
print Command: Send {"type":"print","content":"text"} to get formatted print output via print_output events.
- Auto-Save in Print Mode: Print mode conversations are automatically saved to the session directory, allowing later resumption with
--continue.
- Thinking level options: Added
--thinking-off, --thinking-minimal, --thinking-low, --thinking-medium, --thinking-high flags for directly specifying thinking level without the selector UI.
Changed
- Simplified RPC Protocol: Replaced the
prompt wrapper command with direct message objects. Send {"role":"user","content":"text"} instead of {"type":"prompt","message":"text"}. Better aligns with message format throughout the codebase.
- RPC Message Handling: Agent now processes raw message objects directly, with
timestamp auto-populated if missing.
Read more