diff --git a/bin/oracle-cli.ts b/bin/oracle-cli.ts index f8768328..a81413c8 100755 --- a/bin/oracle-cli.ts +++ b/bin/oracle-cli.ts @@ -13,6 +13,7 @@ if (process.argv[2] === "oracle-mcp") { } import { resolveEngine, type EngineMode, defaultWaitPreference } from "../src/cli/engine.js"; import { shouldRequirePrompt } from "../src/cli/promptRequirement.js"; +import { resolveDashPrompt } from "../src/cli/stdin.js"; import chalk from "chalk"; import type { SessionMetadata, SessionMode, BrowserSessionConfig } from "../src/sessionStore.js"; import { sessionStore, pruneOldSessions } from "../src/sessionStore.js"; @@ -216,7 +217,7 @@ program.hook("preAction", () => { introPrinted = true; }); applyHelpStyling(program, VERSION, isTty); -program.hook("preAction", (thisCommand) => { +program.hook("preAction", async (thisCommand) => { if (thisCommand !== program) { return; } @@ -234,6 +235,11 @@ program.hook("preAction", (thisCommand) => { opts.prompt = positional; thisCommand.setOptionValue("prompt", positional); } + const resolvedPrompt = await resolveDashPrompt(opts.prompt); + if (resolvedPrompt !== opts.prompt) { + opts.prompt = resolvedPrompt; + thisCommand.setOptionValue("prompt", resolvedPrompt); + } if (shouldRequirePrompt(userCliArgs, opts)) { console.log( chalk.yellow('Prompt is required. Provide it via --prompt "" or positional [prompt].'), diff --git a/docs/browser-mode.md b/docs/browser-mode.md index c45c15e2..f092da68 100644 --- a/docs/browser-mode.md +++ b/docs/browser-mode.md @@ -75,7 +75,7 @@ You can pass the same payload inline (`--browser-inline-cookies '