Skip to content

Installing Pi

Pi is a terminal coding agent. You install it once globally, authenticate a model provider, then run pi inside any project.

The recommended install uses npm with lifecycle scripts disabled:

Terminal window
npm install -g --ignore-scripts @earendil-works/pi-coding-agent

--ignore-scripts disables dependency lifecycle scripts during install. Pi does not require install scripts for normal npm installs.

There is also a one-line installer:

Terminal window
curl -fsSL https://pi.dev/install.sh | sh

Pi supports 15+ providers and hundreds of models. Two ways to authenticate:

API key — export the relevant variable, then run pi:

Terminal window
export ANTHROPIC_API_KEY=sk-ant-...
pi

Subscription (OAuth) — start Pi and log in interactively:

Terminal window
pi
/login # then select your provider

Subscriptions include Anthropic Claude Pro/Max, OpenAI ChatGPT Plus/Pro (Codex), and GitHub Copilot. API-key providers include Anthropic, OpenAI, Azure OpenAI, Google Gemini/Vertex, Amazon Bedrock, Mistral, Groq, Cerebras, xAI, OpenRouter, Hugging Face, Together AI, and many more.

Switch models mid-session with /model (or Ctrl+L), and cycle favourites with Ctrl+P.

Just talk to Pi. Out of the box the model has four tools: read, write, edit, and bash. Everything else — sub-agents, plan mode, web search, MCP — is added through the extensions and skills documented in this guide.

Terminal window
cd my-project
pi

Useful first commands:

CommandWhat it does
/modelSwitch the active model
/settingsThinking level, theme, message delivery
/reloadReload extensions, skills, prompts, themes, context files
/hotkeysList all keyboard shortcuts
/shareUpload the session as a shareable HTML gist

Pi loads AGENTS.md (or CLAUDE.md) at startup from ~/.pi/agent/, parent directories, and the current directory — use it for project conventions and common commands. You can also replace the system prompt per-project with .pi/SYSTEM.md.

Head to Installing packages to learn how to add capabilities with pi install.