Skip to content

Positional prompt argument is ignored when other flags are present #8689

@sniemczyk-google

Description

@sniemczyk-google

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:

  1. 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

Metadata

Metadata

Labels

area/coreIssues related to User Interface, OS Support, Core Functionalitypriority/p2Important but can be addressed in a future release.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions