PI.DEV · AGENT HARNESS Cheatsheet · The Whole Book on One Page Contents Cheatsheet

Quick Reference

Pi on One Page

What Pi is

An open-source, minimal AI agent harness you reshape around your workflow (Mario Zechner / earendil-works). github.com/earendil-works/pi. Not a platform — a toolkit that gets out of your way.

The packages

@earendil-works/pi-aiUnified multi-provider LLM API (OpenAI, Anthropic, Google…)
…/pi-agent-coreAgent runtime: the loop, tool calling, state
…/pi-coding-agentInteractive coding-agent CLI
…/pi-tuiTerminal UI, differential rendering

The 4 core tools

Read · Write · Edit · Bash. The entire default toolset — deliberately minimal. Everything else you add via extensions.

The 4 run modes → 4 product shapes

InteractiveHuman at a terminal — the cockpit
Print / JSONHeadless, scriptable — batch, farms, CI
RPCDrive it from another process
SDKEmbed the loop in your own app

What extensions can do (TypeScript, full system access)

  • Add custom tools · register commands + keyboard shortcuts
  • Handle events + inject UI · inject messages before each turn · filter history
  • RAG / custom retrieval · long-term memory · spawn sub-agents
  • Permission gates · SSH execution · MCP integration · custom editors

Bundled as Pi Packages — 4 layers: extensions · skills · prompt templates · themes. Distributed via npm or git.

Install & auth (BYOK)

shell# install (blocks install-time scripts)
npm install -g --ignore-scripts @earendil-works/pi-coding-agent

# auth — bring your own key
export ANTHROPIC_API_KEY=
export OPENAI_API_KEY=
export GEMINI_API_KEY=
# …or /login for Claude Pro/Max, ChatGPT Plus/Pro, GitHub Copilot

BYOK = your keys, your account, your data path. earendil-works is never in the loop.

Trust & sandboxing (read before shipping)

No built-in permissions Pi does not restrict filesystem / process / network / credential access. You build the guardrails.

  • Sandbox: Gondolin extension · Docker · OpenShell
  • Gate every write; audit every call; scope the data.
  • Supply-chain: pinned deps · npm shrinkwrap · --ignore-scripts

The Opportunity Lens (5 questions)

Point at any vertical; each "yes" maps to a Pi capability. Three-plus yeses + high stakes = an opening.

Custom tools?Extension adds a tool
Private data?RAG / retrieval extension
Memory?Long-term memory extension
Guardrails?Permission gates + audit
Where it runs?Modes + containerization

Opportunity checklist by domain

DomainLead playKey Pi lever
FinanceResearch copilot · overnight reconciliation · audit-native assistantCustom tools + RAG + gates, BYOK data room
HealthcarePrior-auth & clinical-ops copilotsOn-prem + BYOK, RAG, write-gated
LawMatter memory · batch contract reviewLong-term memory + RAG + print/JSON
Industry / edgeRunbook operator · field-service brainSSH execution + RPC, hard interlocks
StudioPipeline conductor · render-farm workerCustom tools + print/JSON + themes
Ship a verticalPackage it or embed itPi Packages (npm/git) or SDK/RPC; BYOK economics

The moat, in one line

Not the model — your tools + your data + your workflow, welded by a harness. A smarter base model makes your product better, not obsolete. Specificity is the defense.

Sources pi.dev/docs/latest · github.com/earendil-works/pi. Facts about tools, modes, packages, auth, and security posture are from Pi's documentation; the domain plays and framing are the author's.

⌂ Library