Skip to content

Commit eb00897

Browse files
committed
fix: use -y -p flags for Gemini CLI headless execution
Gemini CLI requires -p for non-interactive mode and -y (yolo) for auto-approving tool calls. Without these, the agent hangs in interactive mode.
1 parent 90316a6 commit eb00897

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/command-builder.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ export function buildCommand(config: AgentConfig): CommandSpec {
7272
cmd,
7373
args: [
7474
...templateArgs,
75-
...(config.prompt ? [config.prompt] : []),
75+
"-y",
76+
...(config.prompt ? ["-p", config.prompt] : []),
7677
],
7778
};
7879
} else {
@@ -119,7 +120,8 @@ export function buildCommand(config: AgentConfig): CommandSpec {
119120
return {
120121
cmd: "gemini",
121122
args: [
122-
...(config.prompt ? [config.prompt] : []),
123+
"-y",
124+
...(config.prompt ? ["-p", config.prompt] : []),
123125
...(config.args ?? []),
124126
],
125127
};

0 commit comments

Comments
 (0)