Open Source · Self-Hosted · Single-Tenant

The pi coding agent,
in your browser

A self-hosted browser UI for the pi coding agent. Chat with the agent against your code, browse files, run a terminal, review diffs — all from one tab. Your container, your provider keys, your data.

Get Started ↓ View on GitHub
Features

Everything you need to drive the agent from a browser

Pi-forge wraps the pi SDK with the affordances most coding workflows want — and keeps every surface scriptable behind the same REST + SSE API the UI calls.

🔗

MCP server integration

Connect remote Model Context Protocol servers over StreamableHTTP or SSE. Per-project .mcp.json overrides, header status badge, and a master kill-switch for restricted environments.

🛠

Per-tool enable / disable

Every tool the agent could call — pi's seven built-ins plus each MCP server's tools — toggleable individually with per-project overrides. Allow-by-default; changes apply on the next session.

💬

Streaming chat

Token-by-token rendering over SSE. Tool calls and their results materialize in the transcript as they happen — no waiting until the end of a turn.

🌿

Branchable session tree

Fork at any prior turn, navigate the resulting tree, bookmark abandoned branches, summarize-on-navigate to keep context bounded.

📝

Per-turn diff panel

Every file the agent touched in the last turn, aggregated into one reviewable changeset. Inline edit results and project-wide diffs share one renderer.

📁

File browser + editor

Tree view, tabbed CodeMirror with syntax highlighting and autosave, ripgrep-backed workspace search, path-traversal protection on every operation.

💻

Integrated terminal

node-pty over WebSocket, persistent across page refresh and project switch. Per-tab scrollback, multi-tab, env-allowlist for the spawned shell.

🌐

Git panel

Status, unified or split diff, stage / unstage per file, commit, push, fetch, pull, branch checkout / create / delete, log with ref decorations.

📊

Context inspector

Token + cost breakdown per turn, lifetime spend, raw message inspector with syntax highlighting, search across long conversations.

🤖

Pi-subagents integration

Built-in surfacing of the community pi-subagents plugin (install separately) — rich tool card for parent calls, child sessions in the project sidebar.

🔧

OpenAPI spec

Every route auto-documented at /api/docs (Swagger UI) and /api/docs/json. The same routes the React UI calls — no shadow surface.

📱

Mobile + installable PWA

Mobile-tuned chat surface — slide-in project drawer, sticky composer above the keyboard, gallery / camera attach. "Add to Home Screen" on iOS and Android; runs fullscreen with safe-area-aware chrome.

Quick Start

Up and running in minutes

Two install paths. Both end at http://localhost:3000 with a provider key prompt.

A

npm — no Docker, runs from your shell

npx pi-forge
# or install globally:
npm install -g pi-forge && pi-forge
# pass --port, --workspace-path, --api-key @file etc. — see `pi-forge --help`
B

Docker — recommended for ongoing use

git clone https://github.com/Devin-Marks/pi-forge.git
cd pi-forge
cp docker/.env.example docker/.env
# edit docker/.env to set UI_PASSWORD or API_KEY
cd docker && docker compose up -d --build
C

Add your provider key

Open http://<host>:3000, go to Settings → Providers, and paste an Anthropic / OpenAI / etc. API key. Or set keys directly in ~/.pi/agent/auth.json.

D

Add a project and start chatting

Click + Project, point at any folder under WORKSPACE_PATH. The folder becomes the agent's working tree; chat opens in the same view.

Kubernetes, OpenShift, reverse-proxy + TLS, mobile install: see Deployment, Configuration, and Mobile.

Programmatic API

Same routes the UI calls

Every browser interaction is a documented REST or SSE call. Scripts, CI pipelines, and the React UI all hit the same endpoints — no shadow surface, no separate "API mode."

# Authenticate with the API_KEY you set in env
BASE=http://localhost:3000
KEY=your-api-key

# Create a session under a project
SESSION=$(curl -s -X POST $BASE/api/v1/sessions \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"projectId":"<projectId>"}' | jq -r .sessionId)

# Send a prompt (fire-and-forget; response streams over SSE)
curl -s -X POST $BASE/api/v1/sessions/$SESSION/prompt \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Write a test for the auth module"}'

# Stream the response
curl -N -H "Authorization: Bearer $KEY" \
  $BASE/api/v1/sessions/$SESSION/stream

Full recipes (multipart attachments, branch / fork, abort, model switch, MCP wiring): see API Examples. Live OpenAPI spec at /api/docs on a running deploy.

Why pi-forge

Self-hosted, single-tenant, scriptable

What it isn't

  • A SaaS product — no cloud, no analytics, no telemetry
  • A reimplementation of pi's agent loop (it embeds the SDK)
  • A multi-tenant platform — one container, one user, one workspace
  • A code editor replacement — point it at your existing repos
  • Certified for safety-critical or regulated-data workloads

What it is

  • An HTTP / SSE bridge over the pi SDK with a React chat UI on top
  • Container-native: Docker Compose, Kubernetes, OpenShift manifests included
  • Provider-agnostic: built-in providers plus any OpenAI-compatible endpoint
  • API-first: every UI action is a documented REST call
  • Open under MIT, no warranty, no support obligation

Ready to dig in?

The architecture, configuration, and API references all live in the docs. The full source is on GitHub.

Read the Docs → View Source