Docs/Reference

Development

Build pi-kit from source, run tests and screenshots, and package releases.

The pi-kit repository holds the desktop app, the backend, the renderer, the pi-kit command, examples and tests.

Set up#

Use Node 24 or newer and the pnpm version pinned in package.json.
git clone https://github.com/Soverius-AI/pi-kit.git
cd pi-kit
corepack enable
pnpm install --frozen-lockfile
The repository uses pnpm with a hoisted node_modules. Do not add a package-lock.json.

Run#

pnpm run dev          # Electron app with live builds
pnpm run dev:web      # renderer at http://localhost:4200, backend at 127.0.0.1:4300
pnpm run dev:second   # a second desktop instance, for pairing and rooms
PI_KIT_DEV_RENDERER_PORT and PI_KIT_DEV_BACKEND_PORT change the dev:web ports. Each keeps its own data folder in the repository: dev uses .pi-kit-data-desktop/, dev:web .pi-kit-data/, dev:second .pi-kit-data-desktop-second/. PI_KIT_DATA_DIR overrides it. The embedded browser needs pnpm run dev.

Layout#

PathContents
apps/desktopElectron main process, native browser views, the service host entry.
apps/rendererAngular UI.
apps/backendNestJS backend: sessions, models, persistence, trust, worktrees, rooms.
apps/backend-runtimeBundle of the pi SDK, MCP and native loaders.
apps/cliThe pi-kit command.
apps/secret-clipi-kit-secret.
apps/onboarding-siteremote.pi-kit.dev.
libs/<domain>/Feature, data and API libraries.
packages/Bundled pi packages, such as pi-kit-learn and pi-computer-use.
CopilotKit and AG-UI connect the renderer to the agent. A generated typed client connects the renderer to the backend. See structure.md, architecture.md and the ADRs.

Check and test#

pnpm run check            # translations, formatting, icons, tooling tests, build, lint, unit tests, OpenAPI diff
pnpm run e2e              # end-to-end tests against dev:web
CHECK_E2E=1 pnpm run check
End-to-end tests run in a scratch pi folder, data folder and Git project (e2e/support/env.mjs). Most need a local model at http://127.0.0.1:8080/v1; E2E_MODEL_URL changes it. Desktop-only tests run directly:
node --test e2e/browser.desktop.e2e.mjs

Screenshots#

scripts/screenshots.mjs photographs dev:web scenes in a scratch world:
pnpm exec playwright install chromium
node scripts/screenshots.mjs --list
node scripts/screenshots.mjs --set bg-agents --serve --out tmp/screenshots/bg-agents
--serve starts its own dev:web against a scratch world; without it the script uses a running one. The bg-agents set runs against a scripted fake model. --scene id,id runs single scenes, --keep-going continues after a failure.

Extend pi-kit#

Start from the examples for pi tools, A2UI and MCP Apps. The plugin contract documents the host events for transcripts, outcomes, the attendant and learning. Plain pi extensions use pi's API; packages that depend on these events do less in the pi CLI.

Build a release#

pnpm run release                 # macOS and Windows on a Mac, the host's Linux target on Linux
pnpm run release --only mac      # also win, win-x64, win-arm64, linux, linux-x64, linux-arm64
pnpm run release:smoke dist/release/pi-kit-<version>-mac-arm64.zip
Output goes to dist/release/. release:smoke starts a packed build against a scratch pi folder and a fake model, sends one prompt and quits. Signing and notarization use credentials outside the repository. Tagging v<version> lets the release workflow build every platform and publish the GitHub release.