2025-12-01 11:38:48 -08:00
|
|
|
|
# Gemini CLI configuration
|
2025-05-15 20:04:33 -07:00
|
|
|
|
|
2025-12-01 11:38:48 -08:00
|
|
|
|
> **Note on configuration format, 9/17/25:** The format of the `settings.json`
|
2025-10-09 08:17:37 -04:00
|
|
|
|
> file has been updated to a new, more organized structure.
|
2025-10-01 16:24:29 -07:00
|
|
|
|
>
|
2025-10-09 08:17:37 -04:00
|
|
|
|
> - The new format will be supported in the stable release starting
|
|
|
|
|
|
> **[09/10/25]**.
|
|
|
|
|
|
> - Automatic migration from the old format to the new format will begin on
|
|
|
|
|
|
> **[09/17/25]**.
|
2025-10-01 16:24:29 -07:00
|
|
|
|
>
|
2025-10-09 08:17:37 -04:00
|
|
|
|
> For details on the previous format, please see the
|
|
|
|
|
|
> [v1 Configuration documentation](./configuration-v1.md).
|
2025-08-28 15:31:33 -07:00
|
|
|
|
|
2025-10-09 08:17:37 -04:00
|
|
|
|
Gemini CLI offers several ways to configure its behavior, including environment
|
|
|
|
|
|
variables, command-line arguments, and settings files. This document outlines
|
|
|
|
|
|
the different configuration methods and available settings.
|
2025-05-15 20:04:33 -07:00
|
|
|
|
|
2025-06-20 09:39:21 -07:00
|
|
|
|
## Configuration layers
|
2025-05-15 20:04:33 -07:00
|
|
|
|
|
2025-10-09 08:17:37 -04:00
|
|
|
|
Configuration is applied in the following order of precedence (lower numbers are
|
|
|
|
|
|
overridden by higher numbers):
|
2025-05-15 20:04:33 -07:00
|
|
|
|
|
2025-06-20 09:39:21 -07:00
|
|
|
|
1. **Default values:** Hardcoded defaults within the application.
|
2025-10-09 08:17:37 -04:00
|
|
|
|
2. **System defaults file:** System-wide default settings that can be
|
|
|
|
|
|
overridden by other settings files.
|
2025-08-24 21:21:22 -07:00
|
|
|
|
3. **User settings file:** Global settings for the current user.
|
|
|
|
|
|
4. **Project settings file:** Project-specific settings.
|
2025-10-09 08:17:37 -04:00
|
|
|
|
5. **System settings file:** System-wide settings that override all other
|
|
|
|
|
|
settings files.
|
|
|
|
|
|
6. **Environment variables:** System-wide or session-specific variables,
|
|
|
|
|
|
potentially loaded from `.env` files.
|
2025-08-24 21:21:22 -07:00
|
|
|
|
7. **Command-line arguments:** Values passed when launching the CLI.
|
2025-05-15 20:04:33 -07:00
|
|
|
|
|
2025-07-09 21:16:42 +00:00
|
|
|
|
## Settings files
|
2025-05-15 20:04:33 -07:00
|
|
|
|
|
2025-10-09 08:17:37 -04:00
|
|
|
|
Gemini CLI uses JSON settings files for persistent configuration. There are four
|
|
|
|
|
|
locations for these files:
|
2025-05-15 20:04:33 -07:00
|
|
|
|
|
2025-11-02 20:42:49 -05:00
|
|
|
|
> **Tip:** JSON-aware editors can use autocomplete and validation by pointing to
|
|
|
|
|
|
> the generated schema at `schemas/settings.schema.json` in this repository.
|
|
|
|
|
|
> When working outside the repo, reference the hosted schema at
|
|
|
|
|
|
> `https://raw.githubusercontent.com/google-gemini/gemini-cli/main/schemas/settings.schema.json`.
|
|
|
|
|
|
|
2025-08-24 21:21:22 -07:00
|
|
|
|
- **System defaults file:**
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- **Location:** `/etc/gemini-cli/system-defaults.json` (Linux),
|
|
|
|
|
|
`C:\ProgramData\gemini-cli\system-defaults.json` (Windows) or
|
|
|
|
|
|
`/Library/Application Support/GeminiCli/system-defaults.json` (macOS). The
|
|
|
|
|
|
path can be overridden using the `GEMINI_CLI_SYSTEM_DEFAULTS_PATH`
|
|
|
|
|
|
environment variable.
|
|
|
|
|
|
- **Scope:** Provides a base layer of system-wide default settings. These
|
|
|
|
|
|
settings have the lowest precedence and are intended to be overridden by
|
|
|
|
|
|
user, project, or system override settings.
|
2025-06-20 09:39:21 -07:00
|
|
|
|
- **User settings file:**
|
2025-05-15 20:04:33 -07:00
|
|
|
|
- **Location:** `~/.gemini/settings.json` (where `~` is your home directory).
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- **Scope:** Applies to all Gemini CLI sessions for the current user. User
|
|
|
|
|
|
settings override system defaults.
|
2025-06-20 09:39:21 -07:00
|
|
|
|
- **Project settings file:**
|
2025-05-15 20:04:33 -07:00
|
|
|
|
- **Location:** `.gemini/settings.json` within your project's root directory.
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- **Scope:** Applies only when running Gemini CLI from that specific project.
|
|
|
|
|
|
Project settings override user settings and system defaults.
|
2025-07-09 21:16:42 +00:00
|
|
|
|
- **System settings file:**
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- **Location:** `/etc/gemini-cli/settings.json` (Linux),
|
|
|
|
|
|
`C:\ProgramData\gemini-cli\settings.json` (Windows) or
|
|
|
|
|
|
`/Library/Application Support/GeminiCli/settings.json` (macOS). The path can
|
|
|
|
|
|
be overridden using the `GEMINI_CLI_SYSTEM_SETTINGS_PATH` environment
|
|
|
|
|
|
variable.
|
|
|
|
|
|
- **Scope:** Applies to all Gemini CLI sessions on the system, for all users.
|
|
|
|
|
|
System settings act as overrides, taking precedence over all other settings
|
|
|
|
|
|
files. May be useful for system administrators at enterprises to have
|
|
|
|
|
|
controls over users' Gemini CLI setups.
|
|
|
|
|
|
|
|
|
|
|
|
**Note on environment variables in settings:** String values within your
|
2025-10-23 11:47:08 -04:00
|
|
|
|
`settings.json` and `gemini-extension.json` files can reference environment
|
|
|
|
|
|
variables using either `$VAR_NAME` or `${VAR_NAME}` syntax. These variables will
|
|
|
|
|
|
be automatically resolved when the settings are loaded. For example, if you have
|
|
|
|
|
|
an environment variable `MY_API_TOKEN`, you could use it in `settings.json` like
|
|
|
|
|
|
this: `"apiKey": "$MY_API_TOKEN"`. Additionally, each extension can have its own
|
|
|
|
|
|
`.env` file in its directory, which will be loaded automatically.
|
2025-10-09 08:17:37 -04:00
|
|
|
|
|
|
|
|
|
|
> **Note for Enterprise Users:** For guidance on deploying and managing Gemini
|
|
|
|
|
|
> CLI in a corporate environment, please see the
|
|
|
|
|
|
> [Enterprise Configuration](../cli/enterprise.md) documentation.
|
2025-08-20 17:04:03 +00:00
|
|
|
|
|
2025-06-20 09:39:21 -07:00
|
|
|
|
### The `.gemini` directory in your project
|
2025-05-15 20:04:33 -07:00
|
|
|
|
|
2025-10-09 08:17:37 -04:00
|
|
|
|
In addition to a project settings file, a project's `.gemini` directory can
|
|
|
|
|
|
contain other project-specific files related to Gemini CLI's operation, such as:
|
2025-05-15 20:04:33 -07:00
|
|
|
|
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- [Custom sandbox profiles](#sandboxing) (e.g.,
|
|
|
|
|
|
`.gemini/sandbox-macos-custom.sb`, `.gemini/sandbox.Dockerfile`).
|
2025-05-15 20:04:33 -07:00
|
|
|
|
|
2025-08-28 15:31:33 -07:00
|
|
|
|
### Available settings in `settings.json`
|
2025-05-15 20:04:33 -07:00
|
|
|
|
|
2025-10-09 08:17:37 -04:00
|
|
|
|
Settings are organized into categories. All settings should be placed within
|
|
|
|
|
|
their corresponding top-level category object in your `settings.json` file.
|
2025-05-31 12:49:28 -07:00
|
|
|
|
|
2025-11-02 20:42:49 -05:00
|
|
|
|
<!-- SETTINGS-AUTOGEN:START -->
|
|
|
|
|
|
|
2025-08-28 15:31:33 -07:00
|
|
|
|
#### `general`
|
2025-06-14 00:00:24 -07:00
|
|
|
|
|
2025-11-18 12:01:16 -05:00
|
|
|
|
- **`general.previewFeatures`** (boolean):
|
|
|
|
|
|
- **Description:** Enable preview features (e.g., preview models).
|
|
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **`general.preferredEditor`** (string):
|
|
|
|
|
|
- **Description:** The preferred editor to open files in.
|
|
|
|
|
|
- **Default:** `undefined`
|
|
|
|
|
|
|
|
|
|
|
|
- **`general.vimMode`** (boolean):
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Description:** Enable Vim keybindings
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
|
2026-01-16 23:33:49 +01:00
|
|
|
|
- **`general.enableAutoUpdate`** (boolean):
|
|
|
|
|
|
- **Description:** Enable automatic updates.
|
|
|
|
|
|
- **Default:** `true`
|
2025-08-28 15:31:33 -07:00
|
|
|
|
|
2026-01-16 23:33:49 +01:00
|
|
|
|
- **`general.enableAutoUpdateNotification`** (boolean):
|
|
|
|
|
|
- **Description:** Enable update notification prompts.
|
|
|
|
|
|
- **Default:** `true`
|
2025-06-03 21:40:46 -07:00
|
|
|
|
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **`general.checkpointing.enabled`** (boolean):
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Description:** Enable session checkpointing for recovery
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **Default:** `false`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-08-21 23:31:39 -07:00
|
|
|
|
|
2025-10-13 12:57:23 -07:00
|
|
|
|
- **`general.enablePromptCompletion`** (boolean):
|
|
|
|
|
|
- **Description:** Enable AI-powered prompt completion suggestions while
|
|
|
|
|
|
typing.
|
|
|
|
|
|
- **Default:** `false`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
|
|
|
|
|
|
|
|
|
|
|
- **`general.retryFetchErrors`** (boolean):
|
|
|
|
|
|
- **Description:** Retry on "exception TypeError: fetch failed sending
|
|
|
|
|
|
request" errors.
|
|
|
|
|
|
- **Default:** `false`
|
2025-10-13 12:57:23 -07:00
|
|
|
|
|
|
|
|
|
|
- **`general.debugKeystrokeLogging`** (boolean):
|
|
|
|
|
|
- **Description:** Enable debug logging of keystrokes to the console.
|
|
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
|
|
|
|
|
|
- **`general.sessionRetention.enabled`** (boolean):
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Description:** Enable automatic session cleanup
|
2025-10-13 12:57:23 -07:00
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **`general.sessionRetention.maxAge`** (string):
|
|
|
|
|
|
- **Description:** Maximum age of sessions to keep (e.g., "30d", "7d", "24h",
|
|
|
|
|
|
"1w")
|
|
|
|
|
|
- **Default:** `undefined`
|
|
|
|
|
|
|
|
|
|
|
|
- **`general.sessionRetention.maxCount`** (number):
|
|
|
|
|
|
- **Description:** Alternative: Maximum number of sessions to keep (most
|
|
|
|
|
|
recent)
|
|
|
|
|
|
- **Default:** `undefined`
|
|
|
|
|
|
|
|
|
|
|
|
- **`general.sessionRetention.minRetention`** (string):
|
|
|
|
|
|
- **Description:** Minimum retention period (safety limit, defaults to "1d")
|
|
|
|
|
|
- **Default:** `"1d"`
|
|
|
|
|
|
|
2025-09-11 05:19:47 +09:00
|
|
|
|
#### `output`
|
|
|
|
|
|
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **`output.format`** (enum):
|
2026-01-09 14:28:09 -08:00
|
|
|
|
- **Description:** The format of the CLI output. Can be `text` or `json`.
|
2025-09-11 05:19:47 +09:00
|
|
|
|
- **Default:** `"text"`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Values:** `"text"`, `"json"`
|
2025-09-11 05:19:47 +09:00
|
|
|
|
|
2025-08-28 15:31:33 -07:00
|
|
|
|
#### `ui`
|
2025-08-21 23:31:39 -07:00
|
|
|
|
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **`ui.theme`** (string):
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Description:** The color theme for the UI. See the CLI themes guide for
|
|
|
|
|
|
available options.
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **Default:** `undefined`
|
|
|
|
|
|
|
|
|
|
|
|
- **`ui.customThemes`** (object):
|
|
|
|
|
|
- **Description:** Custom theme definitions.
|
|
|
|
|
|
- **Default:** `{}`
|
|
|
|
|
|
|
|
|
|
|
|
- **`ui.hideWindowTitle`** (boolean):
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Description:** Hide the window title bar
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **Default:** `false`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-08-28 15:31:33 -07:00
|
|
|
|
|
2025-10-13 12:57:23 -07:00
|
|
|
|
- **`ui.showStatusInTitle`** (boolean):
|
2026-01-12 17:18:14 -08:00
|
|
|
|
- **Description:** Show Gemini CLI model thoughts in the terminal window title
|
|
|
|
|
|
during the working phase
|
2025-10-13 12:57:23 -07:00
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
|
2026-01-12 17:18:14 -08:00
|
|
|
|
- **`ui.dynamicWindowTitle`** (boolean):
|
|
|
|
|
|
- **Description:** Update the terminal window title with current status icons
|
|
|
|
|
|
(Ready: ◇, Action Required: ✋, Working: ✦)
|
|
|
|
|
|
- **Default:** `true`
|
|
|
|
|
|
|
2026-01-09 11:56:22 -08:00
|
|
|
|
- **`ui.showHomeDirectoryWarning`** (boolean):
|
|
|
|
|
|
- **Description:** Show a warning when running Gemini CLI in the home
|
|
|
|
|
|
directory.
|
|
|
|
|
|
- **Default:** `true`
|
|
|
|
|
|
- **Requires restart:** Yes
|
|
|
|
|
|
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **`ui.hideTips`** (boolean):
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Description:** Hide helpful tips in the UI
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
|
|
|
|
|
|
- **`ui.hideBanner`** (boolean):
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Description:** Hide the application banner
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
|
2025-10-13 12:57:23 -07:00
|
|
|
|
- **`ui.hideContextSummary`** (boolean):
|
|
|
|
|
|
- **Description:** Hide the context summary (GEMINI.md, MCP servers) above the
|
|
|
|
|
|
input.
|
|
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
|
|
|
|
|
|
- **`ui.footer.hideCWD`** (boolean):
|
|
|
|
|
|
- **Description:** Hide the current working directory path in the footer.
|
|
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
|
|
|
|
|
|
- **`ui.footer.hideSandboxStatus`** (boolean):
|
|
|
|
|
|
- **Description:** Hide the sandbox status indicator in the footer.
|
|
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
|
|
|
|
|
|
- **`ui.footer.hideModelInfo`** (boolean):
|
|
|
|
|
|
- **Description:** Hide the model name and context usage in the footer.
|
|
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **`ui.footer.hideContextPercentage`** (boolean):
|
|
|
|
|
|
- **Description:** Hides the context window remaining percentage.
|
|
|
|
|
|
- **Default:** `true`
|
|
|
|
|
|
|
|
|
|
|
|
- **`ui.hideFooter`** (boolean):
|
|
|
|
|
|
- **Description:** Hide the footer from the UI
|
|
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **`ui.showMemoryUsage`** (boolean):
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Description:** Display memory usage information in the UI
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
|
|
|
|
|
|
- **`ui.showLineNumbers`** (boolean):
|
|
|
|
|
|
- **Description:** Show line numbers in the chat.
|
2025-11-18 19:33:40 -08:00
|
|
|
|
- **Default:** `true`
|
2025-08-28 15:31:33 -07:00
|
|
|
|
|
2025-09-02 09:36:24 -07:00
|
|
|
|
- **`ui.showCitations`** (boolean):
|
|
|
|
|
|
- **Description:** Show citations for generated text in the chat.
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Default:** `false`
|
2025-09-02 09:36:24 -07:00
|
|
|
|
|
2025-11-13 19:11:06 -08:00
|
|
|
|
- **`ui.showModelInfoInChat`** (boolean):
|
|
|
|
|
|
- **Description:** Show the model name in the chat for each model turn.
|
|
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
|
2026-01-28 16:26:33 -05:00
|
|
|
|
- **`ui.showUserIdentity`** (boolean):
|
|
|
|
|
|
- **Description:** Show the logged-in user's identity (e.g. email) in the UI.
|
|
|
|
|
|
- **Default:** `true`
|
|
|
|
|
|
|
2025-11-03 13:41:58 -08:00
|
|
|
|
- **`ui.useAlternateBuffer`** (boolean):
|
|
|
|
|
|
- **Description:** Use an alternate screen buffer for the UI, preserving shell
|
|
|
|
|
|
history.
|
2025-11-21 17:30:38 -08:00
|
|
|
|
- **Default:** `false`
|
2025-11-03 13:41:58 -08:00
|
|
|
|
- **Requires restart:** Yes
|
|
|
|
|
|
|
2026-01-26 15:23:54 -08:00
|
|
|
|
- **`ui.useBackgroundColor`** (boolean):
|
|
|
|
|
|
- **Description:** Whether to use background colors in the UI.
|
|
|
|
|
|
- **Default:** `true`
|
|
|
|
|
|
|
2025-11-13 09:45:03 -08:00
|
|
|
|
- **`ui.incrementalRendering`** (boolean):
|
|
|
|
|
|
- **Description:** Enable incremental rendering for the UI. This option will
|
|
|
|
|
|
reduce flickering but may cause rendering artifacts. Only supported when
|
|
|
|
|
|
useAlternateBuffer is enabled.
|
|
|
|
|
|
- **Default:** `true`
|
|
|
|
|
|
- **Requires restart:** Yes
|
|
|
|
|
|
|
2026-01-26 16:06:58 -08:00
|
|
|
|
- **`ui.showSpinner`** (boolean):
|
|
|
|
|
|
- **Description:** Show the spinner during operations.
|
|
|
|
|
|
- **Default:** `true`
|
|
|
|
|
|
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **`ui.customWittyPhrases`** (array):
|
|
|
|
|
|
- **Description:** Custom witty phrases to display during loading. When
|
|
|
|
|
|
provided, the CLI cycles through these instead of the defaults.
|
|
|
|
|
|
- **Default:** `[]`
|
|
|
|
|
|
|
2026-01-16 23:33:49 +01:00
|
|
|
|
- **`ui.accessibility.enableLoadingPhrases`** (boolean):
|
|
|
|
|
|
- **Description:** Enable loading phrases during operations.
|
|
|
|
|
|
- **Default:** `true`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-08-21 23:31:39 -07:00
|
|
|
|
|
2025-10-10 15:34:44 -04:00
|
|
|
|
- **`ui.accessibility.screenReader`** (boolean):
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Description:** Render output in plain-text to be more screen reader
|
|
|
|
|
|
accessible
|
2025-10-10 15:34:44 -04:00
|
|
|
|
- **Default:** `false`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-10-01 21:22:26 +05:30
|
|
|
|
|
2025-08-28 15:31:33 -07:00
|
|
|
|
#### `ide`
|
2025-08-21 23:31:39 -07:00
|
|
|
|
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **`ide.enabled`** (boolean):
|
2026-01-09 14:28:09 -08:00
|
|
|
|
- **Description:** Enable IDE integration mode.
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **Default:** `false`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-08-28 15:31:33 -07:00
|
|
|
|
|
|
|
|
|
|
- **`ide.hasSeenNudge`** (boolean):
|
|
|
|
|
|
- **Description:** Whether the user has seen the IDE integration nudge.
|
|
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
|
|
|
|
|
|
#### `privacy`
|
|
|
|
|
|
|
|
|
|
|
|
- **`privacy.usageStatisticsEnabled`** (boolean):
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Description:** Enable collection of usage statistics
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **Default:** `true`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-08-28 15:31:33 -07:00
|
|
|
|
|
|
|
|
|
|
#### `model`
|
|
|
|
|
|
|
|
|
|
|
|
- **`model.name`** (string):
|
|
|
|
|
|
- **Description:** The Gemini model to use for conversations.
|
|
|
|
|
|
- **Default:** `undefined`
|
|
|
|
|
|
|
|
|
|
|
|
- **`model.maxSessionTurns`** (number):
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- **Description:** Maximum number of user/model/tool turns to keep in a
|
|
|
|
|
|
session. -1 means unlimited.
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **Default:** `-1`
|
|
|
|
|
|
|
|
|
|
|
|
- **`model.summarizeToolOutput`** (object):
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Description:** Enables 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.
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **Default:** `undefined`
|
|
|
|
|
|
|
2025-10-30 16:03:58 -07:00
|
|
|
|
- **`model.compressionThreshold`** (number):
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Description:** The fraction of context usage at which to trigger context
|
|
|
|
|
|
compression (e.g. 0.2, 0.3).
|
2025-11-20 11:43:35 -08:00
|
|
|
|
- **Default:** `0.5`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-08-28 15:31:33 -07:00
|
|
|
|
|
|
|
|
|
|
- **`model.skipNextSpeakerCheck`** (boolean):
|
|
|
|
|
|
- **Description:** Skip the next speaker check.
|
2025-10-13 21:31:45 -07:00
|
|
|
|
- **Default:** `true`
|
|
|
|
|
|
|
2025-11-05 17:18:42 -08:00
|
|
|
|
#### `modelConfigs`
|
|
|
|
|
|
|
|
|
|
|
|
- **`modelConfigs.aliases`** (object):
|
|
|
|
|
|
- **Description:** Named presets for model configs. Can be used in place of a
|
|
|
|
|
|
model name and can inherit from other aliases using an `extends` property.
|
|
|
|
|
|
- **Default:**
|
2025-11-21 09:59:34 -08:00
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
{
|
|
|
|
|
|
"base": {
|
|
|
|
|
|
"modelConfig": {
|
|
|
|
|
|
"generateContentConfig": {
|
|
|
|
|
|
"temperature": 0,
|
|
|
|
|
|
"topP": 1
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"chat-base": {
|
|
|
|
|
|
"extends": "base",
|
|
|
|
|
|
"modelConfig": {
|
|
|
|
|
|
"generateContentConfig": {
|
|
|
|
|
|
"thinkingConfig": {
|
|
|
|
|
|
"includeThoughts": true
|
|
|
|
|
|
},
|
|
|
|
|
|
"temperature": 1,
|
|
|
|
|
|
"topP": 0.95,
|
|
|
|
|
|
"topK": 64
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"chat-base-2.5": {
|
|
|
|
|
|
"extends": "chat-base",
|
|
|
|
|
|
"modelConfig": {
|
|
|
|
|
|
"generateContentConfig": {
|
|
|
|
|
|
"thinkingConfig": {
|
|
|
|
|
|
"thinkingBudget": 8192
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"chat-base-3": {
|
|
|
|
|
|
"extends": "chat-base",
|
|
|
|
|
|
"modelConfig": {
|
|
|
|
|
|
"generateContentConfig": {
|
|
|
|
|
|
"thinkingConfig": {
|
|
|
|
|
|
"thinkingLevel": "HIGH"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"gemini-3-pro-preview": {
|
|
|
|
|
|
"extends": "chat-base-3",
|
|
|
|
|
|
"modelConfig": {
|
|
|
|
|
|
"model": "gemini-3-pro-preview"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-12-17 09:43:21 -08:00
|
|
|
|
"gemini-3-flash-preview": {
|
|
|
|
|
|
"extends": "chat-base-3",
|
|
|
|
|
|
"modelConfig": {
|
|
|
|
|
|
"model": "gemini-3-flash-preview"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-11-21 09:59:34 -08:00
|
|
|
|
"gemini-2.5-pro": {
|
|
|
|
|
|
"extends": "chat-base-2.5",
|
|
|
|
|
|
"modelConfig": {
|
|
|
|
|
|
"model": "gemini-2.5-pro"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"gemini-2.5-flash": {
|
|
|
|
|
|
"extends": "chat-base-2.5",
|
|
|
|
|
|
"modelConfig": {
|
|
|
|
|
|
"model": "gemini-2.5-flash"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"gemini-2.5-flash-lite": {
|
|
|
|
|
|
"extends": "chat-base-2.5",
|
|
|
|
|
|
"modelConfig": {
|
|
|
|
|
|
"model": "gemini-2.5-flash-lite"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"gemini-2.5-flash-base": {
|
|
|
|
|
|
"extends": "base",
|
|
|
|
|
|
"modelConfig": {
|
|
|
|
|
|
"model": "gemini-2.5-flash"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"classifier": {
|
|
|
|
|
|
"extends": "base",
|
|
|
|
|
|
"modelConfig": {
|
|
|
|
|
|
"model": "gemini-2.5-flash-lite",
|
|
|
|
|
|
"generateContentConfig": {
|
|
|
|
|
|
"maxOutputTokens": 1024,
|
|
|
|
|
|
"thinkingConfig": {
|
|
|
|
|
|
"thinkingBudget": 512
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"prompt-completion": {
|
|
|
|
|
|
"extends": "base",
|
|
|
|
|
|
"modelConfig": {
|
|
|
|
|
|
"model": "gemini-2.5-flash-lite",
|
|
|
|
|
|
"generateContentConfig": {
|
|
|
|
|
|
"temperature": 0.3,
|
|
|
|
|
|
"maxOutputTokens": 16000,
|
|
|
|
|
|
"thinkingConfig": {
|
|
|
|
|
|
"thinkingBudget": 0
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"edit-corrector": {
|
|
|
|
|
|
"extends": "base",
|
|
|
|
|
|
"modelConfig": {
|
|
|
|
|
|
"model": "gemini-2.5-flash-lite",
|
|
|
|
|
|
"generateContentConfig": {
|
|
|
|
|
|
"thinkingConfig": {
|
|
|
|
|
|
"thinkingBudget": 0
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"summarizer-default": {
|
|
|
|
|
|
"extends": "base",
|
|
|
|
|
|
"modelConfig": {
|
|
|
|
|
|
"model": "gemini-2.5-flash-lite",
|
|
|
|
|
|
"generateContentConfig": {
|
|
|
|
|
|
"maxOutputTokens": 2000
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"summarizer-shell": {
|
|
|
|
|
|
"extends": "base",
|
|
|
|
|
|
"modelConfig": {
|
|
|
|
|
|
"model": "gemini-2.5-flash-lite",
|
|
|
|
|
|
"generateContentConfig": {
|
|
|
|
|
|
"maxOutputTokens": 2000
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"web-search": {
|
|
|
|
|
|
"extends": "gemini-2.5-flash-base",
|
|
|
|
|
|
"modelConfig": {
|
|
|
|
|
|
"generateContentConfig": {
|
|
|
|
|
|
"tools": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"googleSearch": {}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"web-fetch": {
|
|
|
|
|
|
"extends": "gemini-2.5-flash-base",
|
|
|
|
|
|
"modelConfig": {
|
|
|
|
|
|
"generateContentConfig": {
|
|
|
|
|
|
"tools": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"urlContext": {}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"web-fetch-fallback": {
|
|
|
|
|
|
"extends": "gemini-2.5-flash-base",
|
|
|
|
|
|
"modelConfig": {}
|
|
|
|
|
|
},
|
|
|
|
|
|
"loop-detection": {
|
|
|
|
|
|
"extends": "gemini-2.5-flash-base",
|
|
|
|
|
|
"modelConfig": {}
|
|
|
|
|
|
},
|
|
|
|
|
|
"loop-detection-double-check": {
|
|
|
|
|
|
"extends": "base",
|
|
|
|
|
|
"modelConfig": {
|
|
|
|
|
|
"model": "gemini-2.5-pro"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"llm-edit-fixer": {
|
|
|
|
|
|
"extends": "gemini-2.5-flash-base",
|
|
|
|
|
|
"modelConfig": {}
|
|
|
|
|
|
},
|
|
|
|
|
|
"next-speaker-checker": {
|
|
|
|
|
|
"extends": "gemini-2.5-flash-base",
|
|
|
|
|
|
"modelConfig": {}
|
2025-11-24 12:24:45 -08:00
|
|
|
|
},
|
|
|
|
|
|
"chat-compression-3-pro": {
|
|
|
|
|
|
"modelConfig": {
|
|
|
|
|
|
"model": "gemini-3-pro-preview"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-12-17 09:43:21 -08:00
|
|
|
|
"chat-compression-3-flash": {
|
|
|
|
|
|
"modelConfig": {
|
|
|
|
|
|
"model": "gemini-3-flash-preview"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-11-24 12:24:45 -08:00
|
|
|
|
"chat-compression-2.5-pro": {
|
|
|
|
|
|
"modelConfig": {
|
|
|
|
|
|
"model": "gemini-2.5-pro"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"chat-compression-2.5-flash": {
|
|
|
|
|
|
"modelConfig": {
|
|
|
|
|
|
"model": "gemini-2.5-flash"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"chat-compression-2.5-flash-lite": {
|
|
|
|
|
|
"modelConfig": {
|
|
|
|
|
|
"model": "gemini-2.5-flash-lite"
|
|
|
|
|
|
}
|
2025-11-24 15:02:00 -08:00
|
|
|
|
},
|
|
|
|
|
|
"chat-compression-default": {
|
|
|
|
|
|
"modelConfig": {
|
|
|
|
|
|
"model": "gemini-2.5-pro"
|
|
|
|
|
|
}
|
2025-11-21 09:59:34 -08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
```
|
2025-11-05 17:18:42 -08:00
|
|
|
|
|
2025-11-21 16:13:10 -08:00
|
|
|
|
- **`modelConfigs.customAliases`** (object):
|
|
|
|
|
|
- **Description:** Custom named presets for model configs. These are merged
|
|
|
|
|
|
with (and override) the built-in aliases.
|
|
|
|
|
|
- **Default:** `{}`
|
|
|
|
|
|
|
2025-12-10 09:36:27 -08:00
|
|
|
|
- **`modelConfigs.customOverrides`** (array):
|
|
|
|
|
|
- **Description:** Custom model config overrides. These are merged with (and
|
|
|
|
|
|
added to) the built-in overrides.
|
|
|
|
|
|
- **Default:** `[]`
|
|
|
|
|
|
|
2025-11-05 17:18:42 -08:00
|
|
|
|
- **`modelConfigs.overrides`** (array):
|
|
|
|
|
|
- **Description:** Apply specific configuration overrides based on matches,
|
|
|
|
|
|
with a primary key of model (or alias). The most specific match will be
|
|
|
|
|
|
used.
|
|
|
|
|
|
- **Default:** `[]`
|
|
|
|
|
|
|
2026-01-13 12:16:02 -08:00
|
|
|
|
#### `agents`
|
|
|
|
|
|
|
|
|
|
|
|
- **`agents.overrides`** (object):
|
|
|
|
|
|
- **Description:** Override settings for specific agents, e.g. to disable the
|
|
|
|
|
|
agent, set a custom model config, or run config.
|
|
|
|
|
|
- **Default:** `{}`
|
|
|
|
|
|
- **Requires restart:** Yes
|
|
|
|
|
|
|
2025-08-28 15:31:33 -07:00
|
|
|
|
#### `context`
|
|
|
|
|
|
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **`context.fileName`** (string | string[]):
|
|
|
|
|
|
- **Description:** The name of the context file or files to load into memory.
|
|
|
|
|
|
Accepts either a single string or an array of strings.
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **Default:** `undefined`
|
|
|
|
|
|
|
|
|
|
|
|
- **`context.importFormat`** (string):
|
|
|
|
|
|
- **Description:** The format to use when importing memory.
|
|
|
|
|
|
- **Default:** `undefined`
|
|
|
|
|
|
|
|
|
|
|
|
- **`context.discoveryMaxDirs`** (number):
|
|
|
|
|
|
- **Description:** Maximum number of directories to search for memory.
|
|
|
|
|
|
- **Default:** `200`
|
|
|
|
|
|
|
|
|
|
|
|
- **`context.includeDirectories`** (array):
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- **Description:** Additional directories to include in the workspace context.
|
|
|
|
|
|
Missing directories will be skipped with a warning.
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **Default:** `[]`
|
|
|
|
|
|
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **`context.loadMemoryFromIncludeDirectories`** (boolean):
|
|
|
|
|
|
- **Description:** Controls how /memory refresh loads GEMINI.md files. When
|
|
|
|
|
|
true, include directories are scanned; when false, only the current
|
|
|
|
|
|
directory is used.
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
|
|
|
|
|
|
- **`context.fileFiltering.respectGitIgnore`** (boolean):
|
2026-01-09 14:28:09 -08:00
|
|
|
|
- **Description:** Respect .gitignore files when searching.
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **Default:** `true`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-08-28 15:31:33 -07:00
|
|
|
|
|
|
|
|
|
|
- **`context.fileFiltering.respectGeminiIgnore`** (boolean):
|
2026-01-09 14:28:09 -08:00
|
|
|
|
- **Description:** Respect .geminiignore files when searching.
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **Default:** `true`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-08-28 15:31:33 -07:00
|
|
|
|
|
|
|
|
|
|
- **`context.fileFiltering.enableRecursiveFileSearch`** (boolean):
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Description:** Enable recursive file search functionality when completing
|
|
|
|
|
|
@ references in the prompt.
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **Default:** `true`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-08-21 23:31:39 -07:00
|
|
|
|
|
2026-01-16 23:33:49 +01:00
|
|
|
|
- **`context.fileFiltering.enableFuzzySearch`** (boolean):
|
|
|
|
|
|
- **Description:** Enable fuzzy search when searching for files.
|
|
|
|
|
|
- **Default:** `true`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-10-13 12:57:23 -07:00
|
|
|
|
|
2026-01-27 17:19:13 -08:00
|
|
|
|
- **`context.fileFiltering.customIgnoreFilePaths`** (array):
|
|
|
|
|
|
- **Description:** Additional 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.
|
|
|
|
|
|
- **Default:** `[]`
|
|
|
|
|
|
- **Requires restart:** Yes
|
|
|
|
|
|
|
2025-08-28 15:31:33 -07:00
|
|
|
|
#### `tools`
|
2025-06-20 09:39:21 -07:00
|
|
|
|
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **`tools.sandbox`** (boolean | string):
|
|
|
|
|
|
- **Description:** Sandbox execution environment. Set to a boolean to enable
|
|
|
|
|
|
or disable the sandbox, or provide a string path to a sandbox profile.
|
2025-08-27 02:17:43 +10:00
|
|
|
|
- **Default:** `undefined`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-08-28 15:31:33 -07:00
|
|
|
|
|
2025-09-18 13:05:01 -07:00
|
|
|
|
- **`tools.shell.enableInteractiveShell`** (boolean):
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Description:** Use node-pty for an interactive shell experience. Fallback
|
|
|
|
|
|
to child_process still applies.
|
2025-10-08 13:28:19 -07:00
|
|
|
|
- **Default:** `true`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
|
|
|
|
|
|
|
|
|
|
|
- **`tools.shell.pager`** (string):
|
|
|
|
|
|
- **Description:** The pager command to use for shell output. Defaults to
|
|
|
|
|
|
`cat`.
|
|
|
|
|
|
- **Default:** `"cat"`
|
2025-05-20 10:37:21 -07:00
|
|
|
|
|
2025-10-13 12:57:23 -07:00
|
|
|
|
- **`tools.shell.showColor`** (boolean):
|
|
|
|
|
|
- **Description:** Show color in shell output.
|
|
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
|
2025-11-26 13:43:33 -08:00
|
|
|
|
- **`tools.shell.inactivityTimeout`** (number):
|
|
|
|
|
|
- **Description:** The maximum time in seconds allowed without output from the
|
|
|
|
|
|
shell command. Defaults to 5 minutes.
|
|
|
|
|
|
- **Default:** `300`
|
|
|
|
|
|
|
2025-12-27 03:07:33 +08:00
|
|
|
|
- **`tools.shell.enableShellOutputEfficiency`** (boolean):
|
|
|
|
|
|
- **Description:** Enable shell output efficiency optimizations for better
|
|
|
|
|
|
performance.
|
|
|
|
|
|
- **Default:** `true`
|
|
|
|
|
|
|
2025-10-13 12:57:23 -07:00
|
|
|
|
- **`tools.autoAccept`** (boolean):
|
|
|
|
|
|
- **Description:** Automatically accept and execute tool calls that are
|
|
|
|
|
|
considered safe (e.g., read-only operations).
|
|
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
|
2026-01-23 18:14:11 -05:00
|
|
|
|
- **`tools.approvalMode`** (enum):
|
|
|
|
|
|
- **Description:** The default approval mode for tool execution. 'default'
|
|
|
|
|
|
prompts for approval, 'auto_edit' auto-approves edit tools, and 'plan' is
|
|
|
|
|
|
read-only mode. 'yolo' is not supported yet.
|
|
|
|
|
|
- **Default:** `"default"`
|
|
|
|
|
|
- **Values:** `"default"`, `"auto_edit"`, `"plan"`
|
|
|
|
|
|
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **`tools.core`** (array):
|
|
|
|
|
|
- **Description:** Restrict the set of built-in tools with an allowlist. Match
|
|
|
|
|
|
semantics mirror tools.allowed; see the built-in tools documentation for
|
|
|
|
|
|
available names.
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **Default:** `undefined`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-08-28 15:31:33 -07:00
|
|
|
|
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **`tools.allowed`** (array):
|
|
|
|
|
|
- **Description:** Tool 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.
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **Default:** `undefined`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-08-28 15:31:33 -07:00
|
|
|
|
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **`tools.exclude`** (array):
|
|
|
|
|
|
- **Description:** Tool names to exclude from discovery.
|
2025-09-03 18:27:07 -07:00
|
|
|
|
- **Default:** `undefined`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-09-03 18:27:07 -07:00
|
|
|
|
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **`tools.discoveryCommand`** (string):
|
|
|
|
|
|
- **Description:** Command to run for tool discovery.
|
|
|
|
|
|
- **Default:** `undefined`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-08-28 15:31:33 -07:00
|
|
|
|
|
|
|
|
|
|
- **`tools.callCommand`** (string):
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Description:** Defines 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.
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **Default:** `undefined`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-08-28 15:31:33 -07:00
|
|
|
|
|
2025-10-13 12:57:23 -07:00
|
|
|
|
- **`tools.useRipgrep`** (boolean):
|
|
|
|
|
|
- **Description:** Use ripgrep for file content search instead of the fallback
|
|
|
|
|
|
implementation. Provides faster search performance.
|
|
|
|
|
|
- **Default:** `true`
|
|
|
|
|
|
|
|
|
|
|
|
- **`tools.enableToolOutputTruncation`** (boolean):
|
|
|
|
|
|
- **Description:** Enable truncation of large tool outputs.
|
|
|
|
|
|
- **Default:** `true`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-10-13 12:57:23 -07:00
|
|
|
|
|
|
|
|
|
|
- **`tools.truncateToolOutputThreshold`** (number):
|
|
|
|
|
|
- **Description:** Truncate tool output if it is larger than this many
|
|
|
|
|
|
characters. Set to -1 to disable.
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Default:** `4000000`
|
|
|
|
|
|
- **Requires restart:** Yes
|
2025-10-13 12:57:23 -07:00
|
|
|
|
|
|
|
|
|
|
- **`tools.truncateToolOutputLines`** (number):
|
|
|
|
|
|
- **Description:** The number of lines to keep when truncating tool output.
|
|
|
|
|
|
- **Default:** `1000`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-10-13 12:57:23 -07:00
|
|
|
|
|
2026-01-13 09:26:53 +08:00
|
|
|
|
- **`tools.disableLLMCorrection`** (boolean):
|
|
|
|
|
|
- **Description:** Disable 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.
|
2026-01-21 10:53:41 -08:00
|
|
|
|
- **Default:** `true`
|
2026-01-13 09:26:53 +08:00
|
|
|
|
- **Requires restart:** Yes
|
|
|
|
|
|
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **`tools.enableHooks`** (boolean):
|
2026-01-06 13:33:37 -08:00
|
|
|
|
- **Description:** Enables the hooks system experiment. When disabled, the
|
|
|
|
|
|
hooks system is completely deactivated regardless of other settings.
|
|
|
|
|
|
- **Default:** `true`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-10-13 12:57:23 -07:00
|
|
|
|
|
2025-08-28 15:31:33 -07:00
|
|
|
|
#### `mcp`
|
2025-06-20 09:39:21 -07:00
|
|
|
|
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **`mcp.serverCommand`** (string):
|
|
|
|
|
|
- **Description:** Command to start an MCP server.
|
|
|
|
|
|
- **Default:** `undefined`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-08-28 15:31:33 -07:00
|
|
|
|
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **`mcp.allowed`** (array):
|
|
|
|
|
|
- **Description:** A list of MCP servers to allow.
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **Default:** `undefined`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-08-28 15:31:33 -07:00
|
|
|
|
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **`mcp.excluded`** (array):
|
|
|
|
|
|
- **Description:** A list of MCP servers to exclude.
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **Default:** `undefined`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-08-28 15:31:33 -07:00
|
|
|
|
|
2025-10-22 13:27:10 -07:00
|
|
|
|
#### `useWriteTodos`
|
|
|
|
|
|
|
|
|
|
|
|
- **`useWriteTodos`** (boolean):
|
2025-11-12 10:18:15 -08:00
|
|
|
|
- **Description:** Enable the write_todos tool.
|
|
|
|
|
|
- **Default:** `true`
|
2025-10-22 13:27:10 -07:00
|
|
|
|
|
2025-08-28 15:31:33 -07:00
|
|
|
|
#### `security`
|
|
|
|
|
|
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **`security.disableYoloMode`** (boolean):
|
|
|
|
|
|
- **Description:** Disable YOLO mode, even if enabled by a flag.
|
|
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
- **Requires restart:** Yes
|
|
|
|
|
|
|
2025-12-19 09:25:23 -08:00
|
|
|
|
- **`security.enablePermanentToolApproval`** (boolean):
|
|
|
|
|
|
- **Description:** Enable the "Allow for all future sessions" option in tool
|
|
|
|
|
|
confirmation dialogs.
|
|
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
|
2025-11-11 18:37:01 +00:00
|
|
|
|
- **`security.blockGitExtensions`** (boolean):
|
|
|
|
|
|
- **Description:** Blocks installing and loading extensions from Git.
|
|
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
- **Requires restart:** Yes
|
|
|
|
|
|
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **`security.folderTrust.enabled`** (boolean):
|
|
|
|
|
|
- **Description:** Setting to track whether Folder trust is enabled.
|
2025-06-20 09:39:21 -07:00
|
|
|
|
- **Default:** `false`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-06-20 09:39:21 -07:00
|
|
|
|
|
2025-12-22 19:18:27 -08:00
|
|
|
|
- **`security.environmentVariableRedaction.allowed`** (array):
|
|
|
|
|
|
- **Description:** Environment variables to always allow (bypass redaction).
|
|
|
|
|
|
- **Default:** `[]`
|
|
|
|
|
|
- **Requires restart:** Yes
|
|
|
|
|
|
|
|
|
|
|
|
- **`security.environmentVariableRedaction.blocked`** (array):
|
|
|
|
|
|
- **Description:** Environment variables to always redact.
|
|
|
|
|
|
- **Default:** `[]`
|
|
|
|
|
|
- **Requires restart:** Yes
|
|
|
|
|
|
|
|
|
|
|
|
- **`security.environmentVariableRedaction.enabled`** (boolean):
|
|
|
|
|
|
- **Description:** Enable redaction of environment variables that may contain
|
|
|
|
|
|
secrets.
|
|
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
- **Requires restart:** Yes
|
|
|
|
|
|
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **`security.auth.selectedType`** (string):
|
|
|
|
|
|
- **Description:** The currently selected authentication type.
|
|
|
|
|
|
- **Default:** `undefined`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-06-20 09:39:21 -07:00
|
|
|
|
|
2025-09-03 15:33:37 -07:00
|
|
|
|
- **`security.auth.enforcedType`** (string):
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Description:** The required auth type. If this does not match the selected
|
|
|
|
|
|
auth type, the user will be prompted to re-authenticate.
|
2025-09-03 15:33:37 -07:00
|
|
|
|
- **Default:** `undefined`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-09-03 15:33:37 -07:00
|
|
|
|
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **`security.auth.useExternal`** (boolean):
|
|
|
|
|
|
- **Description:** Whether to use an external authentication flow.
|
|
|
|
|
|
- **Default:** `undefined`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-08-28 15:31:33 -07:00
|
|
|
|
|
|
|
|
|
|
#### `advanced`
|
|
|
|
|
|
|
|
|
|
|
|
- **`advanced.autoConfigureMemory`** (boolean):
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Description:** Automatically configure Node.js memory limits
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **Default:** `false`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-08-28 15:31:33 -07:00
|
|
|
|
|
|
|
|
|
|
- **`advanced.dnsResolutionOrder`** (string):
|
|
|
|
|
|
- **Description:** The DNS resolution order.
|
|
|
|
|
|
- **Default:** `undefined`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **Requires restart:** Yes
|
2025-08-28 15:31:33 -07:00
|
|
|
|
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **`advanced.excludedEnvVars`** (array):
|
2025-08-28 15:31:33 -07:00
|
|
|
|
- **Description:** Environment variables to exclude from project context.
|
2025-11-21 09:59:34 -08:00
|
|
|
|
- **Default:**
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
["DEBUG", "DEBUG_MODE"]
|
|
|
|
|
|
```
|
2025-08-28 15:31:33 -07:00
|
|
|
|
|
|
|
|
|
|
- **`advanced.bugCommand`** (object):
|
|
|
|
|
|
- **Description:** Configuration for the bug report command.
|
|
|
|
|
|
- **Default:** `undefined`
|
|
|
|
|
|
|
2025-10-13 12:57:23 -07:00
|
|
|
|
#### `experimental`
|
|
|
|
|
|
|
2025-12-03 12:53:06 -08:00
|
|
|
|
- **`experimental.enableAgents`** (boolean):
|
2025-12-17 22:46:55 -05:00
|
|
|
|
- **Description:** Enable local and remote subagents. Warning: Experimental
|
|
|
|
|
|
feature, uses YOLO mode for subagents
|
2025-12-03 12:53:06 -08:00
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
- **Requires restart:** Yes
|
|
|
|
|
|
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **`experimental.extensionManagement`** (boolean):
|
|
|
|
|
|
- **Description:** Enable extension management features.
|
|
|
|
|
|
- **Default:** `true`
|
|
|
|
|
|
- **Requires restart:** Yes
|
|
|
|
|
|
|
2026-01-14 10:16:42 -05:00
|
|
|
|
- **`experimental.extensionConfig`** (boolean):
|
|
|
|
|
|
- **Description:** Enable requesting and fetching of extension settings.
|
|
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
- **Requires restart:** Yes
|
|
|
|
|
|
|
2026-01-19 22:59:30 -05:00
|
|
|
|
- **`experimental.enableEventDrivenScheduler`** (boolean):
|
|
|
|
|
|
- **Description:** Enables event-driven scheduler within the CLI session.
|
2026-01-21 17:40:19 -05:00
|
|
|
|
- **Default:** `true`
|
2026-01-19 22:59:30 -05:00
|
|
|
|
- **Requires restart:** Yes
|
|
|
|
|
|
|
2025-11-02 20:42:49 -05:00
|
|
|
|
- **`experimental.extensionReloading`** (boolean):
|
|
|
|
|
|
- **Description:** Enables extension loading/unloading within the CLI session.
|
|
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
- **Requires restart:** Yes
|
|
|
|
|
|
|
2025-12-03 04:09:46 +08:00
|
|
|
|
- **`experimental.jitContext`** (boolean):
|
|
|
|
|
|
- **Description:** Enable Just-In-Time (JIT) context loading.
|
|
|
|
|
|
- **Default:** `false`
|
2025-11-24 17:26:47 -08:00
|
|
|
|
- **Requires restart:** Yes
|
|
|
|
|
|
|
2026-01-05 16:11:50 -08:00
|
|
|
|
- **`experimental.useOSC52Paste`** (boolean):
|
|
|
|
|
|
- **Description:** Use OSC 52 sequence for pasting instead of clipboardy
|
|
|
|
|
|
(useful for remote sessions).
|
|
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
|
2026-01-14 19:55:10 -05:00
|
|
|
|
- **`experimental.plan`** (boolean):
|
|
|
|
|
|
- **Description:** Enable planning features (Plan Mode and tools).
|
|
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
- **Requires restart:** Yes
|
|
|
|
|
|
|
2025-12-30 13:35:52 -08:00
|
|
|
|
#### `skills`
|
|
|
|
|
|
|
2026-01-27 19:09:52 -05:00
|
|
|
|
- **`skills.enabled`** (boolean):
|
|
|
|
|
|
- **Description:** Enable Agent Skills.
|
|
|
|
|
|
- **Default:** `true`
|
|
|
|
|
|
- **Requires restart:** Yes
|
|
|
|
|
|
|
2025-12-30 13:35:52 -08:00
|
|
|
|
- **`skills.disabled`** (array):
|
|
|
|
|
|
- **Description:** List of disabled skills.
|
|
|
|
|
|
- **Default:** `[]`
|
|
|
|
|
|
- **Requires restart:** Yes
|
|
|
|
|
|
|
2026-01-20 14:47:31 -08:00
|
|
|
|
#### `hooksConfig`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
|
2026-01-20 14:47:31 -08:00
|
|
|
|
- **`hooksConfig.enabled`** (boolean):
|
2026-01-06 13:33:37 -08:00
|
|
|
|
- **Description:** Canonical toggle for the hooks system. When disabled, no
|
|
|
|
|
|
hooks will be executed.
|
2026-01-21 17:40:31 -05:00
|
|
|
|
- **Default:** `true`
|
2026-01-06 13:33:37 -08:00
|
|
|
|
|
2026-01-20 14:47:31 -08:00
|
|
|
|
- **`hooksConfig.disabled`** (array):
|
2025-12-03 10:01:57 -08:00
|
|
|
|
- **Description:** List of hook names (commands) that should be disabled.
|
|
|
|
|
|
Hooks in this list will not execute even if configured.
|
|
|
|
|
|
- **Default:** `[]`
|
|
|
|
|
|
|
2026-01-20 14:47:31 -08:00
|
|
|
|
- **`hooksConfig.notifications`** (boolean):
|
2026-01-06 15:52:12 -05:00
|
|
|
|
- **Description:** Show visual indicators when hooks are executing.
|
|
|
|
|
|
- **Default:** `true`
|
|
|
|
|
|
|
2026-01-20 14:47:31 -08:00
|
|
|
|
#### `hooks`
|
|
|
|
|
|
|
2025-12-03 10:01:57 -08:00
|
|
|
|
- **`hooks.BeforeTool`** (array):
|
|
|
|
|
|
- **Description:** Hooks that execute before tool execution. Can intercept,
|
|
|
|
|
|
validate, or modify tool calls.
|
|
|
|
|
|
- **Default:** `[]`
|
|
|
|
|
|
|
|
|
|
|
|
- **`hooks.AfterTool`** (array):
|
|
|
|
|
|
- **Description:** Hooks that execute after tool execution. Can process
|
|
|
|
|
|
results, log outputs, or trigger follow-up actions.
|
|
|
|
|
|
- **Default:** `[]`
|
|
|
|
|
|
|
|
|
|
|
|
- **`hooks.BeforeAgent`** (array):
|
|
|
|
|
|
- **Description:** Hooks that execute before agent loop starts. Can set up
|
|
|
|
|
|
context or initialize resources.
|
|
|
|
|
|
- **Default:** `[]`
|
|
|
|
|
|
|
|
|
|
|
|
- **`hooks.AfterAgent`** (array):
|
|
|
|
|
|
- **Description:** Hooks that execute after agent loop completes. Can perform
|
|
|
|
|
|
cleanup or summarize results.
|
|
|
|
|
|
- **Default:** `[]`
|
|
|
|
|
|
|
|
|
|
|
|
- **`hooks.Notification`** (array):
|
|
|
|
|
|
- **Description:** Hooks that execute on notification events (errors,
|
|
|
|
|
|
warnings, info). Can log or alert on specific conditions.
|
|
|
|
|
|
- **Default:** `[]`
|
|
|
|
|
|
|
|
|
|
|
|
- **`hooks.SessionStart`** (array):
|
|
|
|
|
|
- **Description:** Hooks that execute when a session starts. Can initialize
|
|
|
|
|
|
session-specific resources or state.
|
|
|
|
|
|
- **Default:** `[]`
|
|
|
|
|
|
|
|
|
|
|
|
- **`hooks.SessionEnd`** (array):
|
|
|
|
|
|
- **Description:** Hooks that execute when a session ends. Can perform cleanup
|
|
|
|
|
|
or persist session data.
|
|
|
|
|
|
- **Default:** `[]`
|
|
|
|
|
|
|
|
|
|
|
|
- **`hooks.PreCompress`** (array):
|
|
|
|
|
|
- **Description:** Hooks that execute before chat history compression. Can
|
|
|
|
|
|
back up or analyze conversation before compression.
|
|
|
|
|
|
- **Default:** `[]`
|
|
|
|
|
|
|
|
|
|
|
|
- **`hooks.BeforeModel`** (array):
|
|
|
|
|
|
- **Description:** Hooks that execute before LLM requests. Can modify prompts,
|
|
|
|
|
|
inject context, or control model parameters.
|
|
|
|
|
|
- **Default:** `[]`
|
|
|
|
|
|
|
|
|
|
|
|
- **`hooks.AfterModel`** (array):
|
|
|
|
|
|
- **Description:** Hooks that execute after LLM responses. Can process
|
|
|
|
|
|
outputs, extract information, or log interactions.
|
|
|
|
|
|
- **Default:** `[]`
|
|
|
|
|
|
|
|
|
|
|
|
- **`hooks.BeforeToolSelection`** (array):
|
|
|
|
|
|
- **Description:** Hooks that execute before tool selection. Can filter or
|
|
|
|
|
|
prioritize available tools dynamically.
|
|
|
|
|
|
- **Default:** `[]`
|
2026-01-06 16:38:07 -05:00
|
|
|
|
|
|
|
|
|
|
#### `admin`
|
|
|
|
|
|
|
|
|
|
|
|
- **`admin.secureModeEnabled`** (boolean):
|
|
|
|
|
|
- **Description:** If true, disallows yolo mode from being used.
|
|
|
|
|
|
- **Default:** `false`
|
|
|
|
|
|
|
|
|
|
|
|
- **`admin.extensions.enabled`** (boolean):
|
|
|
|
|
|
- **Description:** If false, disallows extensions from being installed or
|
|
|
|
|
|
used.
|
|
|
|
|
|
- **Default:** `true`
|
|
|
|
|
|
|
|
|
|
|
|
- **`admin.mcp.enabled`** (boolean):
|
|
|
|
|
|
- **Description:** If false, disallows MCP servers from being used.
|
|
|
|
|
|
- **Default:** `true`
|
2026-01-13 23:40:23 -08:00
|
|
|
|
|
|
|
|
|
|
- **`admin.skills.enabled`** (boolean):
|
|
|
|
|
|
- **Description:** If false, disallows agent skills from being used.
|
|
|
|
|
|
- **Default:** `true`
|
2025-11-02 20:42:49 -05:00
|
|
|
|
<!-- SETTINGS-AUTOGEN:END -->
|
2025-10-13 12:57:23 -07:00
|
|
|
|
|
2025-09-03 18:27:07 -07:00
|
|
|
|
#### `mcpServers`
|
2025-08-28 15:31:33 -07:00
|
|
|
|
|
2025-10-09 08:17:37 -04:00
|
|
|
|
Configures connections to one or more Model-Context Protocol (MCP) servers for
|
|
|
|
|
|
discovering and using custom tools. Gemini CLI attempts to connect to each
|
|
|
|
|
|
configured MCP server to discover available tools. If multiple MCP servers
|
|
|
|
|
|
expose a tool with the same name, the tool names will be prefixed with the
|
|
|
|
|
|
server alias you defined in the configuration (e.g.,
|
|
|
|
|
|
`serverAlias__actualToolName`) to avoid conflicts. Note that the system might
|
|
|
|
|
|
strip certain schema properties from MCP tool definitions for compatibility. At
|
|
|
|
|
|
least one of `command`, `url`, or `httpUrl` must be provided. If multiple are
|
|
|
|
|
|
specified, the order of precedence is `httpUrl`, then `url`, then `command`.
|
|
|
|
|
|
|
|
|
|
|
|
- **`mcpServers.<SERVER_NAME>`** (object): The server parameters for the named
|
|
|
|
|
|
server.
|
|
|
|
|
|
- `command` (string, optional): The command to execute to start the MCP server
|
|
|
|
|
|
via standard I/O.
|
2025-09-03 18:27:07 -07:00
|
|
|
|
- `args` (array of strings, optional): Arguments to pass to the command.
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- `env` (object, optional): Environment variables to set for the server
|
|
|
|
|
|
process.
|
|
|
|
|
|
- `cwd` (string, optional): The working directory in which to start the
|
|
|
|
|
|
server.
|
|
|
|
|
|
- `url` (string, optional): The URL of an MCP server that uses Server-Sent
|
|
|
|
|
|
Events (SSE) for communication.
|
|
|
|
|
|
- `httpUrl` (string, optional): The URL of an MCP server that uses streamable
|
|
|
|
|
|
HTTP for communication.
|
|
|
|
|
|
- `headers` (object, optional): A map of HTTP headers to send with requests to
|
|
|
|
|
|
`url` or `httpUrl`.
|
|
|
|
|
|
- `timeout` (number, optional): Timeout in milliseconds for requests to this
|
|
|
|
|
|
MCP server.
|
|
|
|
|
|
- `trust` (boolean, optional): Trust this server and bypass all tool call
|
|
|
|
|
|
confirmations.
|
|
|
|
|
|
- `description` (string, optional): A brief description of the server, which
|
|
|
|
|
|
may be used for display purposes.
|
|
|
|
|
|
- `includeTools` (array of strings, optional): List of tool names to include
|
|
|
|
|
|
from this MCP server. When specified, only the tools listed here will be
|
|
|
|
|
|
available from this server (allowlist behavior). If not specified, all tools
|
|
|
|
|
|
from the server are enabled by default.
|
|
|
|
|
|
- `excludeTools` (array of strings, optional): List of tool names to exclude
|
|
|
|
|
|
from this MCP server. Tools listed here will not be available to the model,
|
|
|
|
|
|
even if they are exposed by the server. **Note:** `excludeTools` takes
|
|
|
|
|
|
precedence over `includeTools` - if a tool is in both lists, it will be
|
|
|
|
|
|
excluded.
|
2025-09-03 18:27:07 -07:00
|
|
|
|
|
|
|
|
|
|
#### `telemetry`
|
|
|
|
|
|
|
2025-10-09 08:17:37 -04:00
|
|
|
|
Configures logging and metrics collection for Gemini CLI. For more information,
|
|
|
|
|
|
see [Telemetry](../cli/telemetry.md).
|
2025-09-03 18:27:07 -07:00
|
|
|
|
|
|
|
|
|
|
- **Properties:**
|
|
|
|
|
|
- **`enabled`** (boolean): Whether or not telemetry is enabled.
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- **`target`** (string): The destination for collected telemetry. Supported
|
|
|
|
|
|
values are `local` and `gcp`.
|
2025-09-03 18:27:07 -07:00
|
|
|
|
- **`otlpEndpoint`** (string): The endpoint for the OTLP Exporter.
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- **`otlpProtocol`** (string): The protocol for the OTLP Exporter (`grpc` or
|
|
|
|
|
|
`http`).
|
|
|
|
|
|
- **`logPrompts`** (boolean): Whether or not to include the content of user
|
|
|
|
|
|
prompts in the logs.
|
|
|
|
|
|
- **`outfile`** (string): The file to write telemetry to when `target` is
|
|
|
|
|
|
`local`.
|
2025-09-23 03:23:06 +09:00
|
|
|
|
- **`useCollector`** (boolean): Whether to use an external OTLP collector.
|
2025-08-10 12:06:35 -07:00
|
|
|
|
|
2025-08-28 15:31:33 -07:00
|
|
|
|
### Example `settings.json`
|
2025-08-21 22:29:15 +00:00
|
|
|
|
|
2025-10-09 08:17:37 -04:00
|
|
|
|
Here is an example of a `settings.json` file with the nested structure, new as
|
|
|
|
|
|
of v0.3.0:
|
2025-05-15 20:04:33 -07:00
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
{
|
2025-08-28 15:31:33 -07:00
|
|
|
|
"general": {
|
|
|
|
|
|
"vimMode": true,
|
2025-11-25 11:55:29 -07:00
|
|
|
|
"preferredEditor": "code",
|
|
|
|
|
|
"sessionRetention": {
|
|
|
|
|
|
"enabled": true,
|
|
|
|
|
|
"maxAge": "30d",
|
|
|
|
|
|
"maxCount": 100
|
|
|
|
|
|
}
|
2025-08-28 15:31:33 -07:00
|
|
|
|
},
|
|
|
|
|
|
"ui": {
|
|
|
|
|
|
"theme": "GitHub",
|
|
|
|
|
|
"hideBanner": true,
|
2025-10-01 21:22:26 +05:30
|
|
|
|
"hideTips": false,
|
|
|
|
|
|
"customWittyPhrases": [
|
|
|
|
|
|
"You forget a thousand things every day. Make sure this is one of ’em",
|
|
|
|
|
|
"Connecting to AGI"
|
|
|
|
|
|
]
|
2025-08-28 15:31:33 -07:00
|
|
|
|
},
|
|
|
|
|
|
"tools": {
|
|
|
|
|
|
"sandbox": "docker",
|
|
|
|
|
|
"discoveryCommand": "bin/get_tools",
|
|
|
|
|
|
"callCommand": "bin/call_tool",
|
|
|
|
|
|
"exclude": ["write_file"]
|
|
|
|
|
|
},
|
2025-05-16 17:19:00 -07:00
|
|
|
|
"mcpServers": {
|
|
|
|
|
|
"mainServer": {
|
|
|
|
|
|
"command": "bin/mcp_server.py"
|
|
|
|
|
|
},
|
|
|
|
|
|
"anotherServer": {
|
|
|
|
|
|
"command": "node",
|
|
|
|
|
|
"args": ["mcp_server.js", "--verbose"]
|
|
|
|
|
|
}
|
2025-06-23 18:25:49 -04:00
|
|
|
|
},
|
|
|
|
|
|
"telemetry": {
|
|
|
|
|
|
"enabled": true,
|
|
|
|
|
|
"target": "local",
|
|
|
|
|
|
"otlpEndpoint": "http://localhost:4317",
|
2025-06-23 20:29:31 -04:00
|
|
|
|
"logPrompts": true
|
|
|
|
|
|
},
|
2025-08-28 15:31:33 -07:00
|
|
|
|
"privacy": {
|
|
|
|
|
|
"usageStatisticsEnabled": true
|
|
|
|
|
|
},
|
|
|
|
|
|
"model": {
|
|
|
|
|
|
"name": "gemini-1.5-pro-latest",
|
|
|
|
|
|
"maxSessionTurns": 10,
|
|
|
|
|
|
"summarizeToolOutput": {
|
|
|
|
|
|
"run_shell_command": {
|
|
|
|
|
|
"tokenBudget": 100
|
|
|
|
|
|
}
|
2025-07-15 10:22:31 -07:00
|
|
|
|
}
|
2025-08-03 20:44:15 +02:00
|
|
|
|
},
|
2025-08-28 15:31:33 -07:00
|
|
|
|
"context": {
|
|
|
|
|
|
"fileName": ["CONTEXT.md", "GEMINI.md"],
|
|
|
|
|
|
"includeDirectories": ["path/to/dir1", "~/path/to/dir2", "../path/to/dir3"],
|
|
|
|
|
|
"loadFromIncludeDirectories": true,
|
|
|
|
|
|
"fileFiltering": {
|
|
|
|
|
|
"respectGitIgnore": false
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"advanced": {
|
|
|
|
|
|
"excludedEnvVars": ["DEBUG", "DEBUG_MODE", "NODE_ENV"]
|
|
|
|
|
|
}
|
2025-05-15 20:04:33 -07:00
|
|
|
|
}
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2025-12-01 11:38:48 -08:00
|
|
|
|
## Shell history
|
2025-06-21 17:41:03 -07:00
|
|
|
|
|
2025-10-09 08:17:37 -04:00
|
|
|
|
The CLI keeps a history of shell commands you run. To avoid conflicts between
|
|
|
|
|
|
different projects, this history is stored in a project-specific directory
|
|
|
|
|
|
within your user's home folder.
|
2025-06-21 17:41:03 -07:00
|
|
|
|
|
|
|
|
|
|
- **Location:** `~/.gemini/tmp/<project_hash>/shell_history`
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- `<project_hash>` is a unique identifier generated from your project's root
|
|
|
|
|
|
path.
|
2025-06-21 17:41:03 -07:00
|
|
|
|
- The history is stored in a file named `shell_history`.
|
|
|
|
|
|
|
2025-12-01 11:38:48 -08:00
|
|
|
|
## Environment variables and `.env` files
|
2025-05-15 20:04:33 -07:00
|
|
|
|
|
2025-10-09 08:17:37 -04:00
|
|
|
|
Environment variables are a common way to configure applications, especially for
|
|
|
|
|
|
sensitive information like API keys or for settings that might change between
|
|
|
|
|
|
environments. For authentication setup, see the
|
|
|
|
|
|
[Authentication documentation](./authentication.md) which covers all available
|
|
|
|
|
|
authentication methods.
|
2025-05-15 20:04:33 -07:00
|
|
|
|
|
2025-10-09 08:17:37 -04:00
|
|
|
|
The CLI automatically loads environment variables from an `.env` file. The
|
|
|
|
|
|
loading order is:
|
2025-05-15 20:04:33 -07:00
|
|
|
|
|
|
|
|
|
|
1. `.env` file in the current working directory.
|
2025-10-09 08:17:37 -04:00
|
|
|
|
2. If not found, it searches upwards in parent directories until it finds an
|
|
|
|
|
|
`.env` file or reaches the project root (identified by a `.git` folder) or
|
|
|
|
|
|
the home directory.
|
2025-05-15 20:04:33 -07:00
|
|
|
|
3. If still not found, it looks for `~/.env` (in the user's home directory).
|
|
|
|
|
|
|
2025-12-01 11:38:48 -08:00
|
|
|
|
**Environment variable exclusion:** Some environment variables (like `DEBUG` and
|
2025-10-09 08:17:37 -04:00
|
|
|
|
`DEBUG_MODE`) are automatically excluded from being loaded from project `.env`
|
|
|
|
|
|
files to prevent interference with gemini-cli behavior. Variables from
|
|
|
|
|
|
`.gemini/.env` files are never excluded. You can customize this behavior using
|
|
|
|
|
|
the `advanced.excludedEnvVars` setting in your `settings.json` file.
|
2025-08-03 20:44:15 +02:00
|
|
|
|
|
2025-08-18 15:04:01 -07:00
|
|
|
|
- **`GEMINI_API_KEY`**:
|
2025-05-15 20:04:33 -07:00
|
|
|
|
- Your API key for the Gemini API.
|
2025-08-18 15:04:01 -07:00
|
|
|
|
- One of several available [authentication methods](./authentication.md).
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- Set this in your shell profile (e.g., `~/.bashrc`, `~/.zshrc`) or an `.env`
|
|
|
|
|
|
file.
|
2025-05-17 17:28:44 -07:00
|
|
|
|
- **`GEMINI_MODEL`**:
|
2025-05-15 20:04:33 -07:00
|
|
|
|
- Specifies the default Gemini model to use.
|
2025-06-21 17:41:03 -07:00
|
|
|
|
- Overrides the hardcoded default
|
2026-01-19 20:54:34 +05:30
|
|
|
|
- Example: `export GEMINI_MODEL="gemini-3-flash-preview"`
|
2025-06-14 15:19:05 -07:00
|
|
|
|
- **`GOOGLE_API_KEY`**:
|
|
|
|
|
|
- Your Google Cloud API key.
|
|
|
|
|
|
- Required for using Vertex AI in express mode.
|
2025-07-08 09:37:10 -07:00
|
|
|
|
- Ensure you have the necessary permissions.
|
2025-06-25 03:53:03 +00:00
|
|
|
|
- Example: `export GOOGLE_API_KEY="YOUR_GOOGLE_API_KEY"`.
|
2025-06-14 15:19:05 -07:00
|
|
|
|
- **`GOOGLE_CLOUD_PROJECT`**:
|
|
|
|
|
|
- Your Google Cloud Project ID.
|
2025-06-15 21:12:57 -04:00
|
|
|
|
- Required for using Code Assist or Vertex AI.
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- If using Vertex AI, ensure you have the necessary permissions in this
|
|
|
|
|
|
project.
|
2025-12-01 11:38:48 -08:00
|
|
|
|
- **Cloud Shell note:** When running in a Cloud Shell environment, this
|
2025-10-09 08:17:37 -04:00
|
|
|
|
variable defaults to a special project allocated for Cloud Shell users. If
|
|
|
|
|
|
you have `GOOGLE_CLOUD_PROJECT` set in your global environment in Cloud
|
|
|
|
|
|
Shell, it will be overridden by this default. To use a different project in
|
|
|
|
|
|
Cloud Shell, you must define `GOOGLE_CLOUD_PROJECT` in a `.env` file.
|
2025-06-14 15:19:05 -07:00
|
|
|
|
- Example: `export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"`.
|
2025-06-21 17:41:03 -07:00
|
|
|
|
- **`GOOGLE_APPLICATION_CREDENTIALS`** (string):
|
|
|
|
|
|
- **Description:** The path to your Google Application Credentials JSON file.
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- **Example:**
|
|
|
|
|
|
`export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/credentials.json"`
|
2025-06-15 21:12:57 -04:00
|
|
|
|
- **`OTLP_GOOGLE_CLOUD_PROJECT`**:
|
|
|
|
|
|
- Your Google Cloud Project ID for Telemetry in Google Cloud
|
|
|
|
|
|
- Example: `export OTLP_GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"`.
|
2025-09-23 03:23:06 +09:00
|
|
|
|
- **`GEMINI_TELEMETRY_ENABLED`**:
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- Set to `true` or `1` to enable telemetry. Any other value is treated as
|
|
|
|
|
|
disabling it.
|
2025-09-23 03:23:06 +09:00
|
|
|
|
- Overrides the `telemetry.enabled` setting.
|
|
|
|
|
|
- **`GEMINI_TELEMETRY_TARGET`**:
|
|
|
|
|
|
- Sets the telemetry target (`local` or `gcp`).
|
|
|
|
|
|
- Overrides the `telemetry.target` setting.
|
|
|
|
|
|
- **`GEMINI_TELEMETRY_OTLP_ENDPOINT`**:
|
|
|
|
|
|
- Sets the OTLP endpoint for telemetry.
|
|
|
|
|
|
- Overrides the `telemetry.otlpEndpoint` setting.
|
|
|
|
|
|
- **`GEMINI_TELEMETRY_OTLP_PROTOCOL`**:
|
|
|
|
|
|
- Sets the OTLP protocol (`grpc` or `http`).
|
|
|
|
|
|
- Overrides the `telemetry.otlpProtocol` setting.
|
|
|
|
|
|
- **`GEMINI_TELEMETRY_LOG_PROMPTS`**:
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- Set to `true` or `1` to enable or disable logging of user prompts. Any other
|
|
|
|
|
|
value is treated as disabling it.
|
2025-09-23 03:23:06 +09:00
|
|
|
|
- Overrides the `telemetry.logPrompts` setting.
|
|
|
|
|
|
- **`GEMINI_TELEMETRY_OUTFILE`**:
|
|
|
|
|
|
- Sets the file path to write telemetry to when the target is `local`.
|
|
|
|
|
|
- Overrides the `telemetry.outfile` setting.
|
|
|
|
|
|
- **`GEMINI_TELEMETRY_USE_COLLECTOR`**:
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- Set to `true` or `1` to enable or disable using an external OTLP collector.
|
|
|
|
|
|
Any other value is treated as disabling it.
|
2025-09-23 03:23:06 +09:00
|
|
|
|
- Overrides the `telemetry.useCollector` setting.
|
2025-06-14 15:19:05 -07:00
|
|
|
|
- **`GOOGLE_CLOUD_LOCATION`**:
|
|
|
|
|
|
- Your Google Cloud Project Location (e.g., us-central1).
|
2025-10-01 16:24:29 -07:00
|
|
|
|
- Required for using Vertex AI in non-express mode.
|
2025-06-14 15:19:05 -07:00
|
|
|
|
- Example: `export GOOGLE_CLOUD_LOCATION="YOUR_PROJECT_LOCATION"`.
|
2025-05-17 17:28:44 -07:00
|
|
|
|
- **`GEMINI_SANDBOX`**:
|
2025-05-15 20:04:33 -07:00
|
|
|
|
- Alternative to the `sandbox` setting in `settings.json`.
|
|
|
|
|
|
- Accepts `true`, `false`, `docker`, `podman`, or a custom command string.
|
2025-12-19 22:11:37 +02:00
|
|
|
|
- **`GEMINI_SYSTEM_MD`**:
|
|
|
|
|
|
- Replaces the built‑in system prompt with content from a Markdown file.
|
|
|
|
|
|
- `true`/`1`: Use project default path `./.gemini/system.md`.
|
|
|
|
|
|
- Any other string: Treat as a path (relative/absolute supported, `~`
|
|
|
|
|
|
expands).
|
|
|
|
|
|
- `false`/`0` or unset: Use the built‑in prompt. See
|
|
|
|
|
|
[System Prompt Override](../cli/system-prompt.md).
|
|
|
|
|
|
- **`GEMINI_WRITE_SYSTEM_MD`**:
|
|
|
|
|
|
- Writes the current built‑in system prompt to a file for review.
|
|
|
|
|
|
- `true`/`1`: Write to `./.gemini/system.md`. Otherwise treat the value as a
|
|
|
|
|
|
path.
|
|
|
|
|
|
- Run the CLI once with this set to generate the file.
|
2025-05-15 20:04:33 -07:00
|
|
|
|
- **`SEATBELT_PROFILE`** (macOS specific):
|
|
|
|
|
|
- Switches the Seatbelt (`sandbox-exec`) profile on macOS.
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- `permissive-open`: (Default) Restricts writes to the project folder (and a
|
|
|
|
|
|
few other folders, see
|
|
|
|
|
|
`packages/cli/src/utils/sandbox-macos-permissive-open.sb`) but allows other
|
|
|
|
|
|
operations.
|
2025-05-16 13:09:27 -07:00
|
|
|
|
- `strict`: Uses a strict profile that declines operations by default.
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- `<profile_name>`: Uses a custom profile. To define a custom profile, create
|
|
|
|
|
|
a file named `sandbox-macos-<profile_name>.sb` in your project's `.gemini/`
|
|
|
|
|
|
directory (e.g., `my-project/.gemini/sandbox-macos-custom.sb`).
|
|
|
|
|
|
- **`DEBUG` or `DEBUG_MODE`** (often used by underlying libraries or the CLI
|
|
|
|
|
|
itself):
|
|
|
|
|
|
- Set to `true` or `1` to enable verbose debug logging, which can be helpful
|
|
|
|
|
|
for troubleshooting.
|
|
|
|
|
|
- **Note:** These variables are automatically excluded from project `.env`
|
|
|
|
|
|
files by default to prevent interference with gemini-cli behavior. Use
|
|
|
|
|
|
`.gemini/.env` files if you need to set these for gemini-cli specifically.
|
2025-06-07 10:47:30 -07:00
|
|
|
|
- **`NO_COLOR`**:
|
|
|
|
|
|
- Set to any value to disable all color output in the CLI.
|
|
|
|
|
|
- **`CLI_TITLE`**:
|
|
|
|
|
|
- Set to a string to customize the title of the CLI.
|
2025-06-12 18:00:17 -07:00
|
|
|
|
- **`CODE_ASSIST_ENDPOINT`**:
|
|
|
|
|
|
- Specifies the endpoint for the code assist server.
|
|
|
|
|
|
- This is useful for development and testing.
|
2025-05-15 20:04:33 -07:00
|
|
|
|
|
2025-12-22 19:18:27 -08:00
|
|
|
|
### Environment variable redaction
|
|
|
|
|
|
|
|
|
|
|
|
To prevent accidental leakage of sensitive information, Gemini CLI automatically
|
|
|
|
|
|
redacts potential secrets from environment variables when executing tools (such
|
|
|
|
|
|
as shell commands). This "best effort" redaction applies to variables inherited
|
|
|
|
|
|
from the system or loaded from `.env` files.
|
|
|
|
|
|
|
|
|
|
|
|
**Default Redaction Rules:**
|
|
|
|
|
|
|
|
|
|
|
|
- **By Name:** Variables are redacted if their names contain sensitive terms
|
|
|
|
|
|
like `TOKEN`, `SECRET`, `PASSWORD`, `KEY`, `AUTH`, `CREDENTIAL`, `PRIVATE`, or
|
|
|
|
|
|
`CERT`.
|
|
|
|
|
|
- **By Value:** Variables are redacted if their values match known secret
|
|
|
|
|
|
patterns, such as:
|
|
|
|
|
|
- Private keys (RSA, OpenSSH, PGP, etc.)
|
|
|
|
|
|
- Certificates
|
|
|
|
|
|
- URLs containing credentials
|
|
|
|
|
|
- API keys and tokens (GitHub, Google, AWS, Stripe, Slack, etc.)
|
|
|
|
|
|
- **Specific Blocklist:** Certain variables like `CLIENT_ID`, `DB_URI`,
|
|
|
|
|
|
`DATABASE_URL`, and `CONNECTION_STRING` are always redacted by default.
|
|
|
|
|
|
|
|
|
|
|
|
**Allowlist (Never Redacted):**
|
|
|
|
|
|
|
|
|
|
|
|
- Common system variables (e.g., `PATH`, `HOME`, `USER`, `SHELL`, `TERM`,
|
|
|
|
|
|
`LANG`).
|
|
|
|
|
|
- Variables starting with `GEMINI_CLI_`.
|
|
|
|
|
|
- GitHub Action specific variables.
|
|
|
|
|
|
|
|
|
|
|
|
**Configuration:**
|
|
|
|
|
|
|
|
|
|
|
|
You can customize this behavior in your `settings.json` file:
|
|
|
|
|
|
|
|
|
|
|
|
- **`security.allowedEnvironmentVariables`**: A list of variable names to
|
|
|
|
|
|
_never_ redact, even if they match sensitive patterns.
|
|
|
|
|
|
- **`security.blockedEnvironmentVariables`**: A list of variable names to
|
|
|
|
|
|
_always_ redact, even if they don't match sensitive patterns.
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
{
|
|
|
|
|
|
"security": {
|
|
|
|
|
|
"allowedEnvironmentVariables": ["MY_PUBLIC_KEY", "NOT_A_SECRET_TOKEN"],
|
|
|
|
|
|
"blockedEnvironmentVariables": ["INTERNAL_IP_ADDRESS"]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2025-12-01 11:38:48 -08:00
|
|
|
|
## Command-line arguments
|
2025-05-15 20:04:33 -07:00
|
|
|
|
|
2025-10-09 08:17:37 -04:00
|
|
|
|
Arguments passed directly when running the CLI can override other configurations
|
|
|
|
|
|
for that specific session.
|
2025-05-15 20:04:33 -07:00
|
|
|
|
|
2025-06-23 17:24:55 -07:00
|
|
|
|
- **`--model <model_name>`** (**`-m <model_name>`**):
|
2025-05-15 20:04:33 -07:00
|
|
|
|
- Specifies the Gemini model to use for this session.
|
2026-01-19 20:54:34 +05:30
|
|
|
|
- Example: `npm start -- --model gemini-3-pro-preview`
|
2025-06-23 17:24:55 -07:00
|
|
|
|
- **`--prompt <your_prompt>`** (**`-p <your_prompt>`**):
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- Used to pass a prompt directly to the command. This invokes Gemini CLI in a
|
|
|
|
|
|
non-interactive mode.
|
|
|
|
|
|
- For scripting examples, use the `--output-format json` flag to get
|
|
|
|
|
|
structured output.
|
2025-07-26 22:41:19 -04:00
|
|
|
|
- **`--prompt-interactive <your_prompt>`** (**`-i <your_prompt>`**):
|
|
|
|
|
|
- Starts an interactive session with the provided prompt as the initial input.
|
|
|
|
|
|
- The prompt is processed within the interactive session, not before it.
|
|
|
|
|
|
- Cannot be used when piping input from stdin.
|
|
|
|
|
|
- Example: `gemini -i "explain this code"`
|
2025-09-11 05:19:47 +09:00
|
|
|
|
- **`--output-format <format>`**:
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- **Description:** Specifies the format of the CLI output for non-interactive
|
|
|
|
|
|
mode.
|
2025-09-11 05:19:47 +09:00
|
|
|
|
- **Values:**
|
|
|
|
|
|
- `text`: (Default) The standard human-readable output.
|
|
|
|
|
|
- `json`: A machine-readable JSON output.
|
2025-10-15 13:55:37 -07:00
|
|
|
|
- `stream-json`: A streaming JSON output that emits real-time events.
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- **Note:** For structured output and scripting, use the
|
2025-10-15 13:55:37 -07:00
|
|
|
|
`--output-format json` or `--output-format stream-json` flag.
|
2025-06-23 17:24:55 -07:00
|
|
|
|
- **`--sandbox`** (**`-s`**):
|
|
|
|
|
|
- Enables sandbox mode for this session.
|
2025-07-08 16:56:12 -04:00
|
|
|
|
- **`--debug`** (**`-d`**):
|
2026-01-14 08:48:52 -05:00
|
|
|
|
- Enables debug mode for this session, providing more verbose output. Open the
|
|
|
|
|
|
debug console with F12 to see the additional logging.
|
2025-10-16 12:09:21 -07:00
|
|
|
|
|
2025-05-15 20:04:33 -07:00
|
|
|
|
- **`--help`** (or **`-h`**):
|
|
|
|
|
|
- Displays help information about command-line arguments.
|
2025-06-23 17:24:55 -07:00
|
|
|
|
- **`--yolo`**:
|
|
|
|
|
|
- Enables YOLO mode, which automatically approves all tool calls.
|
2025-08-12 15:10:22 -07:00
|
|
|
|
- **`--approval-mode <mode>`**:
|
|
|
|
|
|
- Sets the approval mode for tool calls. Available modes:
|
|
|
|
|
|
- `default`: Prompt for approval on each tool call (default behavior)
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- `auto_edit`: Automatically approve edit tools (replace, write_file) while
|
|
|
|
|
|
prompting for others
|
2025-08-12 15:10:22 -07:00
|
|
|
|
- `yolo`: Automatically approve all tool calls (equivalent to `--yolo`)
|
2026-01-15 17:00:19 -05:00
|
|
|
|
- `plan`: Read-only mode for tool calls (requires experimental planning to
|
|
|
|
|
|
be enabled).
|
|
|
|
|
|
> **Note:** This mode is currently under development and not yet fully
|
|
|
|
|
|
> functional.
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- Cannot be used together with `--yolo`. Use `--approval-mode=yolo` instead of
|
|
|
|
|
|
`--yolo` for the new unified approach.
|
2025-08-12 15:10:22 -07:00
|
|
|
|
- Example: `gemini --approval-mode auto_edit`
|
2025-08-27 02:17:43 +10:00
|
|
|
|
- **`--allowed-tools <tool1,tool2,...>`**:
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- A comma-separated list of tool names that will bypass the confirmation
|
|
|
|
|
|
dialog.
|
2025-08-27 02:17:43 +10:00
|
|
|
|
- Example: `gemini --allowed-tools "ShellTool(git status)"`
|
2025-07-08 12:57:34 -04:00
|
|
|
|
- **`--extensions <extension_name ...>`** (**`-e <extension_name ...>`**):
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- Specifies a list of extensions to use for the session. If not provided, all
|
|
|
|
|
|
available extensions are used.
|
2025-07-08 12:57:34 -04:00
|
|
|
|
- Use the special term `gemini -e none` to disable all extensions.
|
|
|
|
|
|
- Example: `gemini -e my-extension -e my-other-extension`
|
|
|
|
|
|
- **`--list-extensions`** (**`-l`**):
|
|
|
|
|
|
- Lists all available extensions and exits.
|
2025-11-25 11:55:29 -07:00
|
|
|
|
- **`--resume [session_id]`** (**`-r [session_id]`**):
|
|
|
|
|
|
- Resume a previous chat session. Use "latest" for the most recent session,
|
|
|
|
|
|
provide a session index number, or provide a full session UUID.
|
|
|
|
|
|
- If no session_id is provided, defaults to "latest".
|
|
|
|
|
|
- Example: `gemini --resume 5` or `gemini --resume latest` or
|
|
|
|
|
|
`gemini --resume a1b2c3d4-e5f6-7890-abcd-ef1234567890` or `gemini --resume`
|
|
|
|
|
|
- See [Session Management](../cli/session-management.md) for more details.
|
|
|
|
|
|
- **`--list-sessions`**:
|
|
|
|
|
|
- List all available chat sessions for the current project and exit.
|
|
|
|
|
|
- Shows session indices, dates, message counts, and preview of first user
|
|
|
|
|
|
message.
|
|
|
|
|
|
- Example: `gemini --list-sessions`
|
|
|
|
|
|
- **`--delete-session <identifier>`**:
|
|
|
|
|
|
- Delete a specific chat session by its index number or full session UUID.
|
|
|
|
|
|
- Use `--list-sessions` first to see available sessions, their indices, and
|
|
|
|
|
|
UUIDs.
|
|
|
|
|
|
- Example: `gemini --delete-session 3` or
|
|
|
|
|
|
`gemini --delete-session a1b2c3d4-e5f6-7890-abcd-ef1234567890`
|
2025-07-31 05:38:20 +09:00
|
|
|
|
- **`--include-directories <dir1,dir2,...>`**:
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- Includes additional directories in the workspace for multi-directory
|
|
|
|
|
|
support.
|
2025-07-31 05:38:20 +09:00
|
|
|
|
- Can be specified multiple times or as comma-separated values.
|
|
|
|
|
|
- 5 directories can be added at maximum.
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- Example: `--include-directories /path/to/project1,/path/to/project2` or
|
|
|
|
|
|
`--include-directories /path/to/project1 --include-directories /path/to/project2`
|
2025-08-21 22:29:15 +00:00
|
|
|
|
- **`--screen-reader`**:
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- Enables screen reader mode, which adjusts the TUI for better compatibility
|
|
|
|
|
|
with screen readers.
|
2025-06-23 17:24:55 -07:00
|
|
|
|
- **`--version`**:
|
|
|
|
|
|
- Displays the version of the CLI.
|
2025-11-02 09:59:03 -08:00
|
|
|
|
- **`--experimental-acp`**:
|
|
|
|
|
|
- Starts the agent in ACP mode.
|
|
|
|
|
|
- **`--allowed-mcp-server-names`**:
|
|
|
|
|
|
- Allowed MCP server names.
|
|
|
|
|
|
- **`--fake-responses`**:
|
|
|
|
|
|
- Path to a file with fake model responses for testing.
|
|
|
|
|
|
- **`--record-responses`**:
|
|
|
|
|
|
- Path to a file to record model responses for testing.
|
2025-05-15 20:04:33 -07:00
|
|
|
|
|
2025-12-01 11:38:48 -08:00
|
|
|
|
## Context files (hierarchical instructional context)
|
2025-05-15 20:04:33 -07:00
|
|
|
|
|
2025-10-09 08:17:37 -04:00
|
|
|
|
While not strictly configuration for the CLI's _behavior_, context files
|
|
|
|
|
|
(defaulting to `GEMINI.md` but configurable via the `context.fileName` setting)
|
|
|
|
|
|
are crucial for configuring the _instructional context_ (also referred to as
|
|
|
|
|
|
"memory") provided to the Gemini model. This powerful feature allows you to give
|
|
|
|
|
|
project-specific instructions, coding style guides, or any relevant background
|
|
|
|
|
|
information to the AI, making its responses more tailored and accurate to your
|
|
|
|
|
|
needs. The CLI includes UI elements, such as an indicator in the footer showing
|
|
|
|
|
|
the number of loaded context files, to keep you informed about the active
|
|
|
|
|
|
context.
|
2025-05-15 20:04:33 -07:00
|
|
|
|
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- **Purpose:** These Markdown files contain instructions, guidelines, or context
|
|
|
|
|
|
that you want the Gemini model to be aware of during your interactions. The
|
|
|
|
|
|
system is designed to manage this instructional context hierarchically.
|
2025-05-15 20:04:33 -07:00
|
|
|
|
|
2025-12-01 11:38:48 -08:00
|
|
|
|
### Example context file content (e.g., `GEMINI.md`)
|
2025-05-15 20:04:33 -07:00
|
|
|
|
|
2025-10-09 08:17:37 -04:00
|
|
|
|
Here's a conceptual example of what a context file at the root of a TypeScript
|
|
|
|
|
|
project might contain:
|
2025-05-15 20:04:33 -07:00
|
|
|
|
|
|
|
|
|
|
```markdown
|
|
|
|
|
|
# Project: My Awesome TypeScript Library
|
|
|
|
|
|
|
|
|
|
|
|
## General Instructions:
|
|
|
|
|
|
|
|
|
|
|
|
- When generating new TypeScript code, please follow the existing coding style.
|
|
|
|
|
|
- Ensure all new functions and classes have JSDoc comments.
|
|
|
|
|
|
- Prefer functional programming paradigms where appropriate.
|
2025-07-05 07:55:15 -07:00
|
|
|
|
- All code should be compatible with TypeScript 5.0 and Node.js 20+.
|
2025-05-15 20:04:33 -07:00
|
|
|
|
|
|
|
|
|
|
## Coding Style:
|
|
|
|
|
|
|
|
|
|
|
|
- Use 2 spaces for indentation.
|
|
|
|
|
|
- Interface names should be prefixed with `I` (e.g., `IUserService`).
|
|
|
|
|
|
- Private class members should be prefixed with an underscore (`_`).
|
|
|
|
|
|
- Always use strict equality (`===` and `!==`).
|
|
|
|
|
|
|
|
|
|
|
|
## Specific Component: `src/api/client.ts`
|
|
|
|
|
|
|
|
|
|
|
|
- This file handles all outbound API requests.
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- When adding new API call functions, ensure they include robust error handling
|
|
|
|
|
|
and logging.
|
2025-05-15 20:04:33 -07:00
|
|
|
|
- Use the existing `fetchWithRetry` utility for all GET requests.
|
|
|
|
|
|
|
|
|
|
|
|
## Regarding Dependencies:
|
|
|
|
|
|
|
|
|
|
|
|
- Avoid introducing new external dependencies unless absolutely necessary.
|
|
|
|
|
|
- If a new dependency is required, please state the reason.
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2025-10-09 08:17:37 -04:00
|
|
|
|
This example demonstrates how you can provide general project context, specific
|
|
|
|
|
|
coding conventions, and even notes about particular files or components. The
|
|
|
|
|
|
more relevant and precise your context files are, the better the AI can assist
|
|
|
|
|
|
you. Project-specific context files are highly encouraged to establish
|
|
|
|
|
|
conventions and context.
|
|
|
|
|
|
|
2025-12-01 11:38:48 -08:00
|
|
|
|
- **Hierarchical loading and precedence:** The CLI implements a sophisticated
|
2025-10-09 08:17:37 -04:00
|
|
|
|
hierarchical memory system by loading context files (e.g., `GEMINI.md`) from
|
|
|
|
|
|
several locations. Content from files lower in this list (more specific)
|
|
|
|
|
|
typically overrides or supplements content from files higher up (more
|
|
|
|
|
|
general). The exact concatenation order and final context can be inspected
|
|
|
|
|
|
using the `/memory show` command. The typical loading order is:
|
2025-12-01 11:38:48 -08:00
|
|
|
|
1. **Global context file:**
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- Location: `~/.gemini/<configured-context-filename>` (e.g.,
|
|
|
|
|
|
`~/.gemini/GEMINI.md` in your user home directory).
|
2025-05-15 20:04:33 -07:00
|
|
|
|
- Scope: Provides default instructions for all your projects.
|
2025-12-01 11:38:48 -08:00
|
|
|
|
2. **Project root and ancestors context files:**
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- Location: The CLI searches for the configured context file in the
|
|
|
|
|
|
current working directory and then in each parent directory up to either
|
|
|
|
|
|
the project root (identified by a `.git` folder) or your home directory.
|
|
|
|
|
|
- Scope: Provides context relevant to the entire project or a significant
|
|
|
|
|
|
portion of it.
|
2025-12-01 11:38:48 -08:00
|
|
|
|
3. **Sub-directory context files (contextual/local):**
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- Location: The CLI also scans for the configured context file in
|
|
|
|
|
|
subdirectories _below_ the current working directory (respecting common
|
|
|
|
|
|
ignore patterns like `node_modules`, `.git`, etc.). The breadth of this
|
|
|
|
|
|
search is limited to 200 directories by default, but can be configured
|
|
|
|
|
|
with the `context.discoveryMaxDirs` setting in your `settings.json`
|
|
|
|
|
|
file.
|
|
|
|
|
|
- Scope: Allows for highly specific instructions relevant to a particular
|
|
|
|
|
|
component, module, or subsection of your project.
|
2025-12-01 11:38:48 -08:00
|
|
|
|
- **Concatenation and UI indication:** The contents of all found context files
|
|
|
|
|
|
are concatenated (with separators indicating their origin and path) and
|
|
|
|
|
|
provided as part of the system prompt to the Gemini model. The CLI footer
|
|
|
|
|
|
displays the count of loaded context files, giving you a quick visual cue
|
|
|
|
|
|
about the active instructional context.
|
|
|
|
|
|
- **Importing content:** You can modularize your context files by importing
|
2025-10-09 08:17:37 -04:00
|
|
|
|
other Markdown files using the `@path/to/file.md` syntax. For more details,
|
|
|
|
|
|
see the [Memory Import Processor documentation](../core/memport.md).
|
2025-12-01 11:38:48 -08:00
|
|
|
|
- **Commands for memory management:**
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- Use `/memory refresh` to force a re-scan and reload of all context files
|
|
|
|
|
|
from all configured locations. This updates the AI's instructional context.
|
|
|
|
|
|
- Use `/memory show` to display the combined instructional context currently
|
|
|
|
|
|
loaded, allowing you to verify the hierarchy and content being used by the
|
|
|
|
|
|
AI.
|
|
|
|
|
|
- See the [Commands documentation](../cli/commands.md#memory) for full details
|
|
|
|
|
|
on the `/memory` command and its sub-commands (`show` and `refresh`).
|
|
|
|
|
|
|
|
|
|
|
|
By understanding and utilizing these configuration layers and the hierarchical
|
|
|
|
|
|
nature of context files, you can effectively manage the AI's memory and tailor
|
|
|
|
|
|
the Gemini CLI's responses to your specific needs and projects.
|
2025-05-30 12:20:12 -07:00
|
|
|
|
|
2025-06-05 17:46:54 +02:00
|
|
|
|
## Sandboxing
|
|
|
|
|
|
|
2025-10-09 08:17:37 -04:00
|
|
|
|
The Gemini CLI can execute potentially unsafe operations (like shell commands
|
|
|
|
|
|
and file modifications) within a sandboxed environment to protect your system.
|
2025-06-05 17:46:54 +02:00
|
|
|
|
|
|
|
|
|
|
Sandboxing is disabled by default, but you can enable it in a few ways:
|
|
|
|
|
|
|
|
|
|
|
|
- Using `--sandbox` or `-s` flag.
|
|
|
|
|
|
- Setting `GEMINI_SANDBOX` environment variable.
|
2025-08-12 15:10:22 -07:00
|
|
|
|
- Sandbox is enabled when using `--yolo` or `--approval-mode=yolo` by default.
|
2025-06-05 17:46:54 +02:00
|
|
|
|
|
|
|
|
|
|
By default, it uses a pre-built `gemini-cli-sandbox` Docker image.
|
|
|
|
|
|
|
2025-10-09 08:17:37 -04:00
|
|
|
|
For project-specific sandboxing needs, you can create a custom Dockerfile at
|
|
|
|
|
|
`.gemini/sandbox.Dockerfile` in your project's root directory. This Dockerfile
|
|
|
|
|
|
can be based on the base sandbox image:
|
2025-06-05 17:46:54 +02:00
|
|
|
|
|
|
|
|
|
|
```dockerfile
|
|
|
|
|
|
FROM gemini-cli-sandbox
|
|
|
|
|
|
|
|
|
|
|
|
# Add your custom dependencies or configurations here
|
|
|
|
|
|
# For example:
|
|
|
|
|
|
# RUN apt-get update && apt-get install -y some-package
|
|
|
|
|
|
# COPY ./my-config /app/my-config
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2025-10-09 08:17:37 -04:00
|
|
|
|
When `.gemini/sandbox.Dockerfile` exists, you can use `BUILD_SANDBOX`
|
|
|
|
|
|
environment variable when running Gemini CLI to automatically build the custom
|
|
|
|
|
|
sandbox image:
|
2025-06-05 18:47:39 +02:00
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
BUILD_SANDBOX=1 gemini -s
|
|
|
|
|
|
```
|
2025-06-23 18:25:49 -04:00
|
|
|
|
|
2025-12-01 11:38:48 -08:00
|
|
|
|
## Usage statistics
|
2025-06-23 18:25:49 -04:00
|
|
|
|
|
2025-10-09 08:17:37 -04:00
|
|
|
|
To help us improve the Gemini CLI, we collect anonymized usage statistics. This
|
|
|
|
|
|
data helps us understand how the CLI is used, identify common issues, and
|
|
|
|
|
|
prioritize new features.
|
2025-06-23 18:25:49 -04:00
|
|
|
|
|
|
|
|
|
|
**What we collect:**
|
|
|
|
|
|
|
2025-12-01 11:38:48 -08:00
|
|
|
|
- **Tool calls:** We log the names of the tools that are called, whether they
|
2025-10-09 08:17:37 -04:00
|
|
|
|
succeed or fail, and how long they take to execute. We do not collect the
|
|
|
|
|
|
arguments passed to the tools or any data returned by them.
|
2025-12-01 11:38:48 -08:00
|
|
|
|
- **API requests:** We log the Gemini model used for each request, the duration
|
2025-10-09 08:17:37 -04:00
|
|
|
|
of the request, and whether it was successful. We do not collect the content
|
|
|
|
|
|
of the prompts or responses.
|
2025-12-01 11:38:48 -08:00
|
|
|
|
- **Session information:** We collect information about the configuration of the
|
2025-10-09 08:17:37 -04:00
|
|
|
|
CLI, such as the enabled tools and the approval mode.
|
2025-06-23 18:25:49 -04:00
|
|
|
|
|
|
|
|
|
|
**What we DON'T collect:**
|
|
|
|
|
|
|
2025-12-01 11:38:48 -08:00
|
|
|
|
- **Personally identifiable information (PII):** We do not collect any personal
|
2025-10-09 08:17:37 -04:00
|
|
|
|
information, such as your name, email address, or API keys.
|
2025-12-01 11:38:48 -08:00
|
|
|
|
- **Prompt and response content:** We do not log the content of your prompts or
|
2025-10-09 08:17:37 -04:00
|
|
|
|
the responses from the Gemini model.
|
2025-12-01 11:38:48 -08:00
|
|
|
|
- **File content:** We do not log the content of any files that are read or
|
2025-10-09 08:17:37 -04:00
|
|
|
|
written by the CLI.
|
2025-06-23 18:25:49 -04:00
|
|
|
|
|
|
|
|
|
|
**How to opt out:**
|
|
|
|
|
|
|
2025-10-09 08:17:37 -04:00
|
|
|
|
You can opt out of usage statistics collection at any time by setting the
|
|
|
|
|
|
`usageStatisticsEnabled` property to `false` under the `privacy` category in
|
|
|
|
|
|
your `settings.json` file:
|
2025-06-23 18:25:49 -04:00
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
{
|
2025-08-28 15:31:33 -07:00
|
|
|
|
"privacy": {
|
|
|
|
|
|
"usageStatisticsEnabled": false
|
|
|
|
|
|
}
|
2025-06-23 18:25:49 -04:00
|
|
|
|
}
|
|
|
|
|
|
```
|