From f2130044ac4e88692e20312f0b57568507920ea3 Mon Sep 17 00:00:00 2001 From: B <6723574+louisgv@users.noreply.github.com> Date: Mon, 30 Mar 2026 22:50:22 +0000 Subject: [PATCH] fix(cli): allow --headless and --dry-run to be used together Removes the mutual-exclusion validation that blocked combining these flags. Both flags serve independent purposes: --dry-run previews what would happen, --headless suppresses interactive prompts and emits structured output. Combining them is valid for CI pipelines that want structured JSON previews. Fixes #3114 Agent: issue-fixer 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];