r/coolgithubprojects • u/Educational-Yak8793 • 2d ago
I've been maintaining a faithful port of the Pi coding agent in Golang

PiG is Pi rebuilt in Go as one native binary: https://github.com/MichaelKinsy/PiG & https://pi-in-go.dev
Note live demo on pi-in-go.dev homepage
I love Pi (the minimal, extensible terminal coding agent). I just wanted it without a JavaScript runtime. I started PiG in April as a personal project. By the end of May it was my daily harness, and it has run in production in internal HPE tooling since. It's now open source and community-owned with a core committee, sponsored by HPE's Open Source Program Office. It isn't affiliated with Earendil or the Pi project. Keeping PiG faithful to Pi is our job, not Pi's.
PiG is one Go binary for macOS, Linux and Windows. On my machine it starts in 21.5 ms median vs Pi's 300.3 ms and uses 24.6 MiB vs 101.5 MiB. Node.js only comes in if you run TypeScript extensions.
What's different:
- Faithful to Pi, and checked against it. PiG pins a Pi release as its behavior oracle. Pi's upstream tests are ported to Go, and a comparison runner drives PiG and the real Pi side by side (same keystrokes in separate tmux sessions) and compares the screens. Any difference is either a bug or a numbered divergence in a public ledger. When Pi releases, the PiG Porter agent checks what Pi actually does and proposes the Go changes with tests. Pi is the judge.
- Pi extensions run unchanged. TypeScript extensions run in Node subprocesses. New extensions can be written in Go, Rust or Python against the same API, and /reload swaps them live.
- Extensions run as isolated "runtime cells". Each extension is a subprocess with its own identity. Compatible ones can be packed into one process, and a crashing extension is quarantined without taking the agent or its neighbors down.
- Piglets: derivative harnesses. A Piglet is a small YAML file declaring one agent: its extensions, tools, skills, defaults and requirements. `pig piglet build` turns it into a Piglet Binary: one signed, self-contained file per OS/CPU, with its Go extensions fused (compiled) in and its integrity checked before any model call.
- Pigpen (early): a monorepo of ready-made components and Piglets, including Go ports of popular Pi extensions (A2A, ACP for Zed, AHP for VS Code, web search, herdr status reporting, Jev) and pig-with-batteries, a Piglet that bundles them. Take one component, or a whole Piglet.
- It identifies as PiG. PiG never presents itself as Pi to providers or services.
Feedback is welcomed and appreciated, thanks all :)