From 72e2a806e99ba3aad0a214db5abda2552ea5d02b Mon Sep 17 00:00:00 2001 From: B <6723574+louisgv@users.noreply.github.com> Date: Mon, 30 Mar 2026 20:51:28 +0000 Subject: [PATCH 1/2] fix(cli): allow --headless and --dry-run to be used together Remove the mutual-exclusion validation that blocked combining --headless with --dry-run. Both flags serve independent purposes (machine-readable output vs. preview-only execution), and their combination is valid for CI pipelines that want structured dry-run output. Fixes #3114 Agent: issue-fixer Co-Authored-By: Claude Sonnet 4.5 --- packages/cli/package.json | 2 +- packages/cli/src/index.ts | 15 --------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index b8617964a..0442c1ebc 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/spawn", - "version": "0.29.2", + "version": "0.29.3", "type": "module", "bin": { "spawn": "cli.js" diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index 1fc897ddd..caafdc97e 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -1071,21 +1071,6 @@ async function main(): Promise { } // Validate headless-incompatible flags - if (effectiveHeadless && dryRun) { - if (outputFormat === "json") { - console.log( - JSON.stringify({ - status: "error", - error_code: "VALIDATION_ERROR", - error_message: "--headless and --dry-run cannot be used together", - }), - ); - } else { - console.error(pc.red("Error: --headless and --dry-run cannot be used together")); - console.error(`\nUse ${pc.cyan("--dry-run")} for previewing, or ${pc.cyan("--headless")} for execution.`); - } - process.exit(3); - } checkUnknownFlags(filteredArgs); From 56699e07df1070ceb8c9df1a3509dbaaa1ad7d66 Mon Sep 17 00:00:00 2001 From: B <6723574+louisgv@users.noreply.github.com> Date: Mon, 30 Mar 2026 22:34:19 +0000 Subject: [PATCH 2/2] fix(cli): guard --headless --dry-run with clear error instead of silent ignore When both --headless and --dry-run are specified, exit with a clear error message explaining that --dry-run is not yet supported in headless mode. This prevents the dangerous behavior where --dry-run was silently ignored and actual provisioning would occur. Addresses CHANGES_REQUESTED review on PR #3115. Agent: ux-engineer Co-Authored-By: Claude Sonnet 4.5 --- packages/cli/src/index.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index caafdc97e..bdd481c15 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -1071,6 +1071,24 @@ async function main(): Promise { } // Validate headless-incompatible flags + if (effectiveHeadless && dryRun) { + if (outputFormat === "json") { + console.log( + JSON.stringify({ + status: "error", + error_code: "VALIDATION_ERROR", + error_message: + "--dry-run is not yet supported with --headless. Use --dry-run (interactive) or --headless (execution) separately.", + }), + ); + } else { + console.error(pc.red("Error: --dry-run is not yet supported with --headless")); + console.error( + `\nUse ${pc.cyan("--dry-run")} for an interactive preview, or ${pc.cyan("--headless")} for unattended execution.`, + ); + } + process.exit(3); + } checkUnknownFlags(filteredArgs);