diff --git a/src/bin-default-command.integration.spec.ts b/src/bin-default-command.integration.spec.ts index ae7acd25..0a33b59f 100644 --- a/src/bin-default-command.integration.spec.ts +++ b/src/bin-default-command.integration.spec.ts @@ -99,7 +99,8 @@ describe('bin $0 default command (non-TTY)', () => { const combined = `${result.stdout}\n${result.stderr}`; // parser.showHelp() (not the fresh-yargs block) lists the full command set. - expect(combined).toMatch(/install/); + expect(combined).toContain('workos install'); + expect(combined).toContain('[aliases: integrate]'); expect(combined).toMatch(/organization/); expect(combined).toMatch(/auth/); }, 20_000); diff --git a/src/bin.ts b/src/bin.ts index db5308cf..d3a2506c 100644 --- a/src/bin.ts +++ b/src/bin.ts @@ -367,6 +367,7 @@ async function runCli(): Promise { 'env', 'claim', 'install', + 'integrate', 'setup', 'debug', 'internal', @@ -3182,7 +3183,7 @@ async function runCli(): Promise { }, ) .command( - 'install', + ['install', 'integrate'], 'Install WorkOS AuthKit into your project (interactive framework detection and setup)', (yargs) => yargs.options(installerOptions), async (argv) => { diff --git a/src/lib/command-aliases.ts b/src/lib/command-aliases.ts index 10e3f309..39812186 100644 --- a/src/lib/command-aliases.ts +++ b/src/lib/command-aliases.ts @@ -6,6 +6,7 @@ * Adding an alias here updates both metrics aggregation and --help --json output. */ export const COMMAND_ALIASES: Record = { + integrate: 'install', org: 'organization', // `env` was the pre-0.22 name for local profiles; kept as a quiet alias. env: 'profile', diff --git a/src/utils/command-telemetry.spec.ts b/src/utils/command-telemetry.spec.ts index 7282cc0b..9191982a 100644 --- a/src/utils/command-telemetry.spec.ts +++ b/src/utils/command-telemetry.spec.ts @@ -5,6 +5,7 @@ describe('command-telemetry', () => { describe('resolveCanonicalName', () => { it('resolves aliased commands', () => { expect(resolveCanonicalName(['org', 'list'])).toBe('organization.list'); + expect(resolveCanonicalName(['integrate'])).toBe('install'); }); it('passes through non-aliased commands', () => { diff --git a/src/utils/help-json.spec.ts b/src/utils/help-json.spec.ts index 0acb7f03..c3b93d38 100644 --- a/src/utils/help-json.spec.ts +++ b/src/utils/help-json.spec.ts @@ -27,6 +27,7 @@ describe('help-json', () => { it('resolves command aliases', () => { expect(extractHelpJsonCommand(['org', '--help', '--json'])).toBe('organization'); + expect(extractHelpJsonCommand(['integrate', '--help', '--json'])).toBe('install'); }); });