A desktop workspace for the Pi coding agent. Open a local project, ask Pi how a piece of code works, and follow its tool calls alongside the streaming reply. Reopen the same folder to pick up the conversation. Pi UI is an independent client built with the Pi TypeScript SDK. Upstream Pi project
Captured from the packaged app using a local test model. Pi read the demo project’s package.json.
The app has been tested on Apple Silicon. To build from source, install Git and Node.js 22.19 or later with npm, then clone the repository and install its pinned dependencies.
git clone https://github.com/AllBeingsFuture/pi-ui.git
cd pi-ui
npm ciModel requests use the relay API entered in Settings. The Pi CLI is not required. Open Settings at the bottom left of the sidebar, enter the API address and API key, then click Save. Both values are stored in ~/.pi/agent/agent-pi-ui/relay.json and applied to models.json. Later messages use that address. To share a prepared app, copy the completed relay.json to the same path; the recipient does not configure it.
npm startStart chatting in the default workspace; no folder selection is required. To work on existing code, click Default workspace in the sidebar, select your project folder, and try “Read the README and tell me how to run this project.” Press Enter to send, Shift + Enter for a new line, or Stop to interrupt the current run. The interface opens in English. To switch to Simplified Chinese, open Settings at the bottom left of the sidebar and choose Simplified Chinese under Language. The app remembers your choice.
Each new conversation gets a copy of the current project in project/worktree/<session-id>/ on a local pi-ui/<session-id> Git branch. Pi UI initializes a local repository when needed. The copy includes uncommitted, untracked and ignored regular files. The copy skips Git metadata and other session checkouts. When you open a subdirectory of a repository, its copy keeps the same relative path inside the checkout.
Click Project access beside the composer to see the writable repository and the session's working directory. When you select a Git repository root in the native folder picker and choose Open and allow project writes, new sessions start in separate worktrees with write access to that repository. Pi can commit its branch and merge into the main checkout with ordinary Git commands. The desktop remembers the selection across restarts. Previously created worktree sessions keep their original scope. Subfolders, external Git directories, and locations containing the running app or its private data use worktree-only access. macOS uses sandbox-exec and Linux requires /usr/bin/bwrap.
New archives keep the transcript (history.jsonl for chats with messages) and checkout snapshot (worktree/) under ~/.pi/agent/agent-pi-ui/archive/<project-path SHA-256>/<session-id>/. With PI_CODING_AGENT_DIR set, the same layout lives under that agent directory. After the archive is saved, the project checkout is released. Restoring within seven days brings back the archived files and Git staging state. Conversations created before worktree support keep their original working directory.
All desktop workspaces and chat models use ~/.pi/agent/agent-pi-ui/SYSTEM.md. When PI_CODING_AGENT_DIR is set, the file lives under agent-pi-ui/ in that directory. On first use, Pi UI copies the bundled project-root SYSTEM.md into this location byte-for-byte; existing files, including empty ones, are never overwritten automatically. The bundled file contains the complete, unchanged 破甲记忆.md source. Edit the runtime file as UTF-8 text and save. Your next message uses its exact contents as the system prompt, including in an existing conversation. An empty file sends an empty desktop prompt. Tool names, descriptions, and parameters are provided through the model’s tool interface.
| Component | Role |
|---|---|
React and TypeScript (src/) |
Render the conversation, tool activity and message composer. |
Electron (electron/) |
Opens the native folder picker, hosts the window and connects the renderer to the local service. |
Pi SDK service (server/) |
Creates a Pi session in the selected folder, runs tools and streams state changes back to the window. It listens on the loopback interface and authenticates requests with a per-launch token. |
Desktop conversations are stored per project under ~/.pi/agent/agent-pi-ui/sessions/ by default. Selecting a folder restores its most recent desktop conversation. Pi CLI conversations have their own history.
Within a project, new conversations appear first. Switching, renaming, or receiving background replies does not move existing rows. The order survives restart; restoring a conversation brings it back to its saved position.
Hover or focus a project or conversation and click the archive icon. Even the last conversation can be archived without removing the project. The archive button next to Workspaces → + lists conversations by project and restores them to their original location. Desktop archives live in agent-pi-ui/archive/ beside sessions/. They expire 7 days after archiving; the app cleans up on startup and while running.
npm run buildchecks TypeScript and the Electron and service entry points, then builds the React interface.npm startrebuilds the latest source and launches Electron. Quit the app and rerun it after editing.npm run package:macbuilds and ad-hoc signs an Apple Silicon app bundle. Open it from Finder or runopen "release/Agent Pi-darwin-arm64/Agent Pi.app".
Pi UI is distributed under the Apache License, Version 2.0.
