diff --git a/packages/cli/package.json b/packages/cli/package.json index 09f8119f..29a9fbe1 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/spawn", - "version": "0.12.16", + "version": "0.12.17", "type": "module", "bin": { "spawn": "cli.js" diff --git a/packages/cli/src/commands/interactive.ts b/packages/cli/src/commands/interactive.ts index a53332b7..11b2e83e 100644 --- a/packages/cli/src/commands/interactive.ts +++ b/packages/cli/src/commands/interactive.ts @@ -15,7 +15,7 @@ import { preflightCredentialCheck, getAuthHint, } from "./shared.js"; -import { execScript } from "./run.js"; +import { execScript, showDryRunPreview } from "./run.js"; // Prompt user to select an agent with hints and type-ahead filtering async function selectAgent(manifest: Manifest): Promise { @@ -170,6 +170,11 @@ export async function cmdAgentInteractive(agent: string, prompt?: string, dryRun const { clouds, hintOverrides } = getAndValidateCloudChoices(manifest, resolvedAgent); const cloudChoice = await selectCloud(manifest, clouds, hintOverrides); + if (dryRun) { + showDryRunPreview(manifest, resolvedAgent, cloudChoice, prompt); + return; + } + await preflightCredentialCheck(manifest, cloudChoice); const spawnName = await promptSpawnName(); @@ -186,7 +191,7 @@ export async function cmdAgentInteractive(agent: string, prompt?: string, dryRun prompt, getAuthHint(manifest, cloudChoice), manifest.clouds[cloudChoice].url, - dryRun, + undefined, spawnName, ); } diff --git a/packages/cli/src/commands/run.ts b/packages/cli/src/commands/run.ts index 5b0a32b0..4f1d60a4 100644 --- a/packages/cli/src/commands/run.ts +++ b/packages/cli/src/commands/run.ts @@ -170,7 +170,7 @@ function buildPromptLines(prompt: string): string[] { return lines; } -function showDryRunPreview(manifest: Manifest, agent: string, cloud: string, prompt?: string): void { +export function showDryRunPreview(manifest: Manifest, agent: string, cloud: string, prompt?: string): void { p.log.info(pc.bold("Dry run -- no resources will be provisioned\n")); printDryRunSection("Agent", buildAgentLines(manifest.agents[agent]));