FOR PI USERS
A faithful Go port of Pi.
PiG ships as one Go binary and uses Pi’s extensions, skills and session format. Pi is the reference implementation, and PiG is not an official Pi project. Run PIG_USE_PI_DIRS=1 pig to work from your existing ~/.pi setup.
curl -fsSL https://pi-in-go.dev/install.sh | sh- Memory · resume a 365 MiB session82.2 MiBPi 1.6.0: 634.3 MiB · 7.7x lower
- Startup · to the first prompt34 msPi 1.6.0: 419.5 ms · repeat start
- Binary · linux/amd6463.0 MBOne file. 0.8.0 release asset.
Memory and startup: PiG 0.8.0 and Pi 1.6.0 on Intel Xeon Platinum 8468, Linux 7.0, 4 pinned cores per program. Binary size: the 0.8.0 release assets. How we measured
Short recordings, one point each.
Each clip is a real run of pig 0.7.0 in a terminal, with captions. Model replies are scripted; the tool calls, files and commands are real.
0:10Ask a question, watch a tool runpig reads a file with its read tool and answers from what it read.
0:34Switch models and branch a sessionChange the model mid-session with /model, then continue from an earlier message with /tree.
0:13Bring your Pi setupPIG_USE_PI_DIRS=1 starts pig with the AGENTS.md and skills from ~/.pi.
0:22Write an extension in Gopig extension init creates a Go extension; pig -e builds and loads it.
0:13Script pig: print and JSON modespig -p prints an answer and exits; --mode json prints every event as a line of JSON.
0:32Build a Piglet into one signed binaryA seven-line manifest becomes a signed executable, which pig verifies and runs.
Piglets, extensions, skills and more.
One catalog of what is published on npm for PiG and Pi: filter by type, search, sort by downloads. Every entry has its install command, its manifest and a security note. Community listings are not reviewed by PiG.
7,257 listings from npm16 piglets4,338 extensions433 skills63 prompts122 themes253 providers2,511 packagesSynced 2026-11-30
- Piglet@pi-in-go/pigpen-piglet-herdrPiG with the herdr agent-state reporter: idle, working and blocked in herdr's sidebar, notifications and `herdr agent wait`.
pig piglet add npm:@pi-in-go/pigpen-piglet-herdr - Piglet@pi-in-go/pigpen-piglet-pig-ternPiG drawn natively in Tern: the transcript, tool cards, diffs, pickers, settings, the input editor and the footer become Tern Surface Protocol nodes. Outside Tern, PiG draws as usual.
pig piglet add npm:@pi-in-go/pigpen-piglet-pig-tern - Packagebillion-contextA context-compression plugin — small context windows (a 100K context is enough), 5x fewer tokens, month-long single sessions (billions of tokens), and compression quality — for all agents: pi, OpenCode, Codex, Claude Code, and more. billio…
pig install npm:billion-context - Extensionpi-mcp-adapterMCP (Model Context Protocol) adapter extension for Pi coding agent
pig install npm:pi-mcp-adapter - Packagemodern-web-guidanceKeep your agent up to date on the latest web best practices.
pig install npm:modern-web-guidance - Extensionpi-web-accessWeb search, URL fetching, GitHub repo cloning, PDF extraction, YouTube video understanding, and local video analysis for Pi coding agent. Supports OpenAI, Brave, Parallel, TinyFish, Search1API, Searchinfinity, Querit, Tavily, Firecrawl, Cr…
pig install npm:pi-web-access
Bring your ~/.pi.
PiG reads Pi’s session format and runs Pi’s extensions and skills. By default it keeps its own state under ~/.pig, so the two can run side by side. One variable points PiG at Pi’s directories.
Pi 1.6.0 behavior, with lower measured memory and startup.
Bare Pi against bare PiG: no extension, no Piglet, the same harness, the median of 15 runs. The page lists the host, the builds and the session files.
Resume a 365 MiB session
Peak memory. 7.7x lower.
Open a 427 MiB session, /fork
Peak memory. 7.8x lower.
Start to the first prompt
Repeat start. First start: Pi 420 ms, PiG 39.9 ms.
One file, per target
The pig executable in each release archive.
Method, hosts and every figure buffon: longer runs (PiG 0.5.0, 2026-10-19)
One binary for the whole workflow.
Each step is a real command. The output is what pig 0.7.0 printed against a scripted model, trimmed. Pick a step, or let them play.
$ pigYAML in, one signed binary out.
A Piglet is a named agent setup: the tools, skills, extensions and prompts it keeps. PiG builds one into a single executable and signs it with your key. To accept only signed binaries, run pig piglet trust add and then pig piglet trust require on.
Piglet binaries What a Piglet is Browse Piglets Build a Piglet in your browser
name: reviewer
description: "Reviews a change and lists risks."
systemPrompt:
text: "You review changes. List the risks first, then the questions."
tools: [read, grep, find, ls]Five languages, one extension API.
Write an extension in Go, Rust, Python or Common Lisp, or run Pi’s TypeScript extensions through Node.js. All five use the same extension API, with the gaps listed in the SDK surface table.
package shout
import (
"strings"
sdk "github.com/MichaelKinsy/PiG/extensions/sdk"
)
func Extension() *sdk.Extension {
e := sdk.New("shout")
e.Tool("shout", "Upper-case text", sdk.Schema{"type": "object", "properties": map[string]any{"text": map[string]any{"type": "string"}}},
func(ctx sdk.Context, p map[string]any) (any, error) { return strings.ToUpper(p["text"].(string)), nil })
return e
}[ SHOW OUTPUT ][ HIDE OUTPUT ]
$ pig install ./shout --validate-only --json
{
"valid": true,
"name": "shout",
"source": "/tmp/ext-go/shout",
"hash": "914aa12b2f5843752b6a661d0b8294271223ed44e1b1e9e0531e38b7a8a2e442",
"tools": [
"shout"
],
"toolDetails": [
{
"name": "shout",
"description": "Upper-case text"
}
],
"registered": true,
"definition": {
"form": "factory",
"language": "go",
"root": "/tmp/ext-go/shout",
"package": "example.com/shout",
"factory": "Extension",
"packable": true,
"runtime": "subprocess",
"sdk": "github.com/MichaelKinsy/PiG/extensions/sdk",
"isolation": "shared-ok"
},
"autoDiscovered": true
}
(exit 0, 1.9 s, first build)
$ pig -e ./shout --mode json -p 'Please shout hello' # tool_execution events only (filtered)
{"type":"tool_execution_start","toolName":"shout","args":{"text":"hello from pig"}}
{"type":"tool_execution_end","toolName":"shout","result":{"content":[{"type":"text","text":"HELLO FROM PIG"}]},"isError":false}
(exit 0, 0.1 s)
$ pig -e ./shout -p 'Please shout hello'
The tool returned: HELLO FROM PIGReal output of pig 0.7.0. Lines such as (exit 0) and the # notes on a command are added by the capture script. Where output is cut, a line says so.
Also needed, not shown: go.mod.
Put PiG inside your own tool.
A Go SDK, JSON over stdin and stdout, one-shot runs for CI, and a Piglet as one executable. Pick one and copy it.
// needs: context, fmt, log, github.com/MichaelKinsy/PiG/coding
services, err := coding.CreateAgentSessionServices(coding.CreateAgentSessionServicesOptions{CWD: ".", AgentDir: coding.DefaultAgentDir()})
must(err)
rt, err := coding.NewRuntime(coding.RuntimeOptions{Services: services})
must(err)
model, err := coding.BuildModel("fake/fake-model", services)
must(err)
session, err := rt.New(coding.SessionStartOptions{Model: model})
must(err)
_, err = session.Send(context.Background(), "Say hello")
must(err)
fmt.Println(*session.LastAssistantText())[ SHOW OUTPUT ][ HIDE OUTPUT ]
$ go mod tidy
go: downloading golang.org/x/sync v0.24.0
go: downloading cloud.google.com/go/compute v1.24.0
go: downloading github.com/lucasb-eyer/go-colorful v1.4.0
go: downloading github.com/clipperhouse/displaywidth v0.11.0
go: downloading github.com/google/go-cmp v0.7.0
$ go vet ./...
vet exit 0
$ go build -o sdkdemo .
build exit 0
$ ./sdkdemo
Hello! This reply comes from a local fake model.
run exit 0Real output. The go mod tidy download lines are trimmed to the last five.
must(err) is a five-line helper that calls log.Fatal. The model here is a local fake; point BuildModel at a provider you use.
Works with the tools you already use.
PiG runs Pi extensions unchanged and speaks ACP, the Agent Client Protocol editors and terminals use to drive an agent, through pig-acp. Pick a tool below to open its setup page and test record.
24 tools ran on PiG 0.8.0, 0 more ran on 0.7.x, and 15 additional ACP clients are listed from their own documentation.
[ ONE-TIME SETUP: INSTALL PIG-ACP ][ HIDE ONE-TIME SETUP ]
Install PiG 0.8.0 or later. pig version prints PiG’s version; pig --version prints the Pi version it follows. The editor needs the absolute path of pig as /path/to/pig.
pig versionDownload pig-acp from the same PiG release on GitHub (github.com/MichaelKinsy/PiG/releases): pig-acp-0.9.0-<os>-<arch>.tar.gz on macOS and Linux (amd64, arm64) or pig-acp-0.9.0-windows-<arch>.zip on Windows. Unpack pig-acp into a folder on your PATH and check it.
pig-acp --versionIf pig has no model or key yet, sign in once in a terminal. Without it, the editor gets the ACP error "authentication required".
pig-acp --pig /path/to/pig --terminal-loginThe editor then runs this command and speaks ACP over stdin and stdout. pig-acp starts pig --mode rpc for each session.
pig-acp --pig /path/to/pig
- A2A agentsWorks todayPiG piglet
- ACP TypeScript SDK example clientWorks todayPiG ACP adapter
- acpx (CLI)Works todayPiG ACP adapter
- agent-shell (Emacs)Works todayPiG ACP adapter
- agentic.nvim (Neovim)Works todayPiG ACP adapter
- BraintrustWorks todayPi extension
- CodeCompanion (Neovim)Works todayPiG ACP adapter
- Hash (shell)Works todayPiG ACP adapter
- herdrWorks todayPi extension (or Pigpen packages)
- hermes.nvim (Neovim)Works todayPiG ACP adapter
- kagentWorks todayHarness source in Pigpen (not yet upstream in byo-ext)
- LangfuseWorks todayPi extension
- LangSmithWorks todayPi extension
- magpieWorks todayCommunity plugin (or PIG_USE_PI_DIRS=1)
- Nori CLIWorks todayPiG ACP adapter
- ParadevWorks todaySymlink to pig (or pig-acp)
- PaseoWorks todayPiG ACP adapter (or Pi RPC provider)
- pi-posthorseWorks todayPi extension
- PigpenWorks todayPiG piglet
- RexWorks todayNothing extra (optional pig-rex Piglet)
- T3 CodeWorks todayPiG ACP adapter (or Pi RPC provider)
- TernWorks todayPiG piglet
- ToadWorks todayPiG ACP adapter
- ZedWorks todayPiG ACP adapter
- AutolithIn progressPiG piglet
What we didn’t build.
Stock PiG provides generic extension and Piglet contracts instead of dictating each product workflow. Put application behavior in a Resource and select it through a Piglet. MCP and code mode are built in, as they are in Pi.
No built-in sub-agent product
Compose a reviewed extension or separate agent application through a Piglet.
Derivative harnessesNo permission product policy
Use an operating-system boundary or select a policy extension that fits your environment.
ContainerizationNo built-in plan workflow
Use files, skills, or an extension selected by your agent application.
ExtensionsNo built-in to-do workflow
Use a project file or select a focused extension.
ExtensionsNo product-specific background shell
Use an explicit terminal or extension policy with owned lifecycle.
tmux

Built with Pi people.
Start with observed Pi behavior. Report a reproducible difference, keep the attribution, and support compatibility claims with parity evidence.
Pigpen
The community index of Piglets and Pi extensions ported to Go.
Browse PigletsContribute
Report a difference from Pi, send a fix, or port an extension. Every commit needs a DCO sign-off and a verified signature.
How to contributeDemos
Short recordings of PiG running, with captions.
Watch the demosGuides
Port a Pi extension, bring your Pi setup, build a Piglet, embed PiG, and set it up in each tool.
Read the guidesDocs
References, from first run to the SDK.
Read the docs
The herd: PiG’s built-in sprites. Pick yours with /sprite.
PiG is not an official Pi project. Pi is the reference implementation, from Earendil Works; see the Pi documentation. Created by Michael Kinsy. Originally developed at Hewlett Packard Enterprise. Source: MichaelKinsy/PiG.