Skip to content

Commit 7a0632c

Browse files
committed
fix: opencode adapter passes prompt as positional arg not --prompt (#68)
opencode CLI uses -p/--password, NOT -p for prompts. The prompt should be passed as a positional 'message' argument to 'opencode run'. Before: opencode run --prompt "hello" (hit help text, no execution) After: opencode run "hello" (executes the prompt) Fixes #68
1 parent 91b8282 commit 7a0632c

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/runners/opencode.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export interface OpenCodeRunOptions {
2121
* Then launches `opencode` in that workspace. OpenCode reads both files
2222
* automatically on startup.
2323
*
24-
* Supports both interactive mode (no prompt) and single-shot mode (`opencode run -p`).
24+
* Supports both interactive mode (no prompt) and single-shot mode (`opencode run "<message>"`).
2525
*/
2626
export function runWithOpenCode(agentDir: string, manifest: AgentManifest, options: OpenCodeRunOptions = {}): void {
2727
const exp = exportToOpenCode(agentDir);
@@ -45,9 +45,10 @@ export function runWithOpenCode(agentDir: string, manifest: AgentManifest, optio
4545
// Build opencode CLI args
4646
const args: string[] = [];
4747

48-
// Single-shot mode uses `opencode run --prompt "..."`, interactive is just `opencode`
48+
// Single-shot mode: `opencode run "<message>"` — prompt is a positional arg.
49+
// Note: opencode's `-p` / `--password` is NOT for prompts; the prompt goes as positional message.
4950
if (options.prompt) {
50-
args.push('run', '--prompt', options.prompt);
51+
args.push('run', options.prompt);
5152
}
5253

5354
info(`Launching OpenCode agent "${manifest.name}"...`);

0 commit comments

Comments
 (0)