Skip to content

Back to the catalog

MichaelKinsy/PiG
github.comrepo

MichaelKinsy/PiG

PiG reimplements Pi — a minimal, extensible terminal coding agent — as a single native Go binary with no Node.js dependency, while remaining behaviorally pinned to a specific Pi release (0.87.1) and running Pi's TypeScript extensions unchanged. It adds a multi-language extension host (Go, Rust, Python, Node), a "Piglet" mechanism for bundling extensions/skills/prompts into a named shareable agent, and a formal parity-tracking process (PORT_MAP.md, DIVERGENCES.md, coverage reports) that documents every intentional divergence from the upstream Pi reference implementation.

TL;DR Go-native reimplementation of the Pi terminal coding agent that stays behaviorally pinned to upstream Pi while supporting Go/Rust/Python/Node extensions.
Document

What it claims

PiG is a from-scratch Go reimplementation of Pi (a terminal coding agent), shipping as one native binary that starts without Node.js and runs Pi's TypeScript extensions unchanged. It is pinned to Pi 0.87.1 at commit f07218c4..., which serves as the "behavior oracle": any difference from Pi is either a bug or a documented divergence. It is explicitly not an official Pi release and is not endorsed by the Pi maintainers; it was created by Michael Kinsy working at Hewlett Packard Enterprise, and is maintained as an independent project.

Scope boundary

PiG currently ports Pi's agent, ai, coding-agent, and tui packages. It does not implement Pi's experimental remote Session packages, nor its standalone telemetry and evaluation packages. The pin names the reference behavior but does not claim full parity — parity/coverage.md reports verified behavior and parity/upstream-sync/ ledgers track each upstream change's disposition. A "ported" row means code exists, not that behavior is proven compatible.

How to use it

Install (macOS/Linux, Windows, npm, or Go respectively):

curl -fsSL https://pi-in-go.dev/install.sh | sh
irm https://pi-in-go.dev/install.ps1 | iex
npm install -g @pi-in-go/pig
go install github.com/MichaelKinsy/PiG/cmd/pig@latest

Then:

cd /path/to/project
pig

Run /login to connect a subscription or set a provider key (e.g. OPENAI_API_KEY).

Version strings encode both releases: pig --version prints <PiG>+<Pi>, e.g. 0.2.0+0.87.1 (Pi release is semver build metadata, so sorting follows the PiG release). Config lives in ~/.pig/ (PIG_HOME).

npm caveat: the binary ships as an optional platform package (@pi-in-go/pig-<os>-<cpu>); installing with --omit=optional/--no-optional leaves it out. pig update does not update an npm install — use npm update -g. Go installs need both the root module tag and extensions/sdk/vX tag on the same commit.

Extensions can be written in Go, Rust, Python, or Node; scaffold with pig extension init <dir> and validate with pig install <path> --validate-only --json. A "Piglet" bundles Resources/tools/defaults into one named agent (pig --piglet piglets/standard/pig-standard.yaml); "Stock PiG" is the product-neutral build that never activates a Piglet implicitly.

Limits

  • No security sandbox. PiG runs with the invoking user's permissions and provides no isolation for model output, tools, extensions, hooks, or shell commands. Use a container/VM for isolation and load extensions/instructions only from trusted sources.
  • Windows is preview. Do not treat any platform as release-supported until its native release verification passes.
  • Source builds require a heavy toolchain: Go 1.27.1, Git, Node 24.19.0/npm 12.1.0 for parity tooling, Python 3.12, Rust 1.97.1, and tmux for Unix terminal parity tests.

Organisations named here

  • Hewlett Packard Enterprise
  • Michael Kinsy

Technologies named here

  • PiG
  • pi
  • Piglet
  • PiG Standard
  • extensions/sdk-ts
  • Go extension SDK
  • Node.js
  • Rust
  • TypeScript
  • Go
  • Python