Skip to content

feat: nopilot update command + startup version check #53

@Asukabot0

Description

@Asukabot0

背景

用户安装 NoPilot 后,升级新版本需要手动执行两步:

  1. npm update -g nopilot
  2. nopilot init(重新同步命令文件到 ~/.claude/commands/

目前没有任何提示机制告知用户有新版本,也没有一键更新命令。

需求

1. nopilot update 命令

  • 执行 npm install -g nopilot@latest 更新包
  • 自动重新运行 nopilot init 同步命令文件
  • 显示更新前后版本号

2. CLI 启动时版本检测

  • 启动时异步检查 npm registry 最新版本
  • 若检测到新版本,打印提示:
    [NoPilot] New version available: 0.0.3 → 0.0.6. Run `nopilot update` to upgrade.
    
  • 检测失败(无网络等)静默跳过,不影响正常使用

实现要点

  • 版本检测用 npm show nopilot version 或请求 https://registry.npmjs.org/nopilot/latest
  • 检测结果可缓存(如 24h),避免每次启动都请求
  • 不阻塞 CLI 主流程

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions