THE PI ECOSYSTEM, IN GO

A faithful Go
implementation
of Pi.

Tracks Pi behavior through explicit parity evidence.

Created by Michael Kinsy.Originally developed at Hewlett Packard Enterprise.
Why PiG exists
Watch the 1-minute setup

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.

Read the story
pig - your-projectthe Pi experience, in Go
make this project feel like me
read AGENTS.md
I’ll start with your project instructions, then build on what’s already here.

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 philosophy

Extend 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 extensions
pig - your-projectbuild a custom workflow
add a /review command for my team
write .pig/extensions/review/extension.go
package review
 
import (
sdk "github.com/MichaelKinsy/PiG/extensions/sdk"
)
 
const reviewPrompt = `Review the current git diff against the team conventions in AGENTS.md.
List each problem with its file and line, then suggest a fix.`
 
func Extension() *sdk.Extension {
... (8 more lines, 18 total, ctrl+o to expand)
Added /review. It checks your diff against the team conventions in AGENTS.md.
Reloaded keybindings, extensions, skills, prompts, themes, and context files
Illustration: ask PiG to add a team /review command as an extension, then run /reload to load it without restarting.

15+ 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.

Browse the model catalog
pig - your-projectswitch models mid-session
Only showing models from configured providers. Use /login to add providers.
> 5-5
(1/33)
Model Name: Claude Opus 5.5
Model catalogs refreshed.
Illustration: /model with a search for 5-5. Switch models mid-session; the Session keeps its context.

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.

Explore sessions
pig - your-projectbranch and share a session
Session Tree
↑/↓ move · ←/→ page · option+←/→ branch · ctrl+x copy · shift+l label · shift+t label time
filters ctrl+d/t/u/l/a · cycle ctrl+o/shift+ctrl+o
Type to search:
(9/9)
Illustration: rewind to any earlier entry with /tree, branch from there, and keep every branch in one Session file.

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.

Control your context
pig - your-projectload skills and instructions
pig · cwd=~/your-project
[Context] ~/your-project/AGENTS.md
[Skills] release-notes
[Prompts] /review
Ready. Type a message and press Enter (or Shift+Enter for newline). Ctrl+O toggles all tool details. Ctrl+D to exit.
Illustration: at startup, pig lists the context files, skills, and prompt templates it found. Skills load when a task needs them.

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.

pig - your-projectsteer a running agent
refactor the authentication module
edit src/auth.ts
Queued steering message
Steering: Keep the existing public API.
↳ Alt+Up to edit all queued messages
── ⠋ Working
Illustration: press Enter to steer the current run, or Alt+Enter to queue a follow-up for when it 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 SDK
PiG command and Go SDK examples
Illustration: the same agent runs interactively, in print or JSON mode for scripts, over RPC, or embedded through the Go SDK.

Primitives,
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.

Browse packages
$pig extension init ./review --lang go
$pig --piglet ./agents/reviewer.yaml

...and just like Pi,
PiG plays Doom.

Explore the Doom extension
Doom running inside pig through the unchanged pi-doom extension, above the pig footer
FIG. 01 / PIG · DOOM EXTENSION

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.

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.

Explore upstream Pi

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.