feat: 添加 ccb update 命令,支持 npm/bun 自动更新

从 package.json 读取当前版本,查询 npm registry 最新版本,
自动检测安装方式(bun 或 npm)执行全局更新。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
claude-code-best
2026-04-20 22:35:57 +08:00
parent 13a0bfc479
commit 96ec96c720
3 changed files with 176 additions and 0 deletions

View File

@@ -6551,6 +6551,15 @@ async function run(): Promise<CommanderCommand> {
},
);
// claude update — update ccb to the latest version via npm or bun
program
.command("update")
.description("Update claude-code-best (ccb) to the latest version")
.action(async () => {
const { updateCCB } = await import("./cli/updateCCB.js");
await updateCCB();
});
// ant-only commands
if (process.env.USER_TYPE === "ant") {
const validateLogId = (value: string) => {