From df9854bf9fd2916af3d2396d7c312c564b6aa3e9 Mon Sep 17 00:00:00 2001 From: Jorge Vidaurre Date: Sat, 28 Mar 2026 13:28:21 -0300 Subject: [PATCH] fix(ux): parent commands exit 0 on bare invocation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add .action(() => cmd.outputHelp()) to catalog, obs, release, and services parent commands. Commander.js parent commands with no action default to exit 1 — outputHelp() renders help and exits 0. Closes #647 --- src/commands/catalog.ts | 3 ++- src/commands/observability.ts | 3 ++- src/commands/release-check.ts | 3 ++- src/commands/services.ts | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/commands/catalog.ts b/src/commands/catalog.ts index bc28d49..d1c955a 100644 --- a/src/commands/catalog.ts +++ b/src/commands/catalog.ts @@ -25,7 +25,8 @@ function noIdp(): boolean { export function registerCatalogCommands(program: Command): void { const catalog = program .command('catalog') - .description('Service catalog — browse, inspect, and validate services'); + .description('Service catalog — browse, inspect, and validate services') + .action(() => { catalog.outputHelp(); }); // ── catalog list ── catalog diff --git a/src/commands/observability.ts b/src/commands/observability.ts index ca70a1c..4c1c3c9 100644 --- a/src/commands/observability.ts +++ b/src/commands/observability.ts @@ -12,7 +12,8 @@ import { colors, bold, RESET, writeLine } from '../lib/terminal.js'; export function registerObservabilityCommands(program: Command): void { const obs = program .command('obs') - .description('Observability — execution history, token costs, and trends'); + .description('Observability — execution history, token costs, and trends') + .action(() => { obs.outputHelp(); }); obs .command('history') diff --git a/src/commands/release-check.ts b/src/commands/release-check.ts index 5ecc801..4f7c41d 100644 --- a/src/commands/release-check.ts +++ b/src/commands/release-check.ts @@ -21,7 +21,8 @@ async function checkHealth(url: string, expect: number): Promise<{ ok: boolean; export function registerReleaseCommands(program: Command): void { const release = program .command('release') - .description('Release management — pre-deploy checks and status'); + .description('Release management — pre-deploy checks and status') + .action(() => { release.outputHelp(); }); release .command('pre-check ') diff --git a/src/commands/services.ts b/src/commands/services.ts index 9674e37..acf8758 100644 --- a/src/commands/services.ts +++ b/src/commands/services.ts @@ -47,7 +47,8 @@ function dockerComposeAvailable(): boolean { export function registerServicesCommands(program: Command): void { const services = program .command('services') - .description('Manage Tier 2 local services (Postgres, Redis, API, Bridge)'); + .description('Manage Tier 2 local services (Postgres, Redis, API, Bridge)') + .action(() => { services.outputHelp(); }); // ── services up ── services