MichaelKinsy/PiG
PiG (Pi in Go) is a faithful Go port of upstream Pi, the TypeScript codebase behind the Pi coding agent. It is a parity-bound translation, not a rewrite: upstream behavior is the contract, and Go is the implementation language.
PiG – a Go‑native version of the Pi coding‑agent
What it is
- PiG is a re‑implementation of the Pi terminal‑based coding assistant, written in Go and compiled to a single native binary. It aims for behavioral compatibility with the original Pi (pinned to version 0.87.1) while letting users run the agent without a Node.js runtime.
- Extensions that work with Pi (TypeScript) run unchanged, and developers can also write new extensions in Go, Rust, or Python.
Why it matters
- The original Pi is a lightweight AI‑powered coding agent that lives in the terminal and can answer questions, generate code, and run tools. PiG makes the same experience start faster, be easier to install on servers or CI environments, and be packaged as a single executable.
- By keeping a strict compatibility map with the upstream Pi source, PiG can serve as a drop‑in replacement for users who prefer Go’s static binaries or need to embed the agent in other Go programs.
How to get it
| Platform | Installation method |
|---|---|
| macOS / Linux | curl -fsSL https://pi-in-go.dev/install.sh | sh |
| Windows (PowerShell) | `irm https://pi-in-go.dev/install.ps1 |
| Any platform (Node) | npm install -g @pi-in-go/pig |
| Any platform (Go) | go install github.com/MichaelKinsy/PiG/cmd/pig@latest |
| Manual | Download a release archive from the GitHub Releases page or build from source (requires Go 1.27.1). |
Quick start
cd /path/to/your/project
pig # start the interactive agent
/pig login # provide an OpenAI (or other) API key
# now you can ask the agent to write code, explain files, etc.
The /login command masks the secret by default; you can disable masking in /settings.
Key concepts
- Piglet – a YAML‑described composition of extensions, skills, and prompts that can be bundled into its own executable. The repository ships a default PiG Standard piglet (
piglets/standard/pig-standard.yaml). - Extensions SDK – public packages for writing extensions in Go, Rust, Python, or TypeScript. Use
pig extension init <dir>to scaffold a new extension. - Parity layer – the repo contains a full mapping (
PORT_MAP.md) and test coverage (parity/coverage.md) that verify the Go code behaves like the original Pi source. Divergences are recorded inDIVERGENCES.md. - Security boundary – PiG runs with the invoking user’s permissions and does not sandbox model output or executed tools. Users should isolate untrusted extensions with containers or VMs.
Project layout (high‑level)
agent/– core agent loop and session handling.ai/– provider adapters, model catalog, authentication helpers.coding/– SDK for coding‑agent features, extension contracts, and “Piglet” packaging.tui/– terminal UI components.extensions/– language‑specific SDKs for Go, Rust, Python, and TypeScript.tests/– integration and compatibility tests against the upstream Pi.docs/– public documentation site (hosted at https://pi-in-go.dev).
Development & verification
make checkruns the main test gate;make verifyrefreshes parity coverage.make upstream-mirrorfetches the exact Pi source that PiG is pinned to.- CI badges show continuous integration, CodeQL security scanning, OpenSSF scorecard, and best‑practice compliance.
Licensing & governance
- Licensed under the MIT License (see
LICENSE). - The project follows an open governance model (see
GOVERNANCE.mdandMAINTAINERS.md). - Contributions are welcomed; see
CONTRIBUTING.mdfor the process.
Where to learn more
- Full documentation: https://pi-in-go.dev/docs/latest
- Upstream Pi reference: https://github.com/earendil-works/pi
- Community: Discord invite, Reddit community, and a dedicated X (Twitter) account.
Bottom line: PiG gives you the same AI‑driven terminal coding assistant experience as the original Pi, but as a fast, single‑binary Go program that can be installed via script, npm, or go install, and extended in multiple languages.
Related
- Project
- Project
- Project
- Project