Skip to main content
The Pi logo mark and wordmark inside the boxd card. Pi is a terminal coding agent with a small core and an extension API. Extensions ship as npm packages and are listed in the Pi package gallery. The boxd extension, @boxd-sh/pi, runs Pi’s bash, read, write, edit, ls, find, and grep tools in a boxd machine. The agent, its model calls, and your model key stay on your computer. Each Pi session gets its own machine, which keeps its files and running processes with the session.

Set up

1

Install Pi and the extension

2

Create an API key

Machines are created and billed in the key’s organization.
3

Start Pi with --boxd

In a git checkout:
The extension creates a machine, clones the checkout’s origin at your current branch into /home/boxd/<repo>, and points every tool there. The footer shows the machine:
Only what is pushed to origin reaches the machine. Without --boxd, the extension does nothing and Pi’s own tools run as usual.

Try it with one prompt

This runs one prompt in a fresh machine and deletes the machine when Pi exits:

Quit, resume, and fork

A saved Pi session keeps its machine. When you quit, the machine hibernates with its memory, so a server the agent started is still running when you come back.
Pi has exited and the machine is hibernated. Opening the preview URL wakes it, and the page loads. Resume the session and the agent finds the same server:
Forking the session, with /fork in Pi or pi --fork <session>, forks the machine too, running processes included. The fork gets its own machine and the parent’s machine hibernates:
So you can set a project up once, fork the session twice, and let two agents try two approaches, each in its own copy of the machine.

Commands

The agent also gets a preview_url tool, so it can hand you a link to a server it started. Anyone with the link can open it, and the first link on a machine can take up to a minute before HTTPS answers.

Flags and environment

BOXD_ORG and BOXD_REGION set the defaults for --boxd-org and --boxd-region. BOXD_PI_NAME_PREFIX changes the machine name prefix, pi- by default.

What each machine gets

  • Isolation: every machine is isolated. Your boxd API key never enters it, and of your shell environment only Pi’s PI_* variables go with a command.
  • A full computer: Ubuntu 24.04 with Docker, Node.js, Python, Go, and passwordless sudo. A command that leaves a process in the background, like npm run dev &, returns, and the process keeps running.
  • No fallback to your computer: when the machine can’t be used, the tool call fails and says so. It is never run on your computer instead.
  • A name and labels: pi-<session id>, labelled created-by=boxd-pi and pi-session=<id>.
  • A clean end: quitting a saved session hibernates the machine. Quitting an in-memory session (--no-session) deletes it. A machine whose session you delete stays hibernated, so run /boxd delete first.
  • Your GitHub token, for one command: for a private GitHub repo, the extension uses the token from your gh login for the clone and for /boxd push. It is not written to the machine’s disk or git config.
The extension’s README covers the errors, limits, and examples.