pi-rpc-sdk
Pi headless RPC JSONL over stdin/stdout, strict LF framing, --mode json event streaming, and Node SDK alternatives (AgentSession). Use when integrating pi --mode rpc, pi --mode json, writing a client that speaks the protocol, reading JSON event streams, or choosing RPC vs in-process SDK. Use for "pi rpc client", "JSONL framing", "readline rpc", "--mode json", "json events", "embed pi without subprocess", "createAgentSession", "AgentSessionRuntime", "ModelRegistry", "embed pi", "SDK factory", even if the user only pasted JSON lines.
How do I install this agent skill?
npx skills add https://github.com/romiluz13/pi-agent-skills --skill pi-rpc-sdkIs this agent skill safe to install?
- Gen Agent Trust Hubpass
The skill provides integration guidelines for the Pi RPC protocol and SDK, referencing external documentation and source code. No security issues were detected.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
- ZeroLeakspass
Score: 93/100 · 2 sections analyzed
What does this agent skill do?
Pi RPC and SDK integration
Grounding
pi-mono/packages/coding-agent/docs/rpc.md— Framing section (LF-only record delimiter;readlineincompatibility with U+2028/U+2029).pi-mono/packages/coding-agent/docs/sdk.md— programmatic session patterns pluscreateAgentSession,AgentSession,createAgentSessionRuntime,ModelRegistry.create(),AuthStorage.create(), andSessionManager.inMemory().pi-mono/packages/coding-agent/docs/json.md—--mode jsonevent stream: session header,agent_*/turn_*/message_*/tool_execution_*events,jqfiltering examples.pi-mono/packages/coding-agent/src/modes/rpc/rpc-client.ts— reference TypeScript client mentioned fromrpc.mdintro when applicable.pi-mono/packages/coding-agent/src/core/agent-session.ts— API surface for in-process embedding (perrpc.mdnote to TypeScript users).
Invariants
- Framing rules are normative text in
pi-mono/packages/coding-agent/docs/rpc.md; quote or paraphrase strictly from that file when advising client implementers. - Skill commands and prompt templates are expanded for RPC prompts per
rpc.mdInput expansion bullet underpromptcommand. --mode jsonis read-only observation (stdout events);--mode rpcis bidirectional control (stdin commands + stdout responses). Different use cases, same framing caveats for U+2028/U+2029.- For TypeScript/Node embedding,
createAgentSession()is the primary factory; it requiressessionManager,authStorage, andmodelRegistry. For advanced multi-session hosting, usecreateAgentSessionRuntime()which returnsAgentSessionRuntimewith lower-level access toagent,sessionManager,settingsManager,modelRegistry,extensions,bashExecutor,resourceLoader—pi-mono/packages/coding-agent/docs/sdk.md.
Workflows
- Choose integration: If user is on Node/TS, point to
rpc.mdrecommendation to preferAgentSessionvs subprocess; cite the file’s opening Note for Node.js/TypeScript users. - Debug framing: Re-read Framing section; do not suggest generic line readers as compliant.
- JSON event stream: For read-only observation of agent activity, point to
json.md(--mode json); for bidirectional control, point torpc.md(--mode rpc). - In-process embedding: For TypeScript/Node users who don't need subprocess isolation, prefer
createAgentSession()over--mode rpc. Import from@mariozechner/pi-coding-agent. Seepi-mono/packages/coding-agent/docs/sdk.mdandpi-mono/packages/coding-agent/examples/sdk/.
Anti-patterns
- Do not describe delimiter behavior contradicting
rpc.md(only\nas record delimiter; optional\rstrip on input).
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/romiluz13/pi-agent-skills/pi-rpc-sdk">View pi-rpc-sdk on skillZs</a>