gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

YOLO mode should override block of command-substitution in bash

Open mtaran opened this issue 1 year ago • 7 comments

What happened?

Repro:

  1. run gemini -y because security be damned (say, I'm running in my own sandbox)
  2. ask it some question about "the diff wrt merge-base"
  3. it tries to run the obvious git diff $(git merge-base master HEAD)

Actual:

the command is blocked with Command substitution using $(), <(), or >() is not allowed for security reasons, which certainly doesn't sound YOLO to me!

What did you expect to happen?

the command succeeds

Client information

About Gemini CLI │ │ │ │ CLI Version 0.1.21 │ │ Git Commit 055fe46d │ │ Model gemini-2.5-pro │ │ Sandbox no sandbox │ │ OS linux │ │ Auth Method OAuth

Login information

oauth

Anything else we need to know?

No response

mtaran avatar Aug 17 '25 18:08 mtaran

Found possible duplicate issues:

  • #6389

If you believe this is not a duplicate, please remove the status/possible-duplicate label.

gemini-cli[bot] avatar Aug 17 '25 18:08 gemini-cli[bot]

I don't seem to have the rights to remove the label, but I'd say this is not a duplicate since the use cases are very different (CI action vs interactive usage), though the underlying cause is likely the same, and ideally a single fix would be able to close both issues.

mtaran avatar Aug 17 '25 21:08 mtaran

Hey thanks for filing. Going to add @cornmander to this thread, since he mentioned he would be looking into this area!

abhipatel12 avatar Aug 18 '25 15:08 abhipatel12

I think this is a good idea.

cornmander avatar Aug 20 '25 16:08 cornmander

Gemini CLI GHA users are running into this:

  • https://github.com/google-gemini/gemini-cli/issues/6389
  • https://github.com/google-github-actions/run-gemini-cli/issues/174

jerop avatar Aug 20 '25 16:08 jerop

Hello! As part of our effort to keep our backlog manageable and focus on the most active issues, we are tidying up older reports.

It looks like this issue hasn't been active for a while, so we are closing it for now. However, if you are still experiencing this bug on the latest stable build, please feel free to comment on this issue or create a new one with updated details.

Thank you for your contribution!

gemini-cli[bot] avatar Dec 03 '25 22:12 gemini-cli[bot]

The block makes sense as a default, but it should be a user-configurable toggle rather than a hard wall. The main pain point is token and turn waste — the model writes out a full command with $() substitution, the CLI blocks it at execution time, and the entire turn is wasted with nothing to show for it. In YOLO mode especially this is counterproductive; the user has already explicitly opted into "run everything without asking me," so silently blocking a command undercuts that contract. A toggle in settings.json would be a better approach than a hardcoded limit, letting users who understand the risk opt out while keeping the block on by default for everyone else.

N1kky-wed avatar May 18 '26 14:05 N1kky-wed