# PiG

> A Go implementation of the Pi terminal coding agent, shipped as a single native binary with extension, SDK, and RPC support.

PiG (Pi in Go) is Pi, the minimal and extensible terminal coding agent, rebuilt in Go as one native binary named `pig`. It was created by Michael Kinsy, originally developed at Hewlett Packard Enterprise, and is maintained as an independent open-source project under the MIT license. The README describes it as a pre-stable 0.x release checked against a pinned Pi version with paired parity scenarios; the latest listed release is v0.4.1.

## What It Is

PiG is a terminal coding agent that follows the behavior of upstream Pi, which remains the reference implementation. The project states it needs no Node.js, starts quickly, and runs Pi's TypeScript extensions unchanged. It is not an official Pi release, and the Pi maintainers do not endorse it. Differences from Pi are treated as bugs or documented divergences, and Windows support is described as a preview.

## How You Work With It

Start `pig` in a project directory, run `/login` to connect a subscription or set a provider API key, then give it tasks. The site lists 15+ providers, including Anthropic, OpenAI, Google, Azure, Bedrock, Mistral, Groq, xAI, OpenRouter and Ollama, with model switching via `/model`. Sessions are stored as trees navigable with `/tree`, and can be exported to HTML with `/export` or shared as a GitHub gist with `/share`. You can steer a running agent with Enter or queue a follow-up with Alt+Enter. Context is controlled through AGENTS.md, SYSTEM.md, compaction, skills, and prompt templates.

## Extensions, Piglets, and Run Modes

Extensions can be written in Go, Rust, Python, or Node and can register tools, commands, event handlers, flags, shortcuts, providers, and UI contributions. A Piglet bundles extensions, skills, and prompts into a named agent that can be shared or built into its own executable. PiG runs in four modes: interactive terminal UI, print/JSON for scripts, RPC over stdin/stdout, and a Go SDK for embedding. Stock PiG deliberately omits built-in MCP, sub-agent, permission, plan, and to-do products, leaving those to extensions.

## Security Boundary

PiG runs with the permissions of the user who starts it and provides no sandbox for model output, tools, extensions, or shell commands. The documentation recommends a container, virtual machine, or other OS boundary for isolation.

## Features
- Single native Go binary
- Runs Pi TypeScript extensions unchanged
- Extensions in Go, Rust, Python, and Node
- Piglets bundle extensions, skills, and prompts into named agents
- 15+ model providers with API key or OAuth login
- Tree-structured sessions with /tree, /export, and /share
- Steering and follow-up messages while the agent runs
- Context control via AGENTS.md, SYSTEM.md, compaction, skills, and prompts
- Interactive, print/JSON, RPC, and Go SDK modes
- SHA256-verified install scripts

## Integrations
Anthropic, OpenAI, Google, Azure, Amazon Bedrock, Mistral, Groq, Cerebras, xAI, Hugging Face, OpenRouter, Ollama, NVIDIA, MiniMax, GitHub gists

## Platforms
WINDOWS, MACOS, LINUX, ANDROID, WEB, API, DEVELOPER_SDK, CLI

## Pricing
Open Source

## Version
v0.4.1

## Links
- Website: https://pi-in-go.dev
- Documentation: https://pi-in-go.dev/docs/latest/
- Repository: https://github.com/MichaelKinsy/PiG
- EveryDev.ai: https://www.everydev.ai/tools/pig
