@averyyy/pi-client

中文文档
1.5.0-piclient.4发布于 2026/11/05MITES Module构建来源已验证近 30 天下载 6164

Lightweight CLI wrapper that connects to a pi-server instance

原始使用文档
文档目录9 节
  1. Install
  2. Use
  3. Server Auth
  4. Read-only Server Viewer
  5. Prompt Cache Warming
  6. Devin Pro
  7. Google Antigravity
  8. Update
  9. Related Package

@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-client

Send 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-folder

The 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 web

The 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-client

Use matching client and server releases. Ordinary provider credentials, environment overrides, and request headers are configured on the client and forwarded for inference. Devin and Google Antigravity accounts store and resolve their credentials on the server.

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. Devin and Google Antigravity account catalogs come from the server. Extensions and codemode scripts use the normal model registry APIs; inference runs on the server. 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-medium

Login 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

Run /login google-antigravity, complete browser authorization, and paste the full redirect URL into the login prompt. PiServer stores the OAuth credentials and project, refreshes expiring tokens, and discovers the account's exact model IDs. pi-client --list-models google-antigravity reads the server's saved account catalog.

Both account providers use the server directory configured by PI_SERVER_ACCOUNT_STORE_DIR, defaulting to ~/.pi/pi-server/accounts. /logout removes the selected server account and its catalog. Provider tokens stay on the server. Local Pi sessions use their local credential store.

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.

Install the server separately:

npm i -g --ignore-scripts @averyyy/pi-server

版本与发布记录

@averyyy/pi-client 共发布 96 个版本,首次发布于 2026/07/02;过去 12 个月发布了 96 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.5.0-piclient.4latest2026/11/052 天前
1.5.0-piclient.32026/11/043 天前
1.5.0-piclient.22026/11/043 天前
1.5.0-piclient.12026/11/035 天前
1.4.0-piclient.192026/11/025 天前
1.4.0-piclient.182026/10/308 天前

关于 @averyyy/pi-client 的常见问题

@averyyy/pi-client 是什么?

Lightweight CLI wrapper that connects to a pi-server instance

如何安装 @averyyy/pi-client?

在项目目录运行 npm install @averyyy/pi-client,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 pi-client,可以用 npx pi-client 直接运行。

@averyyy/pi-client 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/averyyy__pi-client 是否存在。

@averyyy/pi-client 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@averyyy/pi-client 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.19.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@averyyy/pi-client 可以商用吗?

@averyyy/pi-client 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@averyyy/pi-client 的下载量有多少?

根据 npm 官方下载统计,@averyyy/pi-client 在 2026/10/07 – 2026/11/05 这 30 天内被下载 6,164 次,日均约 205 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@averyyy/pi-client 还在维护吗?

最新版本 1.5.0-piclient.4 发布于 2026/11/05(2 天前);至今共发布 96 个版本,其中过去 12 个月发布了 96 个;首次发布于 2026/07/02。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。