From 179092173be91d4e4fcc9245be17371bca08360a Mon Sep 17 00:00:00 2001 From: Miya Date: Thu, 10 Sep 2026 16:14:10 +0200 Subject: [PATCH] fix(cli): make help and single-step summaries readable Session-Id: 01a08ba4-4473-7903-b7c3-e778edb9b523 --- packages/sdk/src/cli.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/sdk/src/cli.ts b/packages/sdk/src/cli.ts index 1d8b86cfd..9e5c6f912 100644 --- a/packages/sdk/src/cli.ts +++ b/packages/sdk/src/cli.ts @@ -49,7 +49,7 @@ const USAGE = [ 'flows tick start --schedule-id --interval-ms [--epoch-ms ] [--max-catch-up ] [--poll-interval-ms ] [--data-dir ] ', 'flows resume [--json] [--no-spawn] [--data-dir ] ', 'flows hn-monitor start [--data-dir ] [--poll-interval-ms ] ', -].join(' '); +].join('\n'); /** * `FLOWS_NO_SPAWN=1` is `--no-spawn` for a whole environment: the lever for CI @@ -70,6 +70,11 @@ export async function runCli( args: readonly string[], io: CliIo = PROCESS_IO, ): Promise { + if (args.length === 1 && (args[0] === '--help' || args[0] === '-h')) { + io.stdout(USAGE); + return 0; + } + const parsed = parseArgs(args); if (parsed === undefined) { const report = inputFailureReport({ kind: 'invalid_invocation', message: USAGE }); @@ -393,7 +398,7 @@ function emitRunReport(execution: RunExecution, json: boolean, io: CliIo): void return; } if (report.runId === undefined) return; - const completed = report.completedSteps === undefined ? '' : ` (${report.completedSteps} steps)`; + const completed = report.completedSteps === undefined ? '' : ` (${report.completedSteps} ${report.completedSteps === 1 ? 'step' : 'steps'})`; const reason = report.completionReason === undefined ? '' : ` completionReason: ${report.completionReason}`;