From 5c28096efdfba16638dc97c355581ad7dba264b6 Mon Sep 17 00:00:00 2001 From: lzwind <100665065+lzwind@users.noreply.github.com> Date: Tue, 11 Aug 2026 13:16:55 +0800 Subject: [PATCH] fix(cli): honor --interactive flag in opencode run `opencode run -i` / `--interactive` was documented as "run in direct interactive split-footer mode" but the flag was parsed and never read. Interactive mode was only reachable via the hidden `--mini` flag. Read `args.interactive` alongside `args.mini` and relax the guard that forced `--mini` to be used without the `run` subcommand. Fixes #41513 --- packages/opencode/src/cli/cmd/run.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/opencode/src/cli/cmd/run.ts b/packages/opencode/src/cli/cmd/run.ts index 3927f615a080..5405045aee11 100644 --- a/packages/opencode/src/cli/cmd/run.ts +++ b/packages/opencode/src/cli/cmd/run.ts @@ -270,7 +270,7 @@ export const RunCommand = effectCmd({ const localInstance = yield* InstanceRef yield* Effect.promise(async () => { const rawMessage = [...args.message, ...(args["--"] || [])].join(" ") - const interactive = args.mini + const interactive = args.mini || args.interactive const auto = args.auto || args.yolo || args["dangerously-skip-permissions"] const thinking = interactive ? (args.thinking ?? true) : (args.thinking ?? false) const die = (message: string): never => { @@ -290,10 +290,10 @@ export const RunCommand = effectCmd({ .join(" ") if (interactive && args.command) { - die("--mini cannot be used with --command") + die("--interactive cannot be used with --command") } - if (interactive && args._?.[0] !== "mini") { + if (interactive && !args.interactive && args._?.[0] !== "mini") { die("--mini must be used without the run subcommand") } @@ -317,7 +317,7 @@ export const RunCommand = effectCmd({ } if (interactive && !process.stdout.isTTY) { - die("--mini requires a TTY stdout") + die("interactive mode requires a TTY stdout") } if (interactive) {