Refresh every reference against https://pi.dev/docs/latest and the four ecosystem package pages, cross-checked with the published npm READMEs. New reference pages (docs added them; the site nav does not surface them): - environment-variables.md: PI_* process config, the PI_CODING_AGENT child marker, and the session variables injected into the bash tool. The old env-var list lived in usage.md, which no longer has that section. - llama-cpp.md: llama.cpp router setup, /login llama.cpp, /llama. Notable upstream drift now reflected: - SDK: ModelRuntime.create() replaces AuthStorage + ModelRegistry; createAgentSessionServices/FromServices runtime factory; resolveCliModel and resolveModelScopeWithDiagnostics. - Providers: full 30+ API-key table with env vars and auth.json keys; xAI/OpenRouter/Radius subscription logins; provider-scoped env blocks in credentials; models-store.json; Bedrock proxy variables. - New thinking level "max" across settings, CLI, RPC, thinkingLevelMap, and the themes' thinkingMax token. - New commands: /trust, /import, /llama; pi update --all/--models/--self; pi config; .pi/SYSTEM.md and APPEND_SYSTEM.md; trust.json. - RPC: get_entries (with since cursor), get_tree, get_available_thinking_levels, agent_settled, bash_execution_update, summarization_retry_*, and the extension UI sub-protocol. - Extensions: expanded from a summary to the real API surface, including session-replacement semantics and footguns, withFileMutationQueue, terminate, prepareArguments, and dynamic tool loading. - Session format: retainedTail checkpoints and buildContextEntries(). - Packages: pi-web-access gained source_check and nine search providers and dropped code_search, which the old reference still documented; pi-mcp-adapter gained six config locations, lazy-keep-alive, the output guard, and MCP_STATUS_EVENT; pi-subagents gained the watchdog, profiles, modelScope, per-agent memory, the fleet inspector, and RPC v1. Also fixes escape sequences that had been corrupted in earlier versions: the Git Bash path in windows.md, the shellCommandPrefix JSON in shell-aliases.md, and the CSI-u sequences in tmux.md and terminal-setup.md. Bumps metadata.version to 1.2.
2.4 KiB
Quickstart
Source: https://pi.dev/docs/latest/quickstart
Install and Uninstall
npm install -g --ignore-scripts @earendil-works/pi-coding-agent
--ignore-scripts disables dependency lifecycle scripts. Pi does not need install scripts for normal npm installs.
Uninstall with the package manager that installed Pi. The curl installer uses global npm, so curl and npm installs both remove with npm:
npm uninstall -g @earendil-works/pi-coding-agent
pnpm remove -g @earendil-works/pi-coding-agent
yarn global remove @earendil-works/pi-coding-agent
bun uninstall -g @earendil-works/pi-coding-agent
Uninstalling Pi leaves settings, credentials, sessions, and installed packages in ~/.pi/agent/.
Authenticate
Use /login in interactive mode for subscription providers; built-in subscription logins include Claude Pro/Max, ChatGPT Plus/Pro (Codex), and GitHub Copilot. API-key providers can be configured by environment variable or stored through /login in ~/.pi/agent/auth.json.
export ANTHROPIC_API_KEY=sk-ant-...
pi
See references/providers.md for the full provider list.
First Session
cd /path/to/project
pi
By default the model gets four tools: read, write (create/overwrite), edit (patch), and bash. Read-only built-ins grep, find, and ls are available through tool options. Pi works in the current directory and can modify files there — use git or another checkpointing workflow for rollback.
Project Instructions
Pi loads context files at startup:
~/.pi/agent/AGENTS.mdAGENTS.mdorCLAUDE.mdfrom parent directories and the current directory
Run /reload or restart after changing context files.
Common First Tasks
pi @README.md "Summarize this"
pi @src/app.ts @src/app.test.ts "Review these together"
!npm run lint
!!npm run lint
pi -c
pi -r
pi --name "my task"
pi --session <path|id>
pi -p "Summarize this codebase"
cat README.md | pi -p "Summarize this text"
pi -p @screenshot.png "What's in this image?"
pi --mode json "List files"
pi --mode rpc --no-session
Use !command to run shell and send output to the model; !!command runs without adding output to model context. Paste text or images with Ctrl+V (Alt+V on Windows), or drag images into supported terminals.
Switch models with /model or Ctrl+L, cycle thinking level with Shift+Tab, and cycle scoped models with Ctrl+P / Shift+Ctrl+P.