Skip to content
FossShelf
Home / Categories / For Engineers

PiG

Pi's coding agent, in Go. One binary, no Node.js required.

Replaces Claude Code

0.87K starsMITreviewed 2 Oct 2026last commit 16 Nov 2026
Screenshot of PiG

Who it's for

Go developers building or embedding a coding agent

PiG exposes a public Go SDK with `agent` and `coding` packages. Go developers can embed the agent loop in their own applications, write extensions in Go, or use `go install` for a zero-dependency install path that fits naturally into a Go-first environment.

Your team works exclusively in TypeScript or Python and has no Go codebase. The Go SDK is the differentiating value here; if you do not need it, the upstream Pi or Claude Code is a simpler starting point.

Teams on resource-constrained or Node-free servers

PiG's single binary runs on Linux with no Node.js, no npm, and no runtime installation. This makes it practical on minimal VMs, CI runners, and containers where keeping the dependency footprint small matters.

You already have Node.js installed and your team does not maintain lean Linux environments. The Node.js dependency is not a real friction point in that context.

Extension authors writing Go or Rust extensions

Pi's extension ecosystem is TypeScript-only. PiG adds Go, Rust, and Python extension SDKs, so teams who prefer compiled languages can write and distribute PiG extensions without a TypeScript toolchain.

Your extension needs are already covered by TypeScript. PiG passes Pi's TypeScript extension API through unchanged, so existing Pi extensions run on PiG without modification.

Platform teams building custom agent pipelines

The RPC mode (JSON over stdin/stdout) and the Go SDK make PiG composable in larger pipelines. Piglets let you assemble named agent configurations from extensions, skills, and prompts, then distribute them as standalone binaries or share them as YAML definitions.

You need a fully managed, subscription-based coding assistant with no infrastructure ownership. PiG requires you to manage your own API keys and optionally your own server.

The problem

Terminal coding agents like Claude Code tie developers to a single vendor's API and require a Node.js runtime to run locally. For teams on Go-first infrastructure, minimal Linux servers, or CI environments, adding Node.js as a system dependency introduces friction, creating version conflicts, startup overhead, and an extra runtime to install and patch on every machine. The deeper pain is provider lock-in. When a vendor changes pricing, deprecates a model, or experiences an outage, teams with a single-provider agent have no local fallback. Running multiple agents to cover different providers means learning different tool interfaces and maintaining separate configuration files.

How it works

Single Go binary, no Node.js runtime

PiG compiles to one statically-linked `pig` executable for macOS, Linux, and Windows. There is no Node.js runtime requirement. The binary is available via curl, npm (as a platform-specific optional dependency), PowerShell, `go install`, or a GitHub Releases download. Startup is native Go speed.

15+ AI providers with mid-session model switching

PiG ships with built-in support for Anthropic, OpenAI, Google, Azure, Bedrock, Mistral, Groq, Cerebras, xAI, Ollama, and more. Switch models mid-session with `/model` or cycle through scoped models with Ctrl+P. API key and OAuth authentication both work.

Go, Rust, Python, and Node extension system

Extensions register tools, commands, event handlers, flags, providers, and UI contributions through a public Go API. Node extensions use Pi's TypeScript extension API unchanged. Bundle extensions, skills, and prompts into a named Piglet for a shareable agent application, or build one as its own executable.

Tree-structured sessions with branching

Sessions are stored as trees. `/tree` lets you navigate to any previous turn and branch from there; all branches live in one file. Filter by message type, bookmark entries, export to HTML with `/export`, or share a branch as a GitHub gist with `/share`.

Four execution modes: TUI, print, RPC, and Go SDK

Run PiG as an interactive TUI, use print or JSON mode for one-shot scripts, connect over an RPC protocol (JSON over stdin/stdout) for process-based integrations, or embed the agent in Go applications through the Go SDK.

Features

  • Single Go binary, no Node.js runtime
  • 15+ AI providers with mid-session model switching
  • Go, Rust, Python, and Node extension system
  • Tree-structured sessions with branching
  • Four execution modes: TUI, print, RPC, and Go SDK

How to install

Install PiG as a single native binary using the platform install script, npm, or Go.

# macOS / Linux
curl -fsSL https://pi-in-go.dev/install.sh | sh

# npm (any platform)
npm install -g @pi-in-go/pig

# Go
go install github.com/MichaelKinsy/PiG/cmd/pig@latest

Recommended for this setup

Strengths

  • MIT license with provider freedom: PiG is MIT licensed, so you can run it commercially, modify it, and embed it in Go applications without licensing restrictions. Unlike Claude Code, which is tied to Anthropic's API, PiG works with any of its 15+ supported providers, including a local Ollama instance for fully offline or air-gapped use.
  • Upstream Pi parity with verified evidence: PiG does not rewrite Pi's behavior; it ports and verifies the port. Core paths are checked against Pi 0.87.1 with paired parity scenarios. Every intentional divergence is documented in `DIVERGENCES.md`. Projects and extensions that work on Pi carry over with no rework.
  • Go SDK for embedding in applications: PiG's public `coding` and `agent` packages let you embed the agent loop, extension contracts, and Piglet composition into your own Go applications. Terminal-only coding agents have no embeddable library path; PiG is also a library.
  • OpenSSF-graded supply-chain practices: The project carries OpenSSF Scorecard and OpenSSF Best Practices badges, passes CodeQL security analysis, is REUSE-compliant for license attribution, and ships artifact-specific SBOMs with each release. The install script verifies each download against SHA256 checksums before installing.

Trade-offs

  • Pre-stable 0.x with edge cases still hardening: PiG is a 0.x release. The README states: "Core paths are ported and checked against Pi 0.87.1 with paired parity scenarios; edge cases are still hardening." For teams that need production-grade stability today, the upstream Pi or a managed coding agent service is a lower-risk choice.
  • Windows support is a preview: PiG's Windows release is labeled a preview. The repository states: "Do not treat a platform as release-supported until its native release verification passes." Windows users may encounter behavioral gaps not present on macOS or Linux.
  • Parity scope excludes some Pi packages: PiG does not implement Pi's experimental remote Session packages or standalone telemetry and evaluation packages. If your workflow depends on those Pi features, PiG does not yet cover them.

Tech stack

Languages
Go, JavaScript, Python, TypeScript, Rust, Common Lisp, Shell, Makefile, CSS, Go Template, Dockerfile, C, Nix, PowerShell, HTML, Assembly
Frameworks
—
Databases
—
Tooling
—

FAQ

Is PiG compatible with Claude Code extensions or Pi extensions?

PiG does not run Claude Code extensions. It does run Pi's TypeScript extensions unchanged, because PiG ships compatible runtime modules for Pi's TypeScript extension API. If you have existing Pi extensions, they work on PiG without modification. PiG also supports native Go, Rust, and Python extensions through its own extension SDK.

Does PiG require an Anthropic API key?

No. PiG supports 15+ providers including OpenAI, Google, Azure, Mistral, Groq, and a local Ollama instance. You provide API keys for the providers you choose. Run `/login` on first launch to configure a provider; no specific key is required to install the binary.

Is PiG ready for production use?

PiG is a pre-stable 0.x release. Core agent paths are ported and verified against Pi 0.87.1, but the README notes edge cases are still hardening. It is suitable for development and exploration today; teams with strict reliability requirements should review the port status at `test/parity/coverage.md` before committing to production use.

Can I run PiG on an air-gapped machine?

Yes, with a local model provider. PiG supports Ollama, which runs models locally. Configure an Ollama endpoint as your provider and PiG routes requests to it with no external API calls. The binary itself is statically compiled and requires no internet connection after install.

What is the relationship between PiG and upstream Pi?

Pi is the reference implementation and remains the authoritative project. PiG follows Pi's behavior and design, tracking the pinned Pi 0.87.1 release. The PiG maintainers do not speak for the Pi project, and the Pi maintainers do not endorse PiG. If PiG behaves differently from Pi, that is either a bug or a documented intentional divergence.

Similar tools

More in Engineers