From 298713fae7a2e333cef2b10d50cbff619c4c40dc Mon Sep 17 00:00:00 2001 From: dotta Date: Mon, 23 Mar 2026 07:59:52 -0500 Subject: [PATCH] Fix duplicate auth login company flag Co-Authored-By: Paperclip --- .../__tests__/auth-command-registration.test.ts | 16 ++++++++++++++++ cli/src/commands/client/auth.ts | 1 - 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 cli/src/__tests__/auth-command-registration.test.ts diff --git a/cli/src/__tests__/auth-command-registration.test.ts b/cli/src/__tests__/auth-command-registration.test.ts new file mode 100644 index 00000000..a93d8fa7 --- /dev/null +++ b/cli/src/__tests__/auth-command-registration.test.ts @@ -0,0 +1,16 @@ +import { Command } from "commander"; +import { describe, expect, it } from "vitest"; +import { registerClientAuthCommands } from "../commands/client/auth.js"; + +describe("registerClientAuthCommands", () => { + it("registers auth commands without duplicate company-id flags", () => { + const program = new Command(); + const auth = program.command("auth"); + + expect(() => registerClientAuthCommands(auth)).not.toThrow(); + + const login = auth.commands.find((command) => command.name() === "login"); + expect(login).toBeDefined(); + expect(login?.options.filter((option) => option.long === "--company-id")).toHaveLength(1); + }); +}); diff --git a/cli/src/commands/client/auth.ts b/cli/src/commands/client/auth.ts index 141b795c..65f47610 100644 --- a/cli/src/commands/client/auth.ts +++ b/cli/src/commands/client/auth.ts @@ -25,7 +25,6 @@ export function registerClientAuthCommands(auth: Command): void { auth .command("login") .description("Authenticate the CLI for board-user access") - .option("-C, --company-id ", "Request access for a specific company") .option("--instance-admin", "Request instance-admin approval instead of plain board access", false) .action(async (opts: AuthLoginOptions) => { try {