From 3bde01aa1c67799348d1cd806dedc53af924cb53 Mon Sep 17 00:00:00 2001 From: jackwener Date: Fri, 20 Mar 2026 15:51:51 +0800 Subject: [PATCH] fix: prevent duplicate command registration crash The build manifest includes antigravity/serve which collides with the hardcoded antigravity serve in cli.ts. Add a guard to skip registry entries whose subcommand already exists in the site group. --- src/cli.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cli.ts b/src/cli.ts index b5ef051..17ac287 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -130,6 +130,8 @@ export function runCli(BUILTIN_CLIS: string, USER_CLIS: string): void { for (const [, cmd] of registry) { let siteCmd = siteGroups.get(cmd.site); if (!siteCmd) { siteCmd = program.command(cmd.site).description(`${cmd.site} commands`); siteGroups.set(cmd.site, siteCmd); } + // Skip if this subcommand was already hardcoded (e.g. antigravity serve) + if (siteCmd.commands.some((c: Command) => c.name() === cmd.name)) continue; const subCmd = siteCmd.command(cmd.name).description(cmd.description); // Register positional args first, then named options