Skip to content

feat: support self-update via pi-web update - #441

Closed
Jyleaves wants to merge 1 commit into
agegr:mainfrom
Jyleaves:feat/pi-web-update
Closed

feat: support self-update via pi-web update#441
Jyleaves wants to merge 1 commit into
agegr:mainfrom
Jyleaves:feat/pi-web-update

Conversation

@Jyleaves

@Jyleaves Jyleaves commented Aug 9, 2026

Copy link
Copy Markdown

中文

支持 pi-web update 直接自更新,无需再手动执行 npm install -g @agegr/pi-web

  • 新增 pi-web update 子命令:检查 npm registry 中的新版本,并用安装 pi-web 时所用的包管理器(npm、pnpm、yarn 或 bun)重新全局安装
  • 无法识别安装方式、registry 不可达或安装失败时,输出手动更新命令提示
  • 通过 npx 运行时,pi-web update 会将最新版本全局安装到本机
  • 版本比较沿用 lib/app-update.ts 的稳定版语义(预发布版本不触发更新)
  • 新增 bin/pi-web-update.test.mjs 单元测试,并纳入 npm test
  • README(英文/中文)补充更新说明

注:README.ja.md / README.ru.md 为社区翻译,欢迎补充对应段落。

English

Adds a pi-web update command so users can self-update without running npm install -g @agegr/pi-web manually.

  • pi-web update checks the npm registry for a newer release and reinstalls pi-web globally with the package manager that installed it (npm, pnpm, yarn, or bun)
  • Prints a manual fallback command when the install method cannot be detected, the registry is unreachable, or the update fails
  • When pi-web was run through npx, the update installs the latest version globally
  • Version comparison reuses the stable-only semantics of lib/app-update.ts (prereleases never trigger an update)
  • Adds bin/pi-web-update.test.mjs unit tests, wired into npm test
  • Documents the command in the English and Chinese READMEs

Note: README.ja.md / README.ru.md are community translations; updates welcome.

@agegr

agegr commented Aug 9, 2026

Copy link
Copy Markdown
Owner

当前实现仍有几个问题
pnpm 命令应使用 pnpm add -g;
args.includes("update") 可能误触发更新;版本检查固定调用 npm,也会导致部分 pnpm/Yarn/Bun 环境失败。
请修复并补充对应测试后再合并。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants