Quickstart
This page gets you from install to a useful first pi session.
Install
Section titled “Install”Pi is distributed as an npm package:
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.
Uninstall
Section titled “Uninstall”Use the package manager that installed pi. The curl installer uses npm globally, so curl and npm installs are removed with npm:
# curl installer or npm install -gnpm uninstall -g @earendil-works/pi-coding-agent
# pnpmpnpm remove -g @earendil-works/pi-coding-agent
# Yarnyarn global remove @earendil-works/pi-coding-agent
# Bunbun uninstall -g @earendil-works/pi-coding-agentUninstalling pi leaves settings, credentials, sessions, and installed pi packages in ~/.pi/agent/.
Then start pi in the project directory you want it to work on:
cd /path/to/projectpiAuthenticate
Section titled “Authenticate”Pi can use subscription providers through /login, or API-key providers through environment variables or the auth file.
Option 1: subscription login
Section titled “Option 1: subscription login”Start pi and run:
/loginThen select a provider. Built-in subscription logins include Claude Pro/Max, ChatGPT Plus/Pro (Codex), and GitHub Copilot.
Option 2: API key
Section titled “Option 2: API key”Set an API key before launching pi:
export ANTHROPIC_API_KEY=sk-ant-...piYou can also run /login and select an API-key provider to store the key in ~/.pi/agent/auth.json.
See Providers for all supported providers, environment variables, and cloud-provider setup.
First session
Section titled “First session”Once pi starts, type a request and press Enter:
Summarize this repository and tell me how to run its checks.By default, pi gives the model four tools:
read- read fileswrite- create or overwrite filesedit- patch filesbash- run shell commands
Additional built-in read-only tools (grep, find, ls) are available through tool options. Pi runs in your current working directory and can modify files there. Use git or another checkpointing workflow if you want easy rollback.
Give pi project instructions
Section titled “Give pi project instructions”Pi loads context files at startup. Add an AGENTS.md file to tell it how to work in a project:
# Project Instructions
- Run `npm run check` after code changes.- Do not run production migrations locally.- Keep responses concise.Pi loads:
~/.pi/agent/AGENTS.mdfor global instructionsAGENTS.mdorCLAUDE.mdfrom parent directories and the current directory
Restart pi, or run /reload, after changing context files.
Common things to try
Section titled “Common things to try”Reference files
Section titled “Reference files”Type @ in the editor to fuzzy-search files, or pass files on the command line:
pi @README.md "Summarize this"pi @src/app.ts @src/app.test.ts "Review these together"Images can be pasted with Ctrl+V (Alt+V on Windows) or dragged into supported terminals.
Run shell commands
Section titled “Run shell commands”In interactive mode:
!npm run lintThe command output is sent to the model. Use !!command to run a command without adding its output to the model context.
Switch models
Section titled “Switch models”Use /model or Ctrl+L to choose a model. Use Shift+Tab to cycle thinking level. Use Ctrl+P / Shift+Ctrl+P to cycle through scoped models.
Continue later
Section titled “Continue later”Sessions are saved automatically:
pi -c # Continue most recent sessionpi -r # Browse previous sessionspi --name "my task" # Set session display name at startuppi --session <path|id> # Open a specific sessionInside pi, use /resume, /new, /tree, /fork, and /clone to manage sessions.
Non-interactive mode
Section titled “Non-interactive mode”For one-shot prompts:
pi -p "Summarize this codebase"cat README.md | pi -p "Summarize this text"pi -p @screenshot.png "What's in this image?"Use --mode json for JSON event output or --mode rpc for process integration.
Next steps
Section titled “Next steps”- Using Pi - interactive mode, slash commands, sessions, context files, and CLI reference.
- Providers - authentication and model setup.
- Settings - global and project configuration.
- Keybindings - shortcuts and customization.
- Pi Packages - install shared extensions, skills, prompts, and themes.
Platform notes: Windows, Termux, tmux, Terminal setup, Shell aliases.