Settings File Locations
Gemini CLI loads settings from multiple locations in order of precedence:System Defaults
Provides base layer of system-wide default settingsLocations:
- Linux:
/etc/gemini-cli/system-defaults.json - Windows:
C:\ProgramData\gemini-cli\system-defaults.json - macOS:
/Library/Application Support/GeminiCli/system-defaults.json
GEMINI_CLI_SYSTEM_DEFAULTS_PATH environment variableUser Settings
Global settings for the current userLocation:
~/.gemini/settings.jsonApplies to all Gemini CLI sessions for the current user. Overrides system defaults.Project Settings
Project-specific settingsLocation:
.gemini/settings.json in your project rootApplies only when running Gemini CLI from that specific project. Overrides user settings.Environment Variable Substitution
String values insettings.json can reference environment variables using $VAR_NAME or ${VAR_NAME} syntax:
General Settings
Enable Vim keybindings in the CLI interface
Default approval mode for tool executionOptions:
default- Prompts for approval on each tool callauto_edit- Auto-approves edit toolsplan- Read-only mode (requires experimental planning)
The preferred editor to open files in (e.g.,
code, vim, nano)Enable automatic updates for Gemini CLI
Enable run-event notifications for action-required prompts and session completion (macOS only)
Maximum number of attempts for requests to the main chat model (cannot exceed 10)
Directory where planning artifacts are stored. Defaults to system temporary directory if not specified.
Automatically switch between Pro and Flash models based on Plan Mode status
Enable automatic session cleanup
Automatically delete chats older than this time periodExamples:
"30d", "7d", "24h", "1w"UI Settings
Color theme for the UI. See the CLI themes guide for available options.
Automatically switch between default light and dark themes based on terminal background color
Hide the application banner at startup
Hide helpful tips in the UI
Hide the context summary (GEMINI.md, MCP servers) above the input
Hide the footer from the UI
Show line numbers in the chat
Update the terminal window title with current status icons
- Ready: ◇
- Action Required: ✋
- Working: ✦
Use an alternate screen buffer for the UI, preserving shell history (requires restart)
What to show while the model is workingOptions:
tips, witty, all, offRender output in plain-text to be more screen reader accessible (requires restart)
Model Settings
The Gemini model to use for conversationsExamples:
gemini-3-pro-preview, gemini-2.5-flash, gemini-2.5-proMaximum number of user/model/tool turns to keep in a session.
-1 means unlimited.The fraction of context usage at which to trigger context compressionExamples:
0.2, 0.3, 0.5 (requires restart)Disable automatic detection and prevention of infinite loops (requires restart)
Context Settings
The name of the context file(s) to load into memoryExamples:
Whether to include the directory tree of the current working directory in the initial request
Maximum number of directories to search for memory files
Additional directories to include in the workspace contextExample:
Controls how
/memory refresh loads GEMINI.md files. When true, include directories are scanned.Respect .gitignore files when searching (requires restart)
Respect .geminiignore files when searching (requires restart)
Enable recursive file search when completing @ references in the prompt (requires restart)
Additional ignore file paths to respect. Takes precedence over .geminiignore and .gitignore.Example:
Tools Settings
Sandbox execution environment. Set to boolean to enable/disable, or provide a string path to a sandbox profile.Examples:
true, false, "docker", "podman", "/path/to/profile"(Requires restart)Use node-pty for an interactive shell experience (requires restart)
Show color in shell output
Use ripgrep for file content search instead of fallback implementation
Maximum characters to show when truncating large tool outputs. Set to 0 or negative to disable.
Disable LLM-based error correction for edit tools. When enabled, tools fail immediately if exact string matches are not found.
Security Settings
Disable YOLO mode, even if enabled by a flag (requires restart)
Enable the “Allow for all future sessions” option in tool confirmation dialogs
Blocks installing and loading extensions from Git (requires restart)
Enable folder trust system (requires restart)
Enable redaction of environment variables that may contain secrets (requires restart)
Enable context-aware security checker. Uses an LLM to dynamically generate and enforce security policies.
MCP Servers
Configure connections to Model-Context Protocol (MCP) servers for discovering custom tools.Configuration for a named MCP server
Telemetry Settings
Configure logging and metrics collection for Gemini CLI.Whether telemetry is enabled
Destination for collected telemetryOptions:
local, gcpThe endpoint for the OTLP Exporter
The protocol for the OTLP ExporterOptions:
grpc, httpWhether to include the content of user prompts in the logs
File to write telemetry to when target is
localSkills & Hooks
Enable Agent Skills (requires restart)
Enable the hooks system. When disabled, no hooks will be executed. (requires restart)
Show visual indicators when hooks are executing
Example Configuration
Related Resources
Environment Variables
Configure Gemini CLI using environment variables
GEMINI.md Files
Provide context with GEMINI.md files
MCP Server Setup
Integrate custom tools via MCP
Command Reference
All available slash commands