Positional prompt argument is ignored when other flags are present
What happened?
When providing a prompt as a positional argument along with other flags (e.g., gemini -e none "Hello, world!"), the Gemini CLI ignores the positional prompt and enters interactive mode. It displays the Gemini logo and does not process the prompt.
Steps to reproduce:
- Run
gemini -e none Hello
What did you expect to happen?
The CLI should process "Hello" as the prompt and return a response, even when other flags are present. The expected behavior is that the CLI processes the positional prompt regardless of other flags being present, consistent with how it works when no other flags are provided (gemini Hello).
Workaround:
Using the -p or --prompt flag explicitly works as expected: gemini -e none -p Hello
Client information
Client Information
Run gemini to enter the interactive CLI, then run the /about command.
> /about
╭───────────────────────────────────────────────────────╮
│ │
│ About Gemini CLI │
│ │
│ CLI Version 0.6.0-nightly-git.c4c81e3d │
│ Git Commit c4c81e3d │
│ Model gemini-2.5-pro │
│ Sandbox no sandbox │
│ OS linux │
│ Auth Method gemini-api-key │
│ │
╰───────────────────────────────────────────────────────╯
Login information
Gemini API Key
Anything else we need to know?
No response
This issue is a bug where the CLI's core command parsing fails to handle positional prompt arguments when other flags are present. It's a medium priority issue as a simple workaround exists.
Please re-open this issue. gemini -e none hello still does not work
I "re-opened" with issue #10004 cc: @allenhutchison
@sniemczyk-google I think this is fixed now, can you verify?
This is still broken
While the literally simplest prompt now works, gemini -e none Hello try anything more complex:
gemini -e none --approval-mode=auto_edit --allowed-tools=ShellTool --allowed-tools="ShellTool(whoami)" --allowed-tools="ShellTool(wc)" -p "Use whoami to write a poem in file poem.md about my username in pig latin and use wc to tell me how many lines are in the poem you wrote."
While the above produces an answer (e.g. 3) If you remove the -p and it now jumps into Gemini with the splash screen:
gemini -e none --approval-mode=auto_edit --allowed-tools=ShellTool --allowed-tools="ShellTool(whoami)" --allowed-tools="ShellTool(wc)" "Use whoami to write a poem in file poem.md about my username in pig latin and use wc to tell me how many lines are in the poem you wrote."
This is especially problematic since the prompt CLI option is considered deprecated in favor of the position one while the positional one does not seem to work reliably at all.
I spent some time digging into this last night. i see where the oversight is and am testing a fix.