Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Pi Agent Installation

Pi Agent Installation

This chapter explains how to install Pi Agent on different platforms and complete basic environment configuration.


Environment requirements

Before installing Pi Agent, make sure your system meets the following requirements:

Dependencies Minimum version Description
Node.js 18 LTS or higher recommended Pi Agent runs on Node.js and requires an environment supporting modern JavaScript features
npm Bundled with Node.js Used to install Pi Agent and extension packages
Terminal True Color support iTerm2 (macOS), Windows Terminal, Kitty, WezTerm recommended

Check whether Node.js is installed:



node --version

Output similar to:

v20.11.0

Check whether npm is installed along with it (bundled with Node.js):

npm --version

Output similar to:

10.2.4

If your Node.js version is below 18, please upgrade first. You can use nvm (Node Version Manager) to manage multiple Node.js versions.


Installation

Method 1: npm global install

This is the most universal and simplest installation method, applicable to macOS, Linux, and Windows:



# Global install Pi Agent

# --ignore-scripts Disable lifecycle scripts of dependencies, improving installation security

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

Verify the version after installation:

pi --version

After installation, the pi command can be used directly in the terminal.

Method 2: curl one-click script

On Linux or macOS, you can also use the official installation script:



# Use curl to download and execute the installation script

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

This script automatically detects your system and completes the installation; essentially it also installs globally via npm.

Method 3: Other package managers

If you use pnpm, Yarn, or Bun, you can also install with the corresponding commands:



# Install using pnpm

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



# Install with Yarn

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



# Install with Bun

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


Uninstallation

When uninstalling Pi Agent, use the same package manager you used to install:



# Uninstall with npm if installed with npm or curl

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



# installed by pnpm

pnpm remove -g @earendil-works/pi-coding-agent



# Installed by Yarn

yarn global remove @earendil-works/pi-coding-agent



# Bun 安装的

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

Uninstalling Pi Agent does not delete your configuration, credentials, and session records. These data are saved in ~/.pi/agent/ directory. To completely remove them, you can manually delete that directory.


Terminal recommendations

Pi Agent uses 24-bit RGB color to render the terminal interface; the following terminals are recommended for the best experience:

Platform Recommended terminals Description
macOS iTerm2、Kitty、Warp Native True Color support, good inline image display
Windows Windows Terminal、WezTerm Windows Terminal is the officially recommended modern terminal
Linux Kitty、WezTerm、Alacritty Both support True Color and GPU acceleration

For more terminal tools, see:https://www.runoob.com/w3cnote/terminal-tools.html

Check whether your terminal supports True Color:



$ echo $COLORTERM

truecolor

If the output is truecolor or 24bit, your terminal supports full color rendering.


First run

After installation, enter a project directory and start Pi Agent:



$ cd /path/to/your-project

$ pi

On first launch, you will see Pi Agent's welcome screen.

At this point no AI provider is configured; you need to complete authentication first—this is explained in detail in the next chapter.

At startup, Pi Agent uses the current working directory (cwd) as the project root. It has read/write access to files in the directory; using it under git version control is recommended for easy rollback of changes.


Updating Pi Agent

Keep Pi Agent updated to the latest version:



# Only update Pi Agent itself

pi update --self



# Update Pi Agent and all installed extensions

pi update --all



# Update model directory (get the latest available model list)

pi update --models

Use --self --force to force a reinstall of Pi Agent, even if it is already the latest version:



$ pi update --self --force

Note that installations managed by install scripts such as install.sh do not support --force.

When such managed installations need repair, simply rerun the installation script.