From 89450cb7bcce15f1f9328305261dd3e35c643c3c Mon Sep 17 00:00:00 2001 From: Benjamin Diedrichsen Date: Tue, 1 Sep 2026 12:48:44 +0200 Subject: [PATCH] [fix] nopy: --no-save-history, so -H keeps its id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes DOCS-AUDIT §6.2. Commander derives an option's destination from its long flag with `no-` stripped, so `--no-history` wrote to the same `options.history` that `-H, --history ` reads. `nopy install -H abc --no-history` set it to `false`, the id was discarded without a word, and the run fell through to a full interactive session instead of replaying anything. The two cannot share a destination, so one spelling had to change, and it is the boolean that moved: `-H ` is what the help text, the README and `docs/API.md` all use, and "save history" is what the flag actually suppresses — next to `-s, --save-session`. The old spelling now fails loudly instead of silently. Verified by running the CLI, since `nopy.cli.ts` is argv wiring and excluded from coverage: install --no-history -> error: unknown option '--no-history' install -H nonexistent-id --no-save-history -> Session not found: nonexistent-id The second line is the finding: the id used to be destroyed there. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01DCzYTAm9QUhvLNr2EpdagJ --- packages/nopy/src/nopy.cli.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/nopy/src/nopy.cli.ts b/packages/nopy/src/nopy.cli.ts index d21e494..fd2bd0a 100644 --- a/packages/nopy/src/nopy.cli.ts +++ b/packages/nopy/src/nopy.cli.ts @@ -92,7 +92,12 @@ program .option('-n, --dry-run', 'Show execution plan without running') .option('-P, --print-only', 'Print deploy commands and exit (no execution)') .option('-c, --continue-on-error', 'Continue executing after failures') - .option('--no-history', 'Do not save this session to history') + // `--no-save-history`, not `--no-history`: Commander derives the destination + // from the long flag with the `no-` stripped, so `--no-history` wrote to the + // same `options.history` that `-H ` does. `-H abc --no-history` set it to + // `false`, the id was silently discarded, and the run fell through to a full + // interactive session instead of replaying anything. + .option('--no-save-history', 'Do not save this session to history') .action(async (options) => { await printUpdateNotice(); @@ -139,7 +144,7 @@ program dryRun: options.dryRun, printOnly: options.printOnly, continueOnError, - saveToHistory: options.history !== false && !options.dryRun, + saveToHistory: options.saveHistory !== false && !options.dryRun, }); // Exit with error code if deployment failed