Gemini CLI

Gemini CLI: YOLO mode, auto_edit and allowing specific shell commands

How do I stop Gemini CLI asking before every tool call?

Start Gemini CLI with --approval-mode auto_edit to auto-approve edits, or --yolo (--approval-mode yolo) to auto-approve everything. YOLO can only be turned on from the command line. To allow specific shell commands, list them in tools.allowed in settings.json.

Approval modes

  • default: prompts before each tool runs.
  • auto_edit: auto-approves edit tools only.
  • plan: read-only, no tool execution.
  • yolo: auto-approves all actions; command line only.

Set the starting mode with general.defaultApprovalMode (default, auto_edit or plan) in ~/.gemini/settings.json or .gemini/settings.json.

Allow specific commands

.gemini/settings.json

{
  "tools": {
    "allowed": ["run_shell_command(git)", "run_shell_command(npm test)"]
  }
}

Sources

More on Gemini CLI

Other guides

Get the weekly agent stack update

New official MCP servers, spec changes and harness releases, checked against the source. One email a week, no fluff.

Reviewed Oct 6, 2026. Settings change often; the linked vendor docs are the source of truth.