diff --git a/src/cli/commands/corps.test.ts b/src/cli/commands/corps.test.ts index d3f7598..7a2aecd 100644 --- a/src/cli/commands/corps.test.ts +++ b/src/cli/commands/corps.test.ts @@ -108,6 +108,25 @@ describe("corps link onboarding", () => { }); }); +describe("corp compatibility alias", () => { + test("seal-use corp list executes and resolves cleanly like seal-use corps", async () => { + setupConfigEnv(); + const result = await runCli(["corp", "list"]); + expect(result.exitCode).toBe(0); + expect(result.isError).toBe(false); + expect(JSON.parse(result.stdout)).toEqual([]); + }); + + test("seal-use corp --help executes and resolves cleanly like seal-use corps", async () => { + const result = await runCli(["corp", "--help"]); + expect(result.exitCode).toBe(0); + expect(result.isError).toBe(false); + expect(result.stdout).toContain("seal-use corps - Enterprise and tenant management"); + expect(result.stdout).toContain("seal-use corps list"); + expect(result.stdout).not.toContain("seal-use webhook"); + }); +}); + function setupConfigEnv() { const root = mkdtempSync(join(tmpdir(), "seal-use-link-cli-")); const enterprises = join(root, "enterprises"); diff --git a/src/cli/help.test.ts b/src/cli/help.test.ts index 2c6f129..9422b3d 100644 --- a/src/cli/help.test.ts +++ b/src/cli/help.test.ts @@ -119,6 +119,17 @@ describe("CLI help execution via runCli", () => { expect(result.stdout).not.toContain("seal-use simulation"); }); + test("seal-use corp --help resolves to corps domain commands with exitCode 0", async () => { + const result = await runCli(["corp", "--help"]); + expect(result.exitCode).toBe(0); + expect(result.isError).toBe(false); + expect(result.stdout).toContain("seal-use corps - Enterprise and tenant management"); + expect(result.stdout).toContain("seal-use corps list"); + expect(result.stdout).toContain("seal-use corps bind-test"); + expect(result.stdout).not.toContain("seal-use webhook"); + expect(result.stdout).not.toContain("seal-use simulation"); + }); + test("seal-use corps unknown-cmd --help exits with code 2", async () => { const result = await runCli(["corps", "unknown-cmd", "--help"]); expect(result.exitCode).toBe(2); diff --git a/src/cli/help.ts b/src/cli/help.ts index fe4f4f3..d0d7524 100644 --- a/src/cli/help.ts +++ b/src/cli/help.ts @@ -924,6 +924,7 @@ export function renderHelp(target: string[] = []): string { function normalizeArea(area: string): string { const lower = area.toLowerCase(); + if (lower === "corp") return "corps"; if (lower === "webhooks") return "webhook"; if (lower === "preferences") return "preference"; if (lower === "changelog") return "update"; diff --git a/src/cli/runner.ts b/src/cli/runner.ts index ca0e169..16940ea 100755 --- a/src/cli/runner.ts +++ b/src/cli/runner.ts @@ -62,6 +62,7 @@ export const KNOWN_AREAS = new Set([ "update", "tools", "corps", + "corp", "tool", "source", "auth", @@ -274,7 +275,7 @@ async function dispatch(argv: string[], runtime: CliRuntime) { return; } - if (area === "corps") { + if (area === "corps" || area === "corp") { await handleCorpsCommand(action, maybeName, args); return; }