@hypernewbie/phi-code

中文文档
0.31.0发布于 2026/11/01MIT零依赖构建来源已验证

Terminal multiplexer & control center for AI coding assistants

原始使用文档
文档目录5 节
  1. What's in this npm package
  2. npm v12 install-time security
  3. Project-scoped installs
  4. Global installs ( npm install -g )
  5. Trusted publishing (OIDC)

What's in this npm package

This npm package is intentionally tiny — it's a launcher stub, not the full app:

package/
  package.json     # allowScripts, version, repo metadata
  README.md        # this file
  scripts/install.js   # downloads the platform-native binary from GitHub releases
  bin/phi          # node shim that spawns the downloaded binary

The real Go binary, the web UI (including help.md and changelog.md), and all assets live in the GitHub release that install.js downloads. The binary embeds the web/ directory via //go:embed all:web so it serves help.md and changelog.md directly at runtime — no separate hosting needed.

npm v12 install-time security

As of npm v12 (https://github.blog/changelog/2026-07-08-npm-install-time-security-and-gat-bypass2fa-deprecation/), postinstall scripts no longer run by default. This package's postinstall (scripts/install.js) downloads the platform-native Go binary from GitHub releases — without it, phi won't install.

Project-scoped installs

This package.json ships an allowScripts entry that auto-approves the script:

"allowScripts": { "@hypernewbie/phi-code": true }

So npm install @hypernewbie/phi-code (or --save) Just Works.

Global installs (npm install -g)

There's no project package.json in global mode, so npm v12 can't read the allowlist. End users on npm v12+ will need one of:

npm install -g @hypernewbie/phi-code --allow-scripts

or persist it once:

npm config set allow-scripts=@hypernewbie/phi-code --location=user
npm install -g @hypernewbie/phi-code

(or use --ignore-scripts and run npx --yes @hypernewbie/phi-code to fetch the binary on demand.)

Trusted publishing (OIDC)

The release workflow (.github/workflows/release.yml) is configured for npm's trusted-publishing flow with OIDC: the npm-publish job has id-token: write permission and calls npm publish --provenance. To complete the migration:

  1. On npmjs.com → package @hypernewbie/phi-code → Publishing access → Trusted Publishers → Add trusted publisher:
    • Owner: hypernewbie
    • Repository: phi
    • Workflow filename: release.yml
  2. Remove the NPM_TOKEN repo secret once you've confirmed a tagged release publishes successfully via OIDC alone (set NODE_AUTH_TOKEN: '' in the workflow temporarily to test).

Until both are done, the workflow falls back to the legacy NPM_TOKEN secret.

版本与发布记录

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

版本发布日期距今
0.31.0latest2026/11/012 天前
0.30.02026/11/012 天前
0.29.12026/11/012 天前
0.29.02026/10/312 天前
0.28.12026/10/312 天前
0.28.02026/10/313 天前

关于 @hypernewbie/phi-code 的常见问题

@hypernewbie/phi-code 是什么?

终端多路复用器和AI编码助手控制中心

如何安装 @hypernewbie/phi-code?

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

@hypernewbie/phi-code 支持 TypeScript 吗?

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

@hypernewbie/phi-code 可以商用吗?

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

@hypernewbie/phi-code 还在维护吗?

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