Pi cheat sheet
Every command, flag and slash command for pi — A minimal, extensible terminal coding agent — four tools by default (read / write / edit / bash), extended via skills + packages. 13+ commands, verified July 2026.
Pi deliberately ships no MCP, sub-agents or plan mode out of the box — everything is added through extensions, skills and "pi packages".
npm install -g --ignore-scripts @earendil-works/pi-coding-agent
curl -fsSL https://pi.dev/install.sh | sh
pi # interactive TUI
pi "List all .ts files in src/" # interactive with an initial prompt
pi -p "Summarize this codebase" # headless: print and exit
export ANTHROPIC_API_KEY=sk-… ; pi # or /login for a subscription
pi @code.ts @test.ts "Review these" # attach files with @
Key flags
| Flag | What it does |
|---|---|
-p, --print | Headless: print and exit (also reads piped stdin) |
--mode json / --mode rpc | JSON event stream / RPC over stdio |
--model <pattern> | e.g. sonnet:high, openai/gpt-4o |
--thinking <level> | off … max |
-c, --continue / -r, --resume | Continue / browse sessions |
--tools <list> / --no-tools | Allowlist / disable tools |
-e, --extension <src> / --skill <path> | Load an extension / skill |
--no-session | Ephemeral (don't save) |
In-session commands
| Command | What it does |
|---|---|
/login · /model | Auth · switch models |
/resume · /new · /compact | Sessions · new · compact context |
/tree · /fork · /clone | Session tree · fork · duplicate |
/export · /copy · /share | Export HTML/JSONL · copy · gist |
!cmd · @ | Run a shell command into the model · fuzzy-find files |
~/.pi/agent/settings.json · .pi/settings.json # global / project
~/.pi/agent/AGENTS.md # context (also AGENTS.md / CLAUDE.md in cwd + parents)
~/.pi/agent/sessions/ # auto-saved JSONL sessions
export ANTHROPIC_API_KEY=… # any provider env var, or /login for a subscription
cat README.md | pi -p "Summarize this text"
pi --tools read,grep,find,ls -p "Review the code for bugs" # read-only review
pi --model openai/gpt-4o --thinking high "Refactor the auth module"
pi -c "Add error handling to the change we just made"
More CLI cheat sheets
Stop memorizing flags
Run Pi — and every other agent — from one app
TheVibeFather orchestrates Pi alongside every other coding CLI in one native macOS app. Bring the models you already pay for; keep your keys.
Claude Code
Gemini CLI
Aider
Goose
Qwen Code
Crush
Grok CLI
OpenHands CLI
Cline CLI
Roo Code CLI
Continue CLI