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.
Compare: allow all commands in every AI coding agent →
Approval modes
- default: prompts before each tool runs.
- auto_edit: auto-approves edit tools only.
- plan: read-only mode.
- 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 Gemini CLI guides
- Gemini CLI: turn off usage statistics and telemetry
- Configure Gemini CLI with settings.json
- Gemini CLI extensions and custom commands
- GEMINI.md in Gemini CLI: context file locations, imports and /memory
- Gemini CLI MCP servers: gemini mcp add and mcpServers in settings.json
- Gemini CLI custom slash commands: TOML files, {{args}}, !{shell} and @{file}
- Gemini CLI headless mode: gemini -p, JSON output and exit codes for scripts and CI
- Gemini CLI sandbox: enable Docker, Podman, macOS Seatbelt or gVisor
- Gemini CLI hooks: settings.json, BeforeTool, AfterTool, exit codes and /hooks
Reviewed Oct 18, 2026. Settings change often; the linked vendor docs are the source of truth.
Built an MCP server? Get it listed everywhere →
Shipping an Android app? Google Play needs 12 testers for 14 days first. Get them with Tester Exchange →