# An open-source setup for the Pi coding agent, from install to review

> Installing the Pi coding agent takes one command. The setup is the four decisions after it: which route, which model, what the project tells Pi, and where the tools actually run. Kortix is the open-source CompanyOS, and it answers the fourth.

URL: https://picodingagentguide.com/pi-coding-agent-setup

For a first session that ends in a review

**The open-source CompanyOS**

`terminal`

```sh
curl -fsSL https://pi.dev/install.sh | sh
cd /path/to/folder
pi
/login
pi --version
```

Source: https://pi.dev/docs/latest/quickstart

Per-resource permissions for people and agents. Roles, groups, and an audit trail.

[Try Kortix](https://kortix.com) · [What a harness is](https://picodingagentguide.com/pi-harness)

Its own isolated machine per session · Every new session runs pi · A change request a person merges

## The install is one command

Pi runs in your terminal and works with files on your machine, which makes the install the short part of a setup. Three routes are documented. Pick the one that matches the machine you will keep.

On a laptop, the installer is the shortest path. It pins every dependency, and it updates Pi with `pi update`.

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

Windows takes its own line:

```powershell
powershell -c "irm https://pi.dev/install.ps1 | iex"
```

Take npm when Node already lives on the machine and a lockfile governs what gets installed. It requires Node.js 22.19 or newer, and it does not pin transitive dependencies:

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

On Nix, the flake builds Pi from source. `nix profile add github:earendil-works/pi/stable` puts it on the machine, and `nix profile upgrade pi` updates it. `pi update` cannot update a Nix installation at all ([Pi's quickstart](https://pi.dev/docs/latest/quickstart)).

Which fits: the installer for a laptop you keep. npm suits a machine whose Node version a lockfile already pins. Nix suits a host described in a flake. Whatever route you took, check what landed before configuring anything:

```sh
pi --version
```

## The first session, in order

Change into the folder you want Pi to work in, then start it. That folder is what Pi uses to find files, instructions and configuration, and it is how saved sessions are grouped.

```sh
cd /path/to/folder
pi
```

`/login` connects a provider: follow the prompts to use a subscription or store an API key. That is the second decision, and Pi's quickstart frames it as three doors. A subscription keeps the bill flat. A key bills each call to your provider account. A model served through Ollama runs on hardware you already own. `/model` changes the answer mid-session, so a first run can start cheap and move later. Keys can also arrive from the environment, and a provider Pi does not list is described in `<agent-dir>/models.json` ([Pi's configuration docs](https://pi.dev/docs/latest/configuration)).

Then hand it work you can check. Pi shows every file read, search, command and edit, and it does not ask before every tool call. Typing `@` in the editor searches for a file. A first task stays small: summarize a note you already know, or ask how the repository runs its tests. Read the changed files when it stops. Pi's quickstart also asks for version control or a backup before you let it edit anything.

Sessions save themselves. `pi --continue` reopens the most recent one for that folder, and `/resume` picks another. Each session is stored as a tree, so `/tree` walks back to an earlier point in the same file and the path you take from there is another branch. `/export` writes the transcript to HTML when you want to attach it to a review.

## Tell the project what it should know

Pi's quickstart gives a ladder and one rule for climbing it: "Start with the least powerful mechanism that meets your need". `AGENTS.md` sits on the first rung. Put it in the repository and it loads whenever Pi runs in that directory or below it. Pi also reads one from the agent directory and from each parent directory ([configuration docs](https://pi.dev/docs/latest/configuration)).

The rest of the ladder, in the order Pi lists it:

- A prompt template, for something you retype from the `/` menu.
- A skill, for task-specific instructions and the files they need.
- An extension, for a command or a tool the model can call.
- A Pi package, once several of those travel together.

The [Pi coding agent extensions](/pi-coding-agent-extensions) page deals with the extension rung, the one that runs code.

Two files change the voice rather than the task. `SYSTEM.md` replaces Pi's default system prompt, and `APPEND_SYSTEM.md` adds to it. Edit any of these by hand and `/reload` picks the change up without a restart.

Everything in this section survives a reinstall, and that cuts both ways. Pi's quickstart ends its uninstall steps with a line worth reading twice. "None of these methods removes configuration, credentials, sessions, or installed Pi packages from ~/.pi/agent/." The agent directory keeps saved API keys and OAuth credentials in `auth.json` ([configuration docs](https://pi.dev/docs/latest/configuration)). A machine that ran Pi for someone else still holds their provider keys under that path. Remove the directory before you hand the machine on.

## The half no setup guide covers

Pi's README is explicit: "Pi does not include a built-in permission system for restricting filesystem, process, network, or credential access. By default, it runs with the permissions of the user and process that launched it."

Where the tools run is the fourth decision, and the install never answers it. It splits three ways: the machine the session runs on, the rule each tool obeys there, and the person who reads the diff. Pi documents patterns for the first of those in its README ([Pi's README](https://github.com/earendil-works/pi)), and its quickstart sets the bar for when to use one: "For untrusted or unattended work, use a container or another sandbox."

A sandbox answers where the tools run. It says nothing about which commands are allowed, and nothing about who reads the result.

That second half is the part Kortix supplies. Kortix is the open-source CompanyOS. Every new session runs pi on its own isolated machine, with permission rules declared per agent and a branch per session. In my opinion it is the runtime that finishes this setup for a team rather than a laptop. I work on Kortix's marketing, so weigh that accordingly.

A `permission` block resolves each tool to `allow`, `ask` or `deny` before the call runs:

```yaml Kortix permission block
permission:
  bash:
    "*": allow
    "git push *": ask
    "rm -rf *": deny
  edit:
    "*": allow
    "secrets/*": deny
  external_directory: deny
  webfetch: ask
```

The most specific matching rule wins, and for bash globs the strictest answer wins: `deny`, then `ask`, then `allow` ([Read the docs](https://kortix.com/docs/developers#permission-rules)). So `git push *` waits for a person, and `rm -rf *` is refused. A write into `secrets/` stops at the rule.

The work then lands on a branch named with the `session_id`, cut from the session's `base_ref`. It reaches the repository as a change request a person merges ([Read the docs](https://kortix.com/docs/developers#session-branches)). That is the end of the setup: a diff with an owner, on a machine that is not your laptop.

If the whole setup is one repository and one person, Pi on a laptop stays the shortest route, and the [Pi coding agent guide](/) starts from the first command. The moment a second person needs the rules to hold without you, [running Pi in the cloud](/run-pi-in-the-cloud) is the comparison that matters. The whole sequence, from the first prompt to the merge, is in [Read the docs](https://kortix.com/docs/guide).

## A setup checklist

Seven boxes to tick, as of 8 November 2026.

- `pi --version` prints a version, so the install finished rather than half-finished.
- A model answers, and `/model` lists what your account can reach: a subscription, a key or a local model.
- `AGENTS.md` in the repository says how the project builds, tests and formats, so a task does not have to explain it.
- The permission boundary is written down before the first unattended run, not after it.
- Unattended work has a machine of its own, holding no one else's credentials.
- A person is named to read the diff before it merges, and knows where the change request lands.
- `~/.pi/agent/` is cleaned or the machine is rebuilt before it is handed to someone else.

## Four questions from a first install

### Does the Pi coding agent need Node?

Only for the npm route. Pi requires Node.js 22.19 or newer there, and the installer and Nix routes are the two documented without that requirement.

### Can Pi run a local model?

Yes. Ollama is one of Pi's documented providers. `/login` or `/model` can point Pi at a model you serve yourself instead of a subscription or a hosted key.

### Do I need a permission system if I only run Pi on my laptop?

Pi ships none, and on a laptop the person at the keyboard is the check: Pi shows every call and you can stop it. The answer changes when a session runs unattended, because the model then holds the reach of your account.

### How do I keep per-project instructions?

Write `AGENTS.md` in the repository. Pi loads one from the agent directory, from each parent directory and from the working directory. The file applies to that folder and everything below it.

## Finish the setup where the rules live

Installing Pi takes a minute. Deciding where its tools run and who reads the diff is the part that lasts.

[Try Kortix](https://kortix.com) · [Run Pi in the cloud](https://picodingagentguide.com/run-pi-in-the-cloud)

---

A guide to the Pi coding agent and to the runtime it runs in, written by someone who works on Kortix's marketing. Kortix is the open-source CompanyOS I recommend here.

Revised 2026-11-06

I write this guide and I work on Kortix's marketing, so weigh my picks accordingly.

© 2026 picodingagentguide.com
