pi-mono/packages/coding-agent/docs/quickstart.md

2.3 KiB

Quickstart

This gets Pi installed and working on a real project.

Install

Pi requires Node.js 22.19 or newer. Install it from npm:

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

Pi doesn't need dependency lifecycle scripts. On Linux and macOS, you can use the installer instead:

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

Run Pi

Go to the project you want to work on and start Pi:

cd /path/to/project
pi

The directory matters. Pi uses it to find project files and configuration, and to group saved sessions.

Run /login, choose a provider, and follow its authentication flow. If you prefer an API key, set it before starting Pi:

export ANTHROPIC_API_KEY=sk-ant-...
pi

See Providers for other providers and authentication methods.

Run a task

A useful first request is:

Explain how this repository is structured and how to run its checks.

As the model works, Pi shows every tool call and result. The default tools let it read and change files and run shell commands. Everything becomes part of the session.

Pi doesn't ask before every tool call. Use version control and review what changed. For untrusted work, run Pi in a container or another sandbox. See Security.

Add project instructions

Most projects have commands and rules that the model can't infer reliably. Put them in an AGENTS.md file:

# Project instructions

- Run `npm run check` after changing code.
- Do not run production migrations.

Pi reads global and project context files when it starts. If you change them during a session, run /reload.

Continue later

Pi saves sessions automatically. To continue the most recent one, run:

pi --continue

Use /resume to choose another session. Use /tree to return to an earlier point without losing the work that followed it. The Sessions guide explains both.

Read How Pi Works for a deeper explanation and Using Pi for the interactive controls.

Uninstall

Use the package manager that installed Pi. The installer above uses npm:

npm uninstall -g @earendil-works/pi-coding-agent

This leaves your configuration, credentials, sessions, and installed Pi packages in ~/.pi/agent/.