For a first session that ends in a review
An open-source setup for the Pi coding agent, from install to review
The open-source CompanyOS
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.
Its own isolated machine per session · Every new session runs pi · A change request a person merges
curl -fsSL https://pi.dev/install.sh | shcd /path/to/folderpi/loginpi --versionPer-resource permissions for people and agents. Roles, groups, and an audit trail.
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.
curl -fsSL https://pi.dev/install.sh | shWindows takes its own line:
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:
npm install -g --ignore-scripts @earendil-works/pi-coding-agentOn 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).
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:
pi --versionThe 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.
cd /path/to/folderpi/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).
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).
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 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). 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), 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:
permission: bash: "*": allow "git push *": ask "rm -rf *": deny edit: "*": allow "secrets/*": deny external_directory: deny webfetch: askThe most specific matching rule wins, and for bash globs the strictest answer wins: deny, then ask, then allow (Read the docs). 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). 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 is the comparison that matters. The whole sequence, from the first prompt to the merge, is in Read the docs.
A setup checklist
Seven boxes to tick, as of 8 November 2026.
pi --versionprints a version, so the install finished rather than half-finished.- A model answers, and
/modellists what your account can reach: a subscription, a key or a local model. AGENTS.mdin 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
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.
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.
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.
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.