A faithful Go
implementation
of Pi.
Tracks Pi behavior through explicit parity evidence.
Install PiG.
One binary, pig. The install scripts check each download against the release’s SHA256SUMS before installing.
Pi deserves a
Go implementation.
PiG aims to carry Pi’s behavior, architecture, and user experience into the Go ecosystem.
Pi remains the reference implementation.
PiG brings it to Go, including an SDK for Go applications.
The same small core. The same room to make it yours. The features below describe the upstream Pi experience that guides PiG’s compatibility work.
Our compatibility philosophyExtend the harness
PiG is not a sealed product. Add a command, tool, provider, workflow, or UI through an extension Resource.
Use source mode while you develop. Use a Piglet to compose the capability into an agent application.
Explore extensions15+ providers, hundreds of models
Anthropic, OpenAI, Google, Azure, Bedrock, Mistral, Groq, Cerebras, xAI, Hugging Face, Kimi For Coding, MiniMax, NVIDIA, OpenRouter, Ollama, and more. Authenticate via API keys or OAuth.
Switch models with /model. Cycle through scoped models with Ctrl+P.
Tree-structured, shareable history
Sessions are stored as trees. Use /tree to navigate to any previous point and continue from there. All branches live in a single file. Filter by message type, label entries as bookmarks.
Export to HTML with /export, or upload to a GitHub gist with /share and get a shareable URL.
Context engineering
Pi’s minimal system prompt and extensibility give you control over what goes into the context window and how it’s managed.
AGENTS.md · Project instructions loaded at startup.
SYSTEM.md · Replace or append to the default system prompt.
Compaction · Customize how older messages are summarized.
Skills & prompts · Load capabilities on demand, with reusable Markdown templates.
Steer or follow up
Submit messages while the agent works. Enter sends a steering message, delivered after the current tool and interrupting remaining tools.
Alt+Enter sends a follow-up that waits until the agent finishes.
Four ways to run it
Interactive · The full terminal UI experience.
Print / JSON · One-shot queries for scripts and structured event streams.
RPC · A JSON protocol over stdin/stdout for process-based integrations.
SDK · Embed PiG in Go applications.
Build with the SDKPrimitives,
not product branches.
Extensions are ordinary Go, Rust, Python, or Node Resources. Piglets compose them into named agent applications.
Build tools, commands, providers, policy gates, MCP adapters, custom UI, and derivative harnesses without adding product behavior to Stock PiG.
pig extension init ./review --lang gopig --piglet ./agents/reviewer.yaml
What stays out of the core
Stock PiG provides generic extension and Piglet contracts instead of dictating each product workflow. Put application behavior in Resources and select it through a Piglet.
No built-in MCP product
Select an MCP adapter extension and supply deployment bindings outside portable Piglet source.
No built-in sub-agent product
Compose a reviewed extension or separate agent application through a Piglet.
No permission product policy
Use an operating-system boundary or select a policy extension that fits your environment.
No built-in plan workflow
Use files, skills, or an extension selected by your agent application.
No built-in to-do workflow
Use a project file or select a focused extension.
No product-specific background shell
Use an explicit terminal or extension policy with owned lifecycle.
Improve PiG.
Start with observed upstream Pi behavior. Report a reproducible difference, preserve attribution, and support compatibility claims with parity evidence.
One ecosystem.
Two implementations.
Pi came first. PiG carries its ideas, architecture, and experience into Go. Pi remains the reference implementation.
Where practical, PiG follows upstream behavior and minimizes divergence.
Where PiG began.
Michael Kinsy created PiG. The project was originally developed at Hewlett Packard Enterprise.
PiG is maintained independently from upstream Pi. Pi remains the reference implementation.
Built on the work of Pi.
PiG would not exist without the work of the Pi maintainers and contributors.
PiG follows the architecture they designed and adapts the documentation they wrote.
Thank you.