Merge pull request #82 from yunyingk/codex/corp-command-alias
🧪 CI / 🧪 Test, Type-Check & Build Validation (push) Has been cancelled

Add corp compatibility alias for corps commands
This commit is contained in:
yunyingk authored and GitHub committed 2026-09-11 16:43:28 +08:00
commit 4adecf990d
4 files changed
+33 -1

No files matched your search

+19
View File
@@ -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");
+11
View File
@@ -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);
+1
View File
@@ -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";
+2 -1
View File
@@ -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;
}