Spaces:
Configuration error
Configuration error
Add Pi coding agent doc
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960# Pi Coding Agent (pi.dev) — integration
Pi is a **minimal, vendor-neutral coding-agent harness** (MIT, TypeScript). It isnot a model and not a sealed product: it provides the agent loop, a small auditabletool surface (`read`, `write`, `edit`, `bash` + read-only `grep`/`find`/`ls`), atree-structured session model, a provider abstraction (15+ providers), and aTypeScript extension system. You adapt Pi to your workflow — not the reverse.
- Official site: https://pi.dev- Docs: https://pi.dev/docs/latest- Source/monorepo: https://github.com/earendil-works/pi- npm registry/docs: https://docs.npmjs.com (Pi ships as an npm package)
## Install
```bashnpm install -g --ignore-scripts @earendil-works/pi-coding-agent# or: curl -fsSL https://pi.dev/install.sh | sh (PowerShell: pi.dev/install.ps1)```
`--ignore-scripts` is recommended: Pi needs no lifecycle install scripts.
## Authentication
- Subscription providers: `/login` (Claude Pro/Max, ChatGPT Plus/Pro Codex, GitHub Copilot).- API-key providers: env vars (e.g. the ones in `.env.example` — `GROQ_API_KEY`, `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GOOGLE_API_KEY`, `HF_TOKEN`, ...) or the auth file.- Switch models mid-session: `/model` or `Ctrl+L`; cycle favorites `Ctrl+P`.- Custom/private endpoints: add entries to `models.json` or a provider extension — point **Ollama / vLLM** at your own cluster in `90-execution/distributed-inference/` so source code never leaves your boundary (relevant for regulated workloads).
## Four modes
| Mode | Use ||---|---|| `pi` (interactive TUI) | day-to-day coding, `/tree`, `/export`, `/share` || `pi -p` / JSON (print mode) | scripting; structured event stream || RPC mode | integrate over stdin/stdout JSONL || SDK mode | embed `pi` runtime in a Node/TypeScript app (`@earendil-works/pi-agent-core`) |
## Integration with this toolbox
- **Package registry**: `@earendil-works/pi-*` are tracked in `registry/packages.yaml`; `@earendil-works/pi-ai` can drive the same router fallback chain as our `runtime/orchestrator.py` (OpenAI-compatible calls, incl. Gemini via its compat base).- **MCP is opt-in in Pi**: Pi explicitly ships *without* built-in MCP. Register MCP tools through a TypeScript extension — see `agents/pi-mcp-extension.ts` — then all servers in `mcp/servers/` become callable from Pi.- **Context engineering**: drop project instructions in `AGENTS.md` / `SYSTEM.md`; skills load on demand; compaction keeps the window small.- **Telemetry**: set `PI_TELEMETRY=0` to disable install telemetry.
## Security notes
- Runs as your user with `read/write/edit/bash` in the current directory — run it in the repo you intend, use git/tmux/containers as a blast-radius boundary.- For CMMC/HIPAA/ITAR-style environments, prefer a **self-hosted** model endpoint and document the data-flow (prompts/tool outputs only leave to the provider you choose).- Pin the package version; audit the (small) dependency tree; see project trust docs.agents/pi.mdAdded+60