diff --git a/packages/cli/src/cli.agentMode.test.ts b/packages/cli/src/cli.agentMode.test.ts index 2e293528aa..f67bfa4237 100644 --- a/packages/cli/src/cli.agentMode.test.ts +++ b/packages/cli/src/cli.agentMode.test.ts @@ -235,6 +235,7 @@ describe("agent-mode contract", () => { ["compare a.html b.html --timeout -1", "--timeout must be a positive integer"], ["grade-compare --for frame.png", "Exactly one of --grades or --luts"], ["catalog --type widget", 'Invalid --type: "widget". Use "block" or "component".'], + ["catalog --type=", 'Invalid --type: "". Use "block" or "component".'], ["check --range 5,1", "Invalid --range"], ["check --samples ten", "Invalid --samples"], ["check --tolerance=-1", "Invalid --tolerance"], diff --git a/packages/cli/src/commands/catalog.ts b/packages/cli/src/commands/catalog.ts index 70bc3fa812..8c50d4f302 100644 --- a/packages/cli/src/commands/catalog.ts +++ b/packages/cli/src/commands/catalog.ts @@ -225,7 +225,8 @@ export default defineCommand({ let typeFilter: ItemType | undefined; if (args.type === "block") typeFilter = "hyperframes:block"; else if (args.type === "component") typeFilter = "hyperframes:component"; - else if (args.type) { + // An empty `--type=` is a typo too, not a request for no filter. + else if (args.type !== undefined) { throw new CliUsageError(`Invalid --type: "${args.type}". Use "block" or "component".`); }