Skip to content

Installation

RequirementMinimum
Node.js or BunNode 18+ or Bun 1.x
OSLinux, macOS, Windows
For self-hostingDocker + Docker Compose

Terminal window
npm install -g @pizzapi/pizza
pizzapi --version

Connect the CLI to your relay server:

Terminal window
pizzapi setup

You’ll be prompted for:

PromptDefaultDescription
Relay server URLhttp://localhost:7492HTTP(S) address of the relay server
Your nameOptional; only used when creating a new account
EmailAccount email
PasswordAccount password

On success the CLI saves your API key to ~/.pizzapi/config.json and prints the derived WebSocket URL used for streaming.


Terminal window
# Show the installed version
pizzapi --version
# List available AI models
pizzapi models
# Show API usage
pizzapi usage

PizzaPi now recognizes Ollama Cloud as a built-in API-key provider. Set OLLAMA_API_KEY, then open PizzaPi and select an Ollama Cloud model from /model (provider ID: ollama-cloud):

Terminal window
export OLLAMA_API_KEY=your_ollama_api_key
pizzapi

The built-in provider targets the OpenAI-compatible Ollama Cloud endpoint at https://ollama.com/v1.

If you already use local or self-hosted Ollama via ~/.pizzapi/models.json under provider ID ollama, keep that config as-is — the built-in cloud provider is separate and shows up as ollama-cloud.


Terminal window
npm update -g @pizzapi/pizza
# — or —
bun update -g @pizzapi/pizza

PizzaPi stores all its data under ~/.pizzapi/. Here’s what each file is for:

PathCreated byPurpose
~/.pizzapi/config.jsonpizzapi setup / manualCLI config: API key, relay URL, skills, hooks
~/.pizzapi/auth.json/login inside a sessionAI provider credentials (OAuth tokens, API keys)
~/.pizzapi/models.jsonmanual / custom setupOptional custom model + provider config (for local Ollama, proxies, vLLM, etc.). Built-in providers still work without this file.
~/.pizzapi/runner.jsonpizzapi runner (first start)Runner identity, name, and PID tracking (auto-generated)
~/.pizzapi/usage-cache.jsonpizzapi runnerShared provider quota cache (written by daemon, read by workers)
~/.pizzapi/logs/macOS LaunchAgent setupLog files for runner stdout/stderr
~/.pizzapi/web/config.jsonpizzapi webWeb hub settings (port, VAPID keys, origins)
~/.pizzapi/web/compose.ymlpizzapi webAuto-generated Docker Compose file (regenerated each run)
~/.pizzapi/web/data/pizzapi webPersistent SQLite database for user accounts
~/.pizzapi/web/repo/pizzapi webCloned PizzaPi source repo
~/.pizzapi/skills/manualGlobal personal skills
~/.pizzapi/usage.dbfirst sessionSQLite database tracking token consumption, costs, and session analytics. Safe to delete (loses analytics history).
~/.pizzapi/session-list-cache.jsonpizzapi runnerCache of session metadata with mtime-based invalidation. Safe to delete (rebuilds automatically on next session list).

Project-local config (.pizzapi/config.json) is stored in each project’s directory and is not part of the global ~/.pizzapi/ tree.


If you previously used the raw pi coding agent, PizzaPi automatically migrates your existing data on first startup. No manual steps are required.

The migration runs in two phases:

  1. Phase 1 — ~/.pi/agent/~/.pizzapi/: Copies sessions, auth, and other data from a legacy pi install into the PizzaPi config directory.
  2. Phase 2 — ~/.pizzapi/agent/~/.pizzapi/: Flattens an older PizzaPi layout where data was nested under ~/.pizzapi/agent/ (caused by an earlier upstream getAgentDir() path). Files are merged into the flat ~/.pizzapi/ structure.

Both phases are idempotent — they skip files that already exist at the destination and write a .migrated marker so they don’t re-scan on subsequent startups. It’s safe to re-run (e.g., if you reinstall).


Re-run setup (switch relay or update credentials)

Section titled “Re-run setup (switch relay or update credentials)”

To switch to a different relay server or update your credentials at any time:

Terminal window
pizzapi setup

This overwrites the apiKey in ~/.pizzapi/config.json and prints the WebSocket URL to add to your config. After setup, manually add the relay URL if it’s not the default:

~/.pizzapi/config.json
{
"apiKey": "pk_live_...",
"relayUrl": "wss://your-relay.example.com"
}

Disconnect from the relay (relay-free mode)

Section titled “Disconnect from the relay (relay-free mode)”

To stop connecting to a relay without uninstalling:

Terminal window
# Add to ~/.pizzapi/config.json:
# "relayUrl": "off"
# — or — use an environment variable:
PIZZAPI_RELAY_URL=off pizzapi

See the Standalone Mode guide for details.

To log out of all AI providers and start fresh with /login:

Terminal window
rm ~/.pizzapi/auth.json

If you also use custom model/provider definitions in ~/.pizzapi/models.json (for example local Ollama, LM Studio, or proxy endpoints), do not delete that file unless you intentionally want to remove those custom models too.

Next time you start pizzapi, built-in providers will still be available via environment variables or /login, and any custom providers in models.json will remain intact.

The runner identity is auto-generated on first start. To assign a new identity (useful if you’ve cloned a machine or want a fresh runner registration):

Terminal window
# Stop the runner first
pizzapi runner stop
# Remove the identity file
rm ~/.pizzapi/runner.json
# Restart — a new ID is generated automatically
pizzapi runner

To wipe the relay server’s database and start fresh (all user accounts and session metadata will be lost):

Terminal window
# Stop the web hub first
pizzapi web stop
# Remove only the database (preserves config, VAPID keys, etc.)
rm -rf ~/.pizzapi/web/data/
# Restart — a fresh database is created on next start
pizzapi web

To also reset the web hub configuration (port, VAPID keys, origins):

Terminal window
pizzapi web stop
rm -rf ~/.pizzapi/web/
pizzapi web # all defaults restored; new VAPID keys generated

Terminal window
# Stop the runner daemon (if running)
pizzapi runner stop
# Stop the web hub (if running)
pizzapi web stop
Terminal window
npm uninstall -g @pizzapi/pizza
Terminal window
# Removes config, credentials, sessions, web hub data — everything
rm -rf ~/.pizzapi

Or remove selectively:

Terminal window
rm ~/.pizzapi/config.json # relay credentials only
rm ~/.pizzapi/auth.json # AI provider credentials only
rm -rf ~/.pizzapi/web/ # web hub only

4. Remove macOS LaunchAgent (if installed)

Section titled “4. Remove macOS LaunchAgent (if installed)”

If you set up the runner as a macOS LaunchAgent:

Terminal window
launchctl unload ~/Library/LaunchAgents/com.pizzapi.runner.plist
rm ~/Library/LaunchAgents/com.pizzapi.runner.plist

5. Remove systemd service (Linux, if installed)

Section titled “5. Remove systemd service (Linux, if installed)”
Terminal window
sudo systemctl stop pizzapi-runner
sudo systemctl disable pizzapi-runner
sudo rm /etc/systemd/system/pizzapi-runner.service
sudo systemctl daemon-reload