@fffattiger/pix-cli

中文文档
0.3.23发布于 2026/11/03TypeScriptES Module近 30 天下载 3936

Install and run pix, a local web workstation for the pi coding agent.

原始使用文档
文档目录6 节
  1. Why pix
  2. Quick start
  3. Windows (preview)
  4. How it works
  5. Development
  6. License

pix

A local web workstation for the pi coding agent.

Your sessions live in a resident daemon, not in a browser tab. Close the window, restart the web server, put your laptop to sleep — running agents keep working, and you reconnect from any browser or from the pix PWA on your phone. Sessions are stored as plain JSONL under ~/.pi, fully shared with the pi CLI: start a conversation in pix, continue it from the terminal, or vice versa.

Why pix

  • Sessions that don't die with the tab. The web UI is just a window onto a resident session daemon; refreshes and restarts never kill a running agent.
  • History browsing costs nothing. Reading past sessions is a pure read-only projection — no worker processes spin up until you interact.
  • Live, structured runtime. Thinking, tool calls, bash output and file edits stream over WebSocket as typed events, with snapshots resuming exactly where you left off.
  • Real workspace context. Browse files, git status and worktrees for the session's project without leaving the UI.
  • Installable PWA. The same client installs to your phone's home screen and talks to your machine over your own network.

Quick start

Requires Node.js ≥ 22.19 and a working pi setup (models and providers come from your existing ~/.pi configuration).

npm install -g @fffattiger/pix-cli
pix start

pix start serves the pix UI at http://127.0.0.1:30141 (add --open to launch your browser). It stays attached to the terminal — Ctrl+C stops the web host while sessions keep running — which is also how service managers (systemd, launchd, Docker) should run it. Useful flags:

pix start --port 30142 --hostname 0.0.0.0 --open
pix start --detach   # run the web host in the background and return once it is ready

To manage the running services:

pix status            # sessiond + background host state, URL and log path
pix logs --follow     # background host output
pix restart           # restart the background host; sessions keep running
pix stop              # stop the background host; sessions keep running
pix stop --all        # also stop the session daemon (ends running sessions)
pix down --all        # stop the session daemon only

pix restart --all also restarts the session daemon, and pix update --restart relaunches a background host on the new version.

Windows (preview)

pix runs on Windows 10/11 with the same commands (npm install -g @fffattiger/pix-cli, then pix start in PowerShell or Windows Terminal). The session daemon uses a per-user named pipe instead of a Unix socket and keeps its state under your user profile. Windows support is a preview: startup is verified on real Windows runners, while parts of the unit-test suite are still being hardened for Windows. See docs/windows.md.

How it works

Browser / PWA
      │
Web process — Vite static client + Hono API/WS gateway        (restartable)
      │  localhost RPC
pix-sessiond — resident daemon, sole session authority
      │
agent-worker × N — one process per session
      │  AgentRuntimePort
pi SDK (via the anti-corruption layer)

The web process is disposable by design; pix-sessiond owns session lifecycle, and each session runs in its own worker process. All durable state stays in ~/.pi. The full architecture, invariants and package layout are documented in docs/refactor-architecture.md and AGENTS.md.

Development

npm install
npm run check:architecture   # package-boundary and tooling gates
npm run typecheck
npm test
npm run build

End-to-end suites (build first): npm run test:e2e:startup, test:e2e:runtime, test:e2e:sessions, test:e2e:lifecycle-sdk, test:e2e:lifecycle-browser, test:e2e:multi-tab.

For a release, update the root version and the Protocol product build version, then synchronize workspace versions and internal dependencies:

node scripts/sync-version.mjs write
npm run release:verify -- --publishable --keep

This creates a standalone archive and a smaller -npm.tgz distribution in an isolated temporary directory. The standalone checks cover offline installation, runtime startup, state retention across an upgrade, and uninstall behavior. The npm archive bundles Pix, Pi's coding-agent SDK, and the patched plugin; npm installs their external dependencies normally. The SDK 1.0.0 bundle omits its defective published shrinkwrap. Test the npm archive with a fresh npm install, then publish it with npm publish <archive-npm.tgz> --access public. Neither the script nor workspace directories publish a release automatically.

License

Project licensing has not yet been decided. Third-party visual assets and their MIT attribution are documented in THIRD_PARTY_NOTICES.md.

版本与发布记录

@fffattiger/pix-cli 共发布 30 个版本,首次发布于 2026/09/18;过去 12 个月发布了 30 个版本。

版本发布日期距今
0.3.23latest2026/11/0311 天前
0.3.222026/10/2916 天前
0.3.212026/10/2817 天前
0.3.202026/10/2718 天前
0.3.192026/10/2619 天前
0.3.182026/10/2322 天前

关于 @fffattiger/pix-cli 的常见问题

@fffattiger/pix-cli 是什么?

Install and run pix, a local web workstation for the pi coding agent.

如何安装 @fffattiger/pix-cli?

在项目目录运行 npm install @fffattiger/pix-cli,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 pix、pix-host、pix-sessiond,可以用 npx pix 直接运行。

@fffattiger/pix-cli 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@fffattiger/pix-cli 支持 ESM 还是 CommonJS?

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

@fffattiger/pix-cli 需要什么版本的 Node.js?

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

@fffattiger/pix-cli 可以商用吗?

@fffattiger/pix-cli 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@fffattiger/pix-cli 的下载量有多少?

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

@fffattiger/pix-cli 还在维护吗?

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