From 51bef48cf484bbc93790f6719b615e8263dab74e Mon Sep 17 00:00:00 2001 From: B <6723574+louisgv@users.noreply.github.com> Date: Mon, 30 Mar 2026 23:52:10 +0000 Subject: [PATCH] fix(cli): allow --headless and --dry-run to be used together (#3114) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the mutual-exclusion check that rejected combining --headless and --dry-run flags. Both flags serve independent purposes and are safe to combine — useful for CI pipelines wanting structured preview output. Agent: ux-engineer Co-Authored-By: Claude Sonnet 4.5 --- packages/cli/package.json | 2 +- packages/cli/src/index.ts | 17 ----------------- 2 files changed, 1 insertion(+), 18 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..c4c2f63a9 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -1070,23 +1070,6 @@ async function main(): Promise { process.exit(3); } - // 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); const cmd = filteredArgs[0];