@averyyy/pi-client
v1.8.0-piclient.2
Published
Lightweight CLI wrapper that connects to a pi-server instance
Readme
@averyyy/pi-client
Client CLI for connecting Pi to a pi-server instance.
Install
npm i -g --ignore-scripts --legacy-peer-deps @averyyy/pi-client--legacy-peer-deps avoids npm peer override warnings when upstream Pi is already installed globally.
Use
Connect to your server:
PI_SERVER_URL=https://pi-server.example.com pi-clientSend one prompt and exit:
PI_SERVER_URL=https://pi-server.example.com pi-client -p "Say exactly: ok"Send a file or folder to the server:
PI_SERVER_URL=https://pi-server.example.com pi-client send /path/to/file-or-folderThe server saves it under its configured upload directory, which defaults to ~/.pi/upload_files.
Start the browser UI:
pi-client install npm:@averyyy/pi-tau-codex
# or: pi install npm:@averyyy/pi-tau-codex
PI_SERVER_URL=https://pi-server.example.com pi-client webThe web command starts pi-client in Tau mirror mode. Install the standalone @averyyy/pi-tau-codex extension into the shared ~/.pi/agent settings first. Tau listens on http://127.0.0.1:1838 by default.
Server Auth
If your server uses an auth token, set it on the client:
PI_SERVER_AUTH_TOKEN=your-token PI_SERVER_URL=http://127.0.0.1:4217 pi-clientUse matching client and server releases. Ordinary provider credentials, environment overrides, and request headers are configured on the client and forwarded for inference. Devin accounts store and resolve their credentials on the server. Google Antigravity uses agy on the PiServer host.
Ordinary built-in model catalogs come from pi-server's shared pi.dev cache. Server metadata takes precedence over bundled metadata for the same model type and ID, independently of the package build date. The client requests catalogs only for providers with configured authentication and determines chat, image, and classifier availability from its own credentials and configuration. OpenRouter's credential-specific model filtering runs on the client. The Devin catalog comes from PiServer and the Antigravity catalog comes from agy. Extensions and codemode scripts use the normal model registry APIs. MCP connections, tools, and other provider logins remain in the client process.
PI_CLIENT_MAX_REQUEST_KB=64 limits each client HTTP request body to 65,536 UTF-8 bytes. Larger prompts, tool definitions, images, operation payloads, and session trees use the shared chunk transport.
Read-only Server Viewer
Open the server URL in a browser and sign in with its Bearer token to browse saved threads by project. The client publishes committed conversation history and live thinking/tool activity through an independent observation channel. Observer connection errors are reported in the terminal and do not interrupt prompts or tools. Reconnecting refreshes the server's read-only projection of the current branch.
The browser can view threads but cannot operate the client. Run and idle indicators follow the client lifecycle; an interrupted observation connection is shown explicitly. Both client and server must include the observer feature for live updates and project metadata.
Normal runtime shutdown waits up to ten seconds for the final observation update. A delivery failure is reported without changing the prompt result or exit status.
Prompt Cache Warming
Cache warming replays eligible requests through pi-server with the original prompt, tools, model, and cache options, limiting output to one token. The default streaming mode warms during active agent runs. To also warm while waiting for input, set this in your global Pi settings:
{
"cacheWarming": "idle"
}The server confirms the cache retention used by each request, and the client uses that policy for refresh timing and cost decisions. The model must declare a prompt-cache lifetime, and the expected savings must reach $0.05. /session shows the warming decision. Set cacheWarming to "off" to disable it. Refresh usage counts toward session totals without adding model messages; cancellation and changed model/context stop warming. Requests use the same 64 KiB transport limit.
Devin Pro
Update both @averyyy/pi-client and @averyyy/pi-server to a version with native Devin support. Start pi-client with your server connection configured, then:
/login devin
/model devin/swe-2-mediumLogin displays Devin's browser authorization link. Complete sign-in and paste the full final redirect URL into the login prompt. PiServer exchanges the code and saves the session token in its account store. The account catalog loads after login; pi-client --list-models swe-2 lists the discovered SWE-2 variants. Choose the exact variant (for example swe-2-high or swe-2-max) to change effort.
Authentication, account model discovery, and inference run on PiServer. The server restores the saved catalog on startup, refreshes it in the background and after login, and refreshes it every four hours. Discovery failures retain the saved catalog and report the error. Pi continues to own tools, agent loops, session history, and subagents. No Devin CLI installation or provider extension is needed. Remove conflicting Devin extensions before enabling the native provider.
The integration exposes concrete models, not Devin's Fusion/router harness. A revoked session requires /login devin again; no refresh endpoint or token lifetime is invented.
Protocol references: pi-devin, pi-devin-provider, and the Devin protocol descriptors.
Google Antigravity
Install Antigravity CLI on the PiServer host and sign in to agy as the OS user running PiServer. In Pi Client, use /model to select a model from the server CLI's catalog. /login google-antigravity checks the existing agy sign-in and reloads that catalog. PiServer also runs the ACP conversation with agy.
agy is the agent: it owns the account catalog, its native harness instructions, context, inference, and native tools. When continuing an agy session, Pi sends only the new user input; when starting a new agy session mid-thread (such as switching models, branching, or after an expired session) or after another model replied, Pi includes a compact handoff of the prior or intervening turns. Your client AGENTS.md context files, model-invocable skill declarations (<available_skills> pointing to your live client SKILL.md paths), and custom prompt extensions (such as --append-system-prompt, custom prompts, and extension prompt sections/guidelines) are translated per session into ACP's _meta.antigravity.systemPrompt.append without writing files to the PiServer host or replacing agy's native prompt. Models advertised by the CLI, including available Orchestrator variants, appear in /model.
In pi-server mode, Pi exposes your active client workspace and extension/SDK tools (excluding todo and ask_user_question, which map to agy's native plan and elicitation) over standard MCP by default so agy reads live client skills and runs file/shell operations on your client machine rather than the server host; in standalone mode only non-builtin extension/SDK tools are exposed over MCP. Set antigravity.tools in settings.json to a list of tool names or * patterns (for example ["read", "ssh_*"]) to filter them, or [] to disable MCP tool exposure. Antigravity models work across interactive TUI, -p, JSON, RPC, and subagent sessions, and PiServer allows concurrent turns across different sessions (while serializing turns within the same session). Manual /compact [instructions] actively compacts the active or resumable agy conversation over ACP (and also compacts Pi's transcript when compaction.model is set to another model), while automatic Pi compaction and summaries still use compaction.model, never agy. Mid-turn steering injects into the active agy turn over ACP, and follow-ups run once the turn settles. In pi-server mode the read-only viewer can still show Pi's session activity.
Pi records the tool calls agy makes with its own tools as Pi's read, edit, write, and bash calls when ACP's standard fields say exactly what ran: a read of one file, a change to one file, or a command in a terminal Pi ran for agy. Other calls, such as searches and web fetches, become notes in agy's reply. Another model can then continue the session without being shown tools it cannot call.
Rules for a personal agy sign-in
Your agy account is governed by Google's Antigravity Terms (section 6), FAQ, and ACP documentation. Under section 6, running the unmodified agy harness through supported interfaces—including third-party UIs via ACP, calling it as a tool or subagent from another harness, headless mode, and supported extensions (MCP servers, skills, rules, hooks, plugins, and supported prompt extensions)—is permitted. Violations are scoped to Antigravity access with an appeal path and do not affect the broader Google account. Account-level compliance remains your responsibility:
- Keep
agyunmodified. Pi launches officialagy acp(with--dangerously-skip-permissionsin standalone mode, or permission-gateddefaultmode on PiServer to isolate the server host while auto-approving client MCP tools) and never extracts or reusesagyOAuth credentials outside the official runtime. - Do not repurpose
agyas a raw model proxy for an external inference loop; Pi refuses standalone/one-off completion requests (compaction summaries, branch summaries, session naming) on Antigravity models. - One person per sign-in: do not share, pool, or resell your PiServer
agysign-in across multiple users. - To keep Pi's global rule and skills out of
agy, start the session with--no-context-filesand--no-skills. To restrict or disable extension MCP tools, setantigravity.toolsinsettings.json. - For raw API inference outside the Antigravity harness, use Pi's
googleprovider with a Gemini API key.
Update
pi-client update installs the latest client and server packages without stopping active client sessions. Existing sessions block new prompts until you run /reload; /reload restarts that session on the new runtime and resumes its persisted history.
Related Package
Install the server separately:
npm i -g --ignore-scripts @averyyy/pi-server