piagent_
← ~/guides

Installing and Updating Pi

BeginnerLast updated: Nov 3, 2026

$ pi –install

TL;DR. Pi is published as @earendil-works/pi-coding-agent on npm. The recommended path is npm install -g --ignore-scripts @earendil-works/pi-coding-agent; Bun, pnpm, and Yarn all work the same way. v0.84.3 adds an optional powershell tool on Windows that runs through pwsh.exe (-NoProfile -NonInteractive -ExecutionPolicy Bypass) and an experimental installer-managed update flow that stages, verifies, and atomically activates the new release. Updates run with pi update for the CLI itself, pi update --extensions for installed packages, and pi update --all for everything. Pin with pi install npm:pkg@x.y.z or pi install git:host/user/repo@ref, and pin the package manager wrapper with npmCommand in settings.json.

This guide collects every supported install path, the update matrix, and the new v0.84.3 surface (PowerShell tool, managed updates, Windows keybinding defaults). It follows the Quickstart, the Packages documentation, the Windows Setup page, and the v0.84.3 release notes. What you are installing — the minimal core and everything it leaves to extensions — is summarized in Core Concepts.

Install with npm

Pi is a single npm package. The --ignore-scripts flag disables npm’s install-script hooks, which pi does not need and which can otherwise slow the install:

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

That places pi on the global PATH. pnpm and Yarn work the same way:

pnpm add -g @earendil-works/pi-coding-agent
yarn global add @earendil-works/pi-coding-agent

On Windows, npm installs a pi.cmd shim rather than a directly executable pi binary — see the Windows section below for the implications for extensions and shells that try to launch pi directly.

To uninstall with the same package manager that installed it:

npm uninstall -g @earendil-works/pi-coding-agent
pnpm remove -g @earendil-works/pi-coding-agent
yarn global remove @earendil-works/pi-coding-agent

Uninstalling pi leaves settings, credentials, sessions, and installed pi packages in ~/.pi/agent/ (Windows: %USERPROFILE%\.pi\agent\) so you can reinstall without losing state.

Install with Bun

Bun is supported as a drop-in for npm for the install and uninstall step:

bun install -g @earendil-works/pi-coding-agent
bun uninstall -g @earendil-works/pi-coding-agent

A subtle Bun-specific gotcha landed in v0.84.3: Bun release archives ship the native clipboard binary only inside the wrapper package, not at the top of the install. If you are debugging a missing clipboard on a Bun-installed build, look in the wrapper package’s bin/ rather than next to the binary.

Install on Windows

Windows users install through npm, the same way as on macOS or Linux:

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

npm places a pi.cmd shim on the PATH rather than a directly executable pi binary — this is what npm’s global layout expects, but it has implications for extensions that try to launch pi directly through an absolute path: they need the pi.cmd shim rather than the underlying binary.

For Git on Windows, pi’s default bash tool looks up bash.exe in this order:

  1. Custom path from ~/.pi/agent/settings.json (the shellPath field).
  2. C:\Program Files\Git\bin\bash.exe (Git for Windows).
  3. bash.exe on PATH (Cygwin, MSYS2, WSL).

For most Windows users, “Git for Windows” is sufficient. The official docs flag it as the recommended choice.

The PowerShell tool (v0.84.3)

v0.84.3 ships an optional, native powershell tool on Windows. It runs commands through pwsh.exe when available, falling back to Windows PowerShell. Every invocation passes:

-NoProfile -NonInteractive -ExecutionPolicy Bypass

Administrator-enforced execution policies still take precedence, so on locked-down hosts the tool may surface the same error PowerShell would. The ! and !! editor shell-escape commands still go through Bash, not through this tool — only the model-facing tool surface changes.

Enable it by editing defaultTools in ~/.pi/agent/settings.json (%USERPROFILE%\.pi\agent\settings.json on Windows):

{
  "defaultTools": ["read", "powershell", "edit", "write"]
}

To keep both shells available side-by-side while comparing behavior:

{
  "defaultTools": ["read", "bash", "powershell", "edit", "write"]
}

The Bash default still works without changes; defaultTools only changes which tool the model sees.

How to upgrade the pi CLI itself

The bare pi update upgrades the pi CLI in place — no flags needed:

pi update                # upgrade pi itself
pi update --self         # same thing, spelled out
pi update --self --force # reinstall pi even when already current

pi update never prompts for project trust — the upgrade runs under your user account without re-prompting. Because “exit code 0” alone proves nothing when a wrapper script owns the install, finish every upgrade by verifying what pi itself reports:

pi --version

Two situations regularly trip upgrades up:

  • npm’s cached registry views disagree with reality. If pi update reports nothing to do while a newer release plainly exists, the cache is usually stale — clear it (npm cache clean --force) or reinstall outright with pi update --self --force. The same staleness is why pi update --extensions (below) prints a yellow warning instead of a false “Updated packages” when npm’s cached views disagree (fixed in #11571).
  • A second pi session holds a file lock on Windows. Another pi session with a git extension’s native module loaded leaves npm a directory it can rename but not delete; the next upgrade’s git clean then fails. Since #11648 a failed clean only warns, npm install still runs, and a .pi-update-incomplete marker records the partial state — close the other session and run pi update again to finish.

How to update pi packages and extensions

Packages and git-ref reconciliation never happen implicitly — the bare pi update only touches the CLI. Use a flag:

pi update --extensions   # update packages + reconcile pinned git refs
pi update --all          # upgrade pi + update packages + reconcile, all at once
pi update --models       # refresh model catalogs only
pi update npm:@foo/bar   # update one package
pi update --extension npm:@foo/bar

Pinned packages (pi install npm:pkg@1.2.3) are skipped by --extensions; --all reconciles a pinned git ref to its configured commit without moving the pin — see Pinning versions and refs below.

Uninstall and remove pi extensions

How an extension got in decides how it comes out. Three exits:

Uninstall a package by name. For anything installed with pi install, uninstall the pi extension with pi remove — the pi uninstall alias behaves identically:

pi remove npm:@scope/pkg     # equivalent: pi uninstall npm:@scope/pkg

This removes the package from pi’s package list in ~/.pi/agent/settings.json, so it stops loading at the next session start. Project-local installs are recorded in the project’s .pi/settings.json instead — run pi remove inside the project and they come out the same way.

Remove a pi extension that is a plain file. File extensions (~/.pi/agent/extensions/*.ts globally, .pi/extensions/*.ts per project) are not packages: to remove one, delete the file or move it out of the directory — /reload or the next session picks up the change. There is nothing else to clean up.

Disable without removing. To run once with every extension off — isolating a bug, benchmarking a clean session — start with pi --no-extensions. Nothing is uninstalled; the next normal start loads the full set again.

To update pi extensions rather than remove them, the section above has the full matrix: pi update --extensions for every package at once, pi update npm:@scope/pkg for one. What deserves a slot in the first place is a different question — the curated pi extensions list answers it.

Update and upgrade FAQ

What is the difference between pi update and pi update --extensions? pi update upgrades the pi CLI binary only. pi update --extensions updates installed pi packages (skills, extensions, themes) and reconciles pinned git refs, and never upgrades the CLI. pi update --all is the only form that does both in one command.

How do I upgrade the pi coding agent when pi update says nothing to update? A newer release can hide behind a stale npm cache. Clear the cache (npm cache clean --force) and rerun, or force a reinstall with pi update --self --force. Confirm success with pi --version — not with the command’s exit code.

How do I roll pi back to an older version? Reinstall the exact version with your package manager: npm install -g --ignore-scripts @earendil-works/pi-coding-agent@x.y.z. For managed (staged) installs, pi update --self --force is not supported — re-run the installer that produced the install and pick the version there.

Does upgrading pi also update my installed extensions and skills? No. The bare pi update leaves packages untouched — that separation is deliberate, because a breaking CLI release and your pinned extension versions should move on separate schedules. Run pi update --extensions (packages only) or pi update --all (everything) when you want them to move together — the official pi-skills collection updates through the same flow.

Why does pi update never ask about project trust? The update flow runs under your user account on packages pi already knows about; trust gating applies to loading a project’s code and configuration, not to refreshing software you installed yourself.

Managed updates (v0.84.3, experimental)

For experimental installer-managed installations, pi update no longer overwrites the running binary in place. Instead it:

  1. Downloads the target release into a staged, lockfile-backed location.
  2. Verifies the staged release.
  3. Atomically activates the staged release, leaving the current release intact on the disk if activation fails.

This is the same staged-then-activate pattern used by package managers like Nix and Cargo, adapted for a Node-runtime agent. Because verification happens before activation, a corrupt or partial update cannot replace a working binary. Managed installs do not support pi update --self --force; to repair a managed install, re-run the installer that produced it.

The packages documentation notes that managed installs exist but does not currently document the install command that creates one — at the time of writing, npm install -g is the only install method with a documented command. If you already have a managed installation, the staged-update behavior kicks in for every pi update you run.

Pinning versions and refs

Two pinning styles are common:

  • Pinned to a published version. pi install npm:pkg@1.2.3 records the version in settings.json. Updates through pi update --extensions skip pinned packages; pass --all if you want a reconcile-only operation that does not move the pin.
  • Pinned to a git ref. pi install git:host/user/repo@ref clones to ~/.pi/agent/git/<host>/<path> (global) or .pi/git/<host>/<path> (project). pi update --extensions and pi update --all reconcile the clone to the configured ref without moving it; to move to a newer ref, run pi install git:host/user/repo@new-ref.

The --all reconcile is useful when a force-push or a rebase has rewritten the pinned commit — pi will reset and clean the clone and run npm install if a package.json is present.

Pinning the package-manager wrapper

When your team standardizes on a non-npm package manager (mise, asdf, volta), pin the wrapper that pi uses for package lookup and install:

{
  "npmCommand": ["mise", "exec", "node@20", "--", "npm"]
}

Without npmCommand, pi shells out to whatever npm is on the PATH at update time — usually fine, occasionally surprising on machines where npm resolves to a different binary than the one that originally installed pi.

Where state lives

After install, all user state lives under ~/.pi/agent/:

Path Contents
~/.pi/agent/settings.json User-level settings (default tools, providers, trust, npmCommand)
~/.pi/agent/auth.json Resolved provider credentials
~/.pi/agent/sessions/ Per-session JSONL history — the full workflow is Sessions and history
~/.pi/agent/extensions/ User-scope extension packages
~/.pi/agent/skills/, ~/.pi/agent/prompts/, ~/.pi/agent/themes/ Other user-scope packages
~/.pi/agent/npm/, ~/.pi/agent/git/ Cached installs
~/.pi/agent/trust.json Saved project-trust decisions

For project-local state, the equivalents live under .pi/ next to the project’s package.json (or whichever project root pi was started from). Project installs respect project trust and are gated by defaultProjectTrust plus the --approve / --no-approve flags.

A short pre-deploy checklist

  • Confirm pi --version matches the version you intended to install.
  • Decide whether you need a managed install (only available via the experimental installer flow) or a direct npm / Bun install — only the managed path supports staged updates.
  • On Windows, decide whether to enable the powershell tool via defaultTools; document the choice in your team’s onboarding notes.
  • Pin runtime versions in CI (pi install npm:@earendil-works/pi-coding-agent@x.y.z) and pin the package wrapper via npmCommand.
  • Verify SHA-256 checksums of manual binary downloads against the values in the GitHub release’s SHA256SUMS file.

Further reading

  • Quickstart — install / uninstall / first session
  • Packages — package sources, pi install, pi update, npmCommand
  • Windows Setup — PowerShell tool, bash lookup order, shellPath, WSL notes
  • v0.84.3 release notes — PowerShell tool, staged managed updates, /thinking selector with Ctrl+S persist
  • Settings — defaultTools, shellPath, npmCommand, defaultProjectTrust