Gemini CLI settings.json Reference

Updated by

Independent reference, not affiliated with Google. Tables are generated from the Gemini CLI source at v0.62.0 (v0.62.0). Official documentation: geminicli.com.

Gemini CLI reads settings.json from up to four files and merges them in a fixed order: system defaults, then the user file ~/.gemini/settings.json, then the project file .gemini/settings.json, then a system override file that beats both. Command-line flags such as --model and --approval-mode override the merged result for one session.

Where is Gemini CLI settings.json?#

Later layers win for single values; arrays and objects follow the merge column. admin.* values in files are ignored; only remotely fetched admin settings apply.
AppliedLayerFilePath override
1Built-in defaultsschema defaults (the Default column below)none
2System defaults/Library/Application Support/GeminiCli/system-defaults.json (macOS), C:\ProgramData\gemini-cli\system-defaults.json (Windows), /etc/gemini-cli/system-defaults.json (Linux)GEMINI_CLI_SYSTEM_DEFAULTS_PATH
3User~/.gemini/settings.jsonGEMINI_CLI_HOME (moves ~)
4Workspace<project>/.gemini/settings.json (ignored in untrusted folders)none
5System override/Library/Application Support/GeminiCli/settings.json (macOS), C:\ProgramData\gemini-cli\settings.json (Windows), /etc/gemini-cli/settings.json (Linux)GEMINI_CLI_SYSTEM_SETTINGS_PATH

On Windows the user file is %USERPROFILE%\.gemini\settings.json, since ~ is the home directory on every platform. Setting GEMINI_CLI_HOME moves the whole ~/.gemini tree. The project file is read only when the folder is trusted, so a cloned repository cannot change your settings until you trust it. The system override exists for administrators: anything set there wins over user and project values.

Precedence beyond the files: --model beats GEMINI_MODEL, which beats model.name; --approval-mode or --yolo beats general.defaultApprovalMode; --sandbox beats tools.sandbox.

How do settings from several files combine?#

Files are merged in the order above. Objects merge key by key, so a project file can change one field of general without restating the rest; single values and arrays from a later file replace earlier ones. These keys combine across files instead:

Every other key: objects merge key by key, arrays and single values are replaced by the later file.
KeyHow values from several files combine
mcpServersobjects merged by top-level name
policyPathsarrays joined, duplicates dropped
context.includeDirectoriesarrays concatenated
context.fileFiltering.customIgnoreFilePathsarrays joined, duplicates dropped
tools.excludearrays joined, duplicates dropped
advanced.excludedEnvVarsarrays joined, duplicates dropped
extensions.disabledarrays joined, duplicates dropped
extensions.workspacesWithMigrationNudgearrays joined, duplicates dropped
skills.disabledarrays joined, duplicates dropped
hooksConfig.disabledarrays joined, duplicates dropped
hooks.BeforeToolarrays concatenated
hooks.AfterToolarrays concatenated
hooks.BeforeAgentarrays concatenated
hooks.AfterAgentarrays concatenated
hooks.Notificationarrays concatenated
hooks.SessionStartarrays concatenated
hooks.SessionEndarrays concatenated
hooks.PreCompressarrays concatenated
hooks.BeforeModelarrays concatenated
hooks.AfterModelarrays concatenated
hooks.BeforeToolSelectionarrays concatenated
hooks.<name>arrays concatenated

So hooks defined in ~/.gemini/settings.json and in a project's .gemini/settings.json both run, and mcpServers from both files are merged by server name, with the later file winning when both define the same server.

Can settings.json use environment variables?#

MechanismRule
Variables in valuesstring values expand $VAR, ${VAR} and ${VAR:-default} from the environment before validation; an unset variable is left as written
.env discoveryfrom the working directory upward: .gemini/.env (trusted folders only), then .env in each directory; falls back to ~/.gemini/.env (trusted folders only), then ~/.env; the first file found is loaded
.env in untrusted foldersonly GEMINI_API_KEY, GOOGLE_API_KEY, GOOGLE_CLOUD_PROJECT, GOOGLE_CLOUD_LOCATION are loaded, sanitized; in every folder, variables already set in the shell are never overridden
Proxyno settings key; read from HTTPS_PROXY, https_proxy, HTTP_PROXY, http_proxy (first one set wins)

A value like "Authorization": "Bearer $MY_TOKEN" in an MCP server's headers, or "url": "${BASE_URL:-http://localhost:8080}/mcp", is resolved at load time, which keeps secrets out of files you commit.

Is there a JSON schema for settings.json?#

Yes. Every key below comes from the generated schema at schemas/settings.schema.json in the Gemini CLI repository. Point an editor at it with a $schema entry to get validation and completion:

{
  "$schema": "https://raw.githubusercontent.com/google-gemini/gemini-cli/main/schemas/settings.schema.json",
  "general": { "defaultApprovalMode": "auto_edit" },
  "hooksConfig": { "enabled": true }
}

Invalid values are reported with the file path when Gemini CLI starts. "Restart" in the table marks keys that only take effect in a new session.

How do I configure MCP servers in settings.json?#

mcpServers maps a server name to its connection. Use command and args for a local stdio server, url with type for SSE or HTTP, or httpUrl for streamable HTTP:

{
  "mcpServers": {
    "local-tools": {
      "command": "node",
      "args": ["./mcp/server.js"],
      "env": { "API_TOKEN": "$API_TOKEN" },
      "timeout": 30000
    },
    "remote": {
      "httpUrl": "https://mcp.example.com/mcp",
      "headers": { "Authorization": "Bearer $REMOTE_TOKEN" }
    }
  }
}
FieldTypeDescription
commandstringExecutable invoked for stdio transport.
argsstring[]Command-line arguments for the stdio transport command.
envobjectEnvironment variables to set for the server process.
cwdstringWorking directory for the server process.
urlstringURL for SSE or HTTP transport. Use with "type" field to specify transport type.
httpUrlstringStreaming HTTP transport URL.
headersobjectAdditional HTTP headers sent to the server.
tcpstringTCP address for websocket transport.
typestdio | sse | httpTransport type. Use "stdio" for local command, "sse" for Server-Sent Events, or "http" for Streamable HTTP.
timeoutnumberTimeout in milliseconds for MCP requests.
trustbooleanMarks the server as trusted. Trusted servers may gain additional capabilities.
descriptionstringHuman-readable description of the server.
includeToolsstring[]Subset of tools that should be enabled for this server. When omitted all tools are enabled.
excludeToolsstring[]Tools that should be disabled for this server even if exposed.
extensionobjectMetadata describing the Gemini CLI extension that owns this MCP server.
oauthobjectOAuth configuration for authenticating with the server.
authProviderTypedynamic_discovery | google_credentials | service_account_impersonationAuthentication provider used for acquiring credentials (for example `dynamic_discovery`).
targetAudiencestringOAuth target audience (CLIENT_ID.apps.googleusercontent.com).
targetServiceAccountstringService account email to impersonate (name@project.iam.gserviceaccount.com).

trust: true adds a policy rule that allows the server's tools without a prompt, outside plan mode. mcp.allowed and mcp.excluded allow or block servers by name.

All settings.json keys#

KeyTypeDefaultMergeRestartDescription
mcpServersmap of MCPServerConfig{}shallow_mergeyesConfiguration for MCP servers.
policyPathsstring[][]unionyesAdditional policy files or directories to load.
adminPolicyPathsstring[][]unionyesAdditional admin policy files or directories to load.
generalobject——noGeneral application settings.
general.preferredEditorvscode | vscodium | windsurf | cursor | zed | antigravity | sublimetext | lapce | nova | bbedit | vim | neovim | emacs | hx | emacsclient | micro——noThe preferred editor to open files in. Must be one of the built-in supported identifiers. Use /editor in the CLI to pick interactively, or leave unset to use $VISUAL/$EDITOR.
general.openEditorInNewWindowbooleanfalse—noOpen VS Code-family editors in a new window when editing files.
general.vimModebooleanfalse—noEnable Vim keybindings
general.defaultApprovalModedefault | auto_edit | plan"default"—noThe default approval mode for tool execution. 'default' prompts for approval, 'auto_edit' auto-approves edit tools, and 'plan' is read-only mode. YOLO mode (auto-approve all actions) can only be enabled via command line (--yolo or --approval-mode=yolo).
general.devtoolsbooleanfalse—noEnable DevTools inspector on launch.
general.enableAutoUpdatebooleantrue—noEnable automatic updates.
general.enableAutoUpdateNotificationbooleantrue—noEnable update notification prompts.
general.enableNotificationsbooleanfalse—noEnable terminal run-event notifications for action-required prompts and session completion.
general.notificationMethodauto | osc9 | osc777 | bell"auto"—noHow to send terminal notifications.
general.checkpointingobject——yesSession checkpointing settings.
general.checkpointing.enabledbooleanfalse—yesEnable session checkpointing for recovery
general.planobject——yesPlanning features configuration.
general.plan.enabledbooleantrue—yesEnable Plan Mode for read-only safety during planning.
general.plan.directorystring——yesThe directory where planning artifacts are stored. If not specified, defaults to the system temporary directory. A custom directory requires a policy to allow write access in Plan Mode.
general.plan.modelRoutingbooleantrue—noAutomatically switch between Pro and Flash models based on Plan Mode status. Uses Pro for the planning phase and Flash for the implementation phase.
general.retryFetchErrorsbooleantrue—noRetry on "exception TypeError: fetch failed sending request" errors.
general.maxAttemptsnumber10—noMaximum number of attempts for requests to the main chat model. Cannot exceed 10.
general.debugKeystrokeLoggingbooleanfalse—noEnable debug logging of keystrokes to the console.
general.sessionRetentionobject——noSettings for automatic session cleanup.
general.sessionRetention.enabledbooleantrue—noEnable automatic session cleanup
general.sessionRetention.maxAgestring"30d"—noAutomatically delete chats older than this time period (e.g., "30d", "7d", "24h", "1w")
general.sessionRetention.maxCountnumber——noAlternative: Maximum number of sessions to keep (most recent)
general.sessionRetention.minRetentionstring"1d"—noMinimum retention period (safety limit, defaults to "1d")
general.topicUpdateNarrationbooleantrue—noEnable the Topic & Update communication model for reduced chattiness and structured progress reporting.
general.logRagSnippetsbooleanfalse—noLog full Code Customization (RAG) retrieved snippets to a local file for debugging.
outputobject——noSettings for the CLI output.
output.formattext | json"text"—noThe format of the CLI output. Can be `text` or `json`.
uiobject——noUser interface settings.
ui.debugRainbowbooleanfalse—yesEnable debug rainbow rendering. Only useful for debugging rendering bugs and performance issues.
ui.themestring——noThe color theme for the UI. See the CLI themes guide for available options.
ui.autoThemeSwitchingbooleantrue—noAutomatically switch between default light and dark themes based on terminal background color.
ui.terminalBackgroundPollingIntervalnumber60—noInterval in seconds to poll the terminal background color.
ui.customThemesmap of CustomTheme{}—noCustom theme definitions.
ui.hideWindowTitlebooleanfalse—yesHide the window title bar
ui.inlineThinkingModeoff | full"off"—noDisplay model thinking inline: off or full.
ui.showStatusInTitlebooleanfalse—noShow Gemini CLI model thoughts in the terminal window title during the working phase
ui.dynamicWindowTitlebooleantrue—noUpdate the terminal window title with current status icons (Ready: ◇, Action Required: ✋, Working: ✦)
ui.showHomeDirectoryWarningbooleantrue—yesShow a warning when running Gemini CLI in the home directory.
ui.showCompatibilityWarningsbooleantrue—yesShow warnings about terminal or OS compatibility issues.
ui.hideTipsbooleanfalse—noHide helpful tips in the UI
ui.escapePastedAtSymbolsbooleanfalse—noWhen enabled, @ symbols in pasted text are escaped to prevent unintended @path expansion.
ui.showShortcutsHintbooleantrue—noShow the "? for shortcuts" hint above the input.
ui.compactToolOutputbooleantrue—noDisplay tool outputs (like directory listings and file reads) in a compact, structured format.
ui.hideBannerbooleanfalse—noHide the application banner
ui.hideContextSummarybooleanfalse—noHide the context summary (GEMINI.md, MCP servers) above the input.
ui.footerobject——noSettings for the footer.
ui.footer.itemsstring[]——noList of item IDs to display in the footer. Rendered in order
ui.footer.showLabelsbooleantrue—noDisplay a second line above the footer items with descriptive headers (e.g., /model).
ui.footer.hideCWDbooleanfalse—noHide the current working directory in the footer.
ui.footer.hideSandboxStatusbooleanfalse—noHide the sandbox status indicator in the footer.
ui.footer.hideModelInfobooleanfalse—noHide the model name and context usage in the footer.
ui.footer.hideContextPercentagebooleantrue—noHides the context window usage percentage.
ui.hideFooterbooleanfalse—noHide the footer from the UI
ui.collapseDrawerDuringApprovalbooleantrue—noWhether to collapse the UI drawer when a tool is awaiting confirmation.
ui.showMemoryUsagebooleanfalse—noDisplay memory usage information in the UI
ui.showLineNumbersbooleantrue—noShow line numbers in the chat.
ui.showCitationsbooleanfalse—noShow citations for generated text in the chat.
ui.showModelInfoInChatbooleanfalse—noShow the model name in the chat for each model turn.
ui.showUserIdentitybooleantrue—noShow the signed-in user's identity (e.g. email) in the UI.
ui.useAlternateBufferbooleanfalse—yesUse an alternate screen buffer for the UI, preserving shell history.
ui.renderProcessbooleantrue—yesEnable Ink render process for the UI.
ui.terminalBufferbooleanfalse—yesUse the new terminal buffer architecture for rendering.
ui.useBackgroundColorbooleantrue—noWhether to use background colors in the UI.
ui.incrementalRenderingbooleantrue—yesEnable incremental rendering for the UI. This option will reduce flickering but may cause rendering artifacts. Only supported when useAlternateBuffer is enabled.
ui.showSpinnerbooleantrue—noShow the spinner during operations.
ui.loadingPhrasestips | witty | all | off"off"—noWhat to show while the model is working: tips, witty comments, all, or off.
ui.errorVerbositylow | full"low"—noControls whether recoverable errors are hidden (low) or fully shown (full).
ui.customWittyPhrasesstring[][]—noCustom witty phrases to display during loading. When provided, the CLI cycles through these instead of the defaults.
ui.accessibilityobject——yesAccessibility settings.
ui.accessibility.enableLoadingPhrasesbooleantrue—yes@deprecated Use ui.loadingPhrases instead. Enable loading phrases during operations.
ui.accessibility.screenReaderbooleanfalse—yesRender output in plain-text to be more screen reader accessible
ideobject——yesIDE integration settings.
ide.enabledbooleanfalse—yesEnable IDE integration mode.
ide.hasSeenNudgebooleanfalse—noWhether the user has seen the IDE integration nudge.
privacyobject——yesPrivacy-related settings.
privacy.usageStatisticsEnabledbooleantrue—yesEnable collection of usage statistics
telemetryobject——yesTelemetry configuration.
billingobject——noBilling and AI credits settings.
billing.overageStrategyask | always | never"ask"—noHow to handle quota exhaustion when AI credits are available. 'ask' prompts each time, 'always' automatically uses credits, 'never' disables credit usage.
billing.vertexAiobject——yesVertex AI request routing settings.
billing.vertexAi.requestTypededicated | shared——yesSets the X-Vertex-AI-LLM-Request-Type header for Vertex AI requests.
billing.vertexAi.sharedRequestTypepriority | flex——yesSets the X-Vertex-AI-LLM-Shared-Request-Type header for Vertex AI requests.
modelobject——noSettings related to the generative model.
model.namestring——noThe Gemini model to use for conversations.
model.maxSessionTurnsnumber-1—noMaximum number of user/model/tool turns to keep in a session. -1 means unlimited.
model.summarizeToolOutputmap of SummarizeToolOutputSettings——noEnables or disables summarization of tool output. Configure per-tool token budgets (for example {"run_shell_command": {"tokenBudget": 2000}}). Currently only the run_shell_command tool supports summarization.
model.compressionThresholdnumber0.5—yesThe fraction of context usage at which to trigger context compression (e.g. 0.2, 0.3).
model.disableLoopDetectionbooleanfalse—yesDisable automatic detection and prevention of infinite loops.
model.skipNextSpeakerCheckbooleantrue—noSkip the next speaker check.
modelConfigsobject——noModel configurations.
modelConfigs.aliasesobject(large default, see schema)—noNamed presets for model configs. Can be used in place of a model name and can inherit from other aliases using an `extends` property.
modelConfigs.customAliasesobject{}—noCustom named presets for model configs. These are merged with (and override) the built-in aliases.
modelConfigs.customOverridesany[][]—noCustom model config overrides. These are merged with (and added to) the built-in overrides.
modelConfigs.overridesany[][]—noApply specific configuration overrides based on matches, with a primary key of model (or alias). The most specific match will be used.
modelConfigs.modelDefinitionsmap of ModelDefinition(large default, see schema)—yesRegistry of model metadata, including tier, family, and features.
modelConfigs.modelIdResolutionsmap of ModelResolution(large default, see schema)—yesRules for resolving requested model names to concrete model IDs based on context.
modelConfigs.classifierIdResolutionsmap of ModelResolution(large default, see schema)—yesRules for resolving classifier tiers (flash, pro) to concrete model IDs.
modelConfigs.modelChainsmap of ModelPolicyChain(large default, see schema)—yesAvailability policy chains defining fallback behavior for models.
agentsobject——yesSettings for subagents.
agents.overridesmap of AgentOverride{}—yesOverride settings for specific agents, e.g. to disable the agent, set a custom model config, or run config.
agents.browserobject——yesSettings specific to the browser agent.
agents.browser.sessionModepersistent | isolated | existing"persistent"—yesSession mode: 'persistent', 'isolated', or 'existing'.
agents.browser.headlessbooleanfalse—yesRun browser in headless mode.
agents.browser.profilePathstring——yesPath to browser profile directory for session persistence.
agents.browser.visualModelstring——yesModel for the visual agent's analyze_screenshot tool. When set, enables the tool.
agents.browser.allowedDomainsstring[]["github.com", "*.google.com", "localhost"]—yesA list of allowed domains for the browser agent (e.g., ["github.com", "*.google.com"]).
agents.browser.disableUserInputbooleantrue—noDisable user input on browser window during automation.
agents.browser.maxActionsPerTasknumber100—noThe maximum number of tool calls allowed per browser task. Enforcement is hard: the agent will be terminated when the limit is reached.
agents.browser.confirmSensitiveActionsbooleanfalse—yesRequire manual confirmation for sensitive browser actions (e.g., fill_form, evaluate_script).
agents.browser.blockFileUploadsbooleanfalse—yesHard-block file upload requests from the browser agent.
contextobject——noSettings for managing context provided to the model.
context.fileNamestring | string[]——noThe name of the context file or files to load into memory. Accepts either a single string or an array of strings.
context.importFormatstring——noThe format to use when importing memory.
context.includeDirectoryTreebooleantrue—noWhether to include the directory tree of the current working directory in the initial request to the model.
context.discoveryMaxDirsnumber200—noMaximum number of directories to search for memory.
context.memoryBoundaryMarkersstring[][".git"]—yesFile or directory names that mark the boundary for GEMINI.md discovery. The upward traversal stops at the first directory containing any of these markers. An empty array disables parent traversal.
context.includeDirectoriesstring[][]concatnoAdditional directories to include in the workspace context. Missing directories will be skipped with a warning.
context.loadMemoryFromIncludeDirectoriesbooleanfalse—noControls how /memory reload loads GEMINI.md files. When true, include directories are scanned; when false, only the current directory is used.
context.fileFilteringobject——yesSettings for git-aware file filtering.
context.fileFiltering.respectGitIgnorebooleantrue—yesRespect .gitignore files when searching.
context.fileFiltering.respectGeminiIgnorebooleantrue—yesRespect .geminiignore files when searching.
context.fileFiltering.enableFileWatcherbooleanfalse—yesEnable file watcher updates for @ file suggestions (experimental).
context.fileFiltering.enableRecursiveFileSearchbooleantrue—yesEnable recursive file search functionality when completing @ references in the prompt.
context.fileFiltering.enableFuzzySearchbooleantrue—yesEnable fuzzy search when searching for files.
context.fileFiltering.customIgnoreFilePathsstring[][]unionyesAdditional ignore file paths to respect. These files take precedence over .geminiignore and .gitignore. Files earlier in the array take precedence over files later in the array, e.g. the first file takes precedence over the second one.
toolsobject——yesSettings for built-in and custom tools.
tools.sandboxboolean | string | object——yesLegacy full-process sandbox execution environment. Set to a boolean to enable or disable the sandbox, provide a string path to a sandbox profile, or specify an explicit sandbox command (e.g., "docker", "podman", "lxc", "windows-native").
tools.sandboxAllowedPathsstring[][]—yesList of additional paths that the sandbox is allowed to access.
tools.sandboxNetworkAccessbooleanfalse—yesWhether the sandbox is allowed to access the network.
tools.shellobject——noSettings for shell execution.
tools.shell.enableInteractiveShellbooleantrue—yesUse node-pty for an interactive shell experience. Fallback to child_process still applies.
tools.shell.backgroundCompletionBehaviorsilent | inject | notify"silent"—noControls what happens when a background shell command finishes. 'silent' (default): quietly exits in background. 'inject': automatically returns output to agent. 'notify': shows brief message in chat.
tools.shell.pagerstring"cat"—noThe pager command to use for shell output. Defaults to `cat`.
tools.shell.showColorbooleantrue—noShow color in shell output.
tools.shell.inactivityTimeoutnumber300—noThe maximum time in seconds allowed without output from the shell command. Defaults to 5 minutes.
tools.shell.enableShellOutputEfficiencybooleantrue—noEnable shell output efficiency optimizations for better performance.
tools.corestring[]——yesRestrict the set of built-in tools with an allowlist. Match semantics mirror tools.allowed; see the built-in tools documentation for available names.
tools.allowedstring[]——yesTool names that bypass the confirmation dialog. Useful for trusted commands (for example ["run_shell_command(git)", "run_shell_command(npm test)"]). See shell tool command restrictions for matching details.
tools.confirmationRequiredstring[]——yesTool names that always require user confirmation. Takes precedence over allowed tools and core tool allowlists.
tools.excludestring[]—unionyesTool names to exclude from discovery.
tools.discoveryCommandstring——yesCommand to run for tool discovery.
tools.callCommandstring——yesDefines a custom shell command for invoking discovered tools. The command must take the tool name as the first argument, read JSON arguments from stdin, and emit JSON results on stdout.
tools.useRipgrepbooleantrue—noUse ripgrep for file content search instead of the fallback implementation. Provides faster search performance.
tools.truncateToolOutputThresholdnumber40000—yesMaximum characters to show when truncating large tool outputs. Set to 0 or negative to disable truncation.
tools.disableLLMCorrectionbooleantrue—yesDisable LLM-based error correction for edit tools. When enabled, tools will fail immediately if exact string matches are not found, instead of attempting to self-correct.
mcpobject——yesSettings for Model Context Protocol (MCP) servers.
mcp.serverCommandstring——yesCommand to start an MCP server.
mcp.allowedstring[]——yesA list of MCP servers to allow.
mcp.excludedstring[]——yesA list of MCP servers to exclude.
useWriteTodosbooleantrue—noEnable the write_todos tool.
securityobject——yesSecurity-related settings.
security.toolSandboxingbooleanfalse—yesTool-level sandboxing. Isolates individual tools instead of the entire CLI process.
security.disableYoloModebooleanfalse—yesDisable YOLO mode, even if enabled by a flag.
security.disableAlwaysAllowbooleanfalse—yesDisable "Always allow" options in tool confirmation dialogs.
security.enablePermanentToolApprovalbooleanfalse—noEnable the "Allow for all future sessions" option in tool confirmation dialogs.
security.autoAddToPolicyByDefaultbooleanfalse—noWhen enabled, the "Allow for all future sessions" option becomes the default choice for low-risk tools in trusted workspaces.
security.blockGitExtensionsbooleanfalse—yesBlocks installing and loading extensions from Git.
security.allowedExtensionsstring[][]—yesList of Regex patterns for allowed extensions. If nonempty, only extensions that match the patterns in this list are allowed. Overrides the blockGitExtensions setting.
security.folderTrustobject——noSettings for folder trust.
security.folderTrust.enabledbooleantrue—yesSetting to track whether Folder trust is enabled.
security.environmentVariableRedactionobject——noSettings for environment variable redaction.
security.environmentVariableRedaction.allowedstring[][]—yesEnvironment variables to always allow (bypass redaction).
security.environmentVariableRedaction.blockedstring[][]—yesEnvironment variables to always redact.
security.environmentVariableRedaction.enabledbooleanfalse—yesEnable redaction of environment variables that may contain secrets.
security.authobject——yesAuthentication settings.
security.auth.selectedTypestring——yesThe currently selected authentication type.
security.auth.enforcedTypestring——yesThe required auth type. If this does not match the selected auth type, the user will be prompted to re-authenticate.
security.auth.useExternalboolean——yesWhether to use an external authentication flow.
security.enableConsecabooleanfalse—yesEnable the context-aware security checker. This feature uses an LLM to dynamically generate and enforce security policies for tool use based on your prompt, providing an additional layer of protection against unintended actions.
advancedobject——yesAdvanced settings for power users.
advanced.autoConfigureMemorybooleantrue—yesAutomatically configure Node.js memory limits. Note: Because memory is allocated during the initial process boot, this setting is only read from the global user settings file and ignores workspace-level overrides.
advanced.dnsResolutionOrderstring——yesThe DNS resolution order.
advanced.excludedEnvVarsstring[]["DEBUG", "DEBUG_MODE"]unionnoEnvironment variables to exclude from project context.
advanced.ignoreLocalEnvbooleanfalse—yesWhether to ignore generic .env files in the project directory.
advanced.bugCommandobject——noConfiguration for the bug report command.
experimentalobject——yesSetting to enable experimental features
experimental.gemmabooleantrue—yesEnable access to Gemma 4 models via Gemini API.
experimental.voiceModebooleanfalse—noEnable experimental voice dictation and commands (/voice, /voice model).
experimental.voiceobject——noSettings for voice mode and transcription.
experimental.voice.activationModepush-to-talk | toggle"push-to-talk"—noHow to trigger voice recording with the Space key.
experimental.voice.backendgemini-live | whisper"gemini-live"—noThe backend to use for voice transcription. Note: When using the Gemini Live backend, voice recordings are sent to Google Cloud for transcription.
experimental.voice.whisperModelggml-tiny.en.bin | ggml-base.en.bin | ggml-large-v3-turbo-q5_0.bin | ggml-large-v3-turbo-q8_0.bin"ggml-base.en.bin"—noThe Whisper model to use for local transcription.
experimental.voice.stopGracePeriodMsnumber4000—noHow long to wait for final transcription after stopping recording.
experimental.adkobject——yesSettings for the Agent Development Kit (ADK).
experimental.adk.agentSessionNoninteractiveEnabledbooleanfalse—yesEnable non-interactive agent sessions.
experimental.adk.agentSessionInteractiveEnabledbooleanfalse—yesEnable the agent session implementation for the interactive CLI.
experimental.adk.agentSessionSubagentEnabledbooleanfalse—yesRoute subagent invocations through the AgentSession protocol instead of legacy executors.
experimental.enableAgentsbooleantrue—yesEnable local and remote subagents.
experimental.worktreesbooleanfalse—yesEnable automated Git worktree management for parallel work.
experimental.extensionManagementbooleantrue—yesEnable extension management features.
experimental.extensionConfigbooleantrue—yesEnable requesting and fetching of extension settings.
experimental.extensionRegistrybooleanfalse—yesEnable extension registry explore UI.
experimental.extensionRegistryURIstring"https://geminicli.com/extensions.json"—yesThe URI (web URL or local file path) of the extension registry.
experimental.extensionReloadingbooleanfalse—yesEnables extension loading/unloading within the CLI session.
experimental.useOSC52Pastebooleanfalse—noUse OSC 52 for pasting. This may be more robust than the default system when using remote terminal sessions (if your terminal is configured to allow it).
experimental.useOSC52Copybooleanfalse—noUse OSC 52 for copying. This may be more robust than the default system when using remote terminal sessions (if your terminal is configured to allow it).
experimental.taskTrackerbooleanfalse—yesEnable task tracker tools.
experimental.modelSteeringbooleanfalse—noEnable model steering (user hints) to guide the model during tool execution.
experimental.directWebFetchbooleanfalse—yesEnable web fetch behavior that bypasses LLM summarization.
experimental.dynamicModelConfigurationbooleanfalse—yesEnable dynamic model configuration (definitions, resolutions, and chains) via settings.
experimental.gemmaModelRouterobject——yesEnable Gemma model router (experimental).
experimental.gemmaModelRouter.enabledbooleanfalse—yesEnable the Gemma Model Router (experimental). Requires a local endpoint serving Gemma via the Gemini API using LiteRT-LM shim.
experimental.gemmaModelRouter.autoStartServerbooleanfalse—yesAutomatically start the LiteRT-LM server when Gemini CLI starts and the Gemma router is enabled.
experimental.gemmaModelRouter.binaryPathstring""—yesCustom path to the LiteRT-LM binary. Leave empty to use the default location (~/.gemini/bin/litert/).
experimental.gemmaModelRouter.classifierobject——yesClassifier configuration.
experimental.gemmaModelRouter.classifier.hoststring"http://localhost:9379"—yesThe host of the classifier.
experimental.gemmaModelRouter.classifier.modelstring"gemma3-1b-gpu-custom"—yesThe model to use for the classifier. Only tested on `gemma3-1b-gpu-custom`.
experimental.stressTestProfilebooleanfalse—yesSignificantly lowers token limits to force early garbage collection and distillation for testing purposes.
experimental.autoMemorybooleanfalse—yesAutomatically extract memory patches and skills from past sessions in the background. Every change is written as a unified diff `.patch` file under `<projectMemoryDir>/.inbox/<kind>/` and held for review in /memory inbox; nothing is applied until you approve it.
experimental.generalistProfilebooleanfalse—yesSuitable for general coding and software development tasks.
experimental.powerUserProfilebooleanfalse—yesLess cache friendly version of the generalist profile.
experimental.contextManagementbooleanfalse—yesEnable logic for context management.
experimental.topicUpdateNarrationbooleanfalse—noDeprecated: Use general.topicUpdateNarration instead.
extensionsobject——yesSettings for extensions.
extensions.disabledstring[][]unionyesList of disabled extensions.
extensions.workspacesWithMigrationNudgestring[][]unionnoList of workspaces for which the migration nudge has been shown.
skillsobject——yesSettings for agent skills.
skills.enabledbooleantrue—yesEnable Agent Skills.
skills.disabledstring[][]unionyesList of disabled skills.
hooksConfigobject——noHook configurations for intercepting and customizing agent behavior.
hooksConfig.enabledbooleantrue—yesCanonical toggle for the hooks system. When disabled, no hooks will be executed.
hooksConfig.disabledstring[][]unionnoList of hook names (commands) that should be disabled. Hooks in this list will not execute even if configured.
hooksConfig.notificationsbooleantrue—noShow visual indicators when hooks are executing.
hooksmap of any[]——noEvent-specific hook configurations.
hooks.BeforeToolobject[][]concatnoHooks that execute before tool execution. Can intercept, validate, or modify tool calls.
hooks.AfterToolobject[][]concatnoHooks that execute after tool execution. Can process results, log outputs, or trigger follow-up actions.
hooks.BeforeAgentobject[][]concatnoHooks that execute before agent loop starts. Can set up context or initialize resources.
hooks.AfterAgentobject[][]concatnoHooks that execute after agent loop completes. Can perform cleanup or summarize results.
hooks.Notificationobject[][]concatnoHooks that execute on notification events (errors, warnings, info). Can log or alert on specific conditions.
hooks.SessionStartobject[][]concatnoHooks that execute when a session starts. Can initialize session-specific resources or state.
hooks.SessionEndobject[][]concatnoHooks that execute when a session ends. Can perform cleanup or persist session data.
hooks.PreCompressobject[][]concatnoHooks that execute before chat history compression. Can back up or analyze conversation before compression.
hooks.BeforeModelobject[][]concatnoHooks that execute before LLM requests. Can modify prompts, inject context, or control model parameters.
hooks.AfterModelobject[][]concatnoHooks that execute after LLM responses. Can process outputs, extract information, or log interactions.
hooks.BeforeToolSelectionobject[][]concatnoHooks that execute before tool selection. Can filter or prioritize available tools dynamically.
contextManagementobject——yesSettings for agent history and tool distillation context management.
contextManagement.historyWindowobject——yes—
contextManagement.historyWindow.maxTokensnumber150000—yesThe number of tokens to allow before triggering compression.
contextManagement.historyWindow.retainedTokensnumber40000—yesThe number of tokens to always retain.
contextManagement.messageLimitsobject——yes—
contextManagement.messageLimits.normalMaxTokensnumber2500—yesThe target number of tokens to budget for a normal conversation turn.
contextManagement.messageLimits.retainedMaxTokensnumber12000—yesThe maximum number of tokens a single conversation turn can consume before truncation.
contextManagement.messageLimits.normalizationHeadRationumber0.25—yesThe ratio of tokens to retain from the beginning of a truncated message (0.0 to 1.0).
contextManagement.toolsobject——yes—
contextManagement.tools.distillationobject——yes—
contextManagement.tools.distillation.maxOutputTokensnumber10000—yesMaximum tokens to show to the model when truncating large tool outputs.
contextManagement.tools.distillation.summarizationThresholdTokensnumber20000—yesThreshold above which truncated tool outputs will be summarized by an LLM.
contextManagement.tools.outputMaskingobject——yesAdvanced settings for tool output masking to manage context window efficiency.
contextManagement.tools.outputMasking.protectionThresholdTokensnumber50000—yesMinimum number of tokens to protect from masking (most recent tool outputs).
contextManagement.tools.outputMasking.minPrunableThresholdTokensnumber30000—yesMinimum prunable tokens required to trigger a masking pass.
contextManagement.tools.outputMasking.protectLatestTurnbooleantrue—yesEnsures the absolute latest turn is never masked, regardless of token count.
adminobject—replacenoSettings configured remotely by enterprise admins.
admin.secureModeEnabledbooleanfalsereplacenoIf true, disallows YOLO mode and "Always allow" options from being used.
admin.extensionsobject—replacenoExtensions-specific admin settings.
admin.extensions.enabledbooleantruereplacenoIf false, disallows extensions from being installed or used.
admin.mcpobject—replacenoMCP-specific admin settings.
admin.mcp.enabledbooleantruereplacenoIf false, disallows MCP servers from being used.
admin.mcp.configmap of MCPServerConfig{}replacenoAdmin-configured MCP servers (allowlist).
admin.mcp.requiredConfigmap of RequiredMcpServerConfig{}replacenoAdmin-required MCP servers that are always injected.
admin.skillsobject—replacenoAgent Skills-specific admin settings.
admin.skills.enabledbooleantruereplacenoIf false, disallows agent skills from being used.

Frequently asked questions#

Where is the Gemini CLI settings.json file?#

Your user settings are in ~/.gemini/settings.json (on Windows %USERPROFILE%\.gemini\settings.json), and project settings in .gemini/settings.json at the project root. System-wide files live in /etc/gemini-cli/ on Linux, /Library/Application Support/GeminiCli/ on macOS and C:\ProgramData\gemini-cli\ on Windows: system-defaults.json below user settings and settings.json above everything.

Which settings file wins in Gemini CLI?#

The system override file wins, then the project .gemini/settings.json, then ~/.gemini/settings.json, then system-defaults.json, then built-in defaults. Hook arrays, mcpServers, tools.exclude, context.includeDirectories and a few other lists combine across files instead of replacing each other. Project settings are skipped entirely in untrusted folders.

How do I set a proxy for Gemini CLI?#

There is no proxy key in settings.json. Gemini CLI reads the proxy from the HTTPS_PROXY, https_proxy, HTTP_PROXY or http_proxy environment variable, taking the first one that is set. Export it in your shell profile, or put it in a .env file such as ~/.env; .env files supply it only in trusted folders.

How do I put an API key in Gemini CLI settings?#

Keep the key out of settings.json. Set GEMINI_API_KEY in your environment or in a .env file: ~/.env is always read, .gemini/.env files only in trusted folders. For values that must appear in settings, such as an MCP server token, write "$MY_TOKEN" or "${MY_TOKEN}" and the variable is substituted when the file loads.

Can I use comments in Gemini CLI settings.json?#

Yes. Gemini CLI strips JSON comments before parsing, so // and /* */ comments are allowed in every settings.json layer, and trustedFolders.json is read the same way. Editors that validate against the schema may still flag comments unless the file is opened as JSON with comments (JSONC).

Why are my project settings ignored?#

Project settings in .gemini/settings.json apply only in trusted folders. In an untrusted folder Gemini CLI merges system and user settings and skips the project file, along with its hooks. Trust the folder when prompted, add it to ~/.gemini/trustedFolders.json, or start with --skip-trust for a single session.

Sources

Release-by-release changes: Gemini CLI version tracker. All Gemini CLI pages: Gemini CLI reference index.