@google/gemini-cli-core 0.21.0-nightly.20251218.739c02bd6 → 0.21.0-nightly.20251220.41a1a3eed

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. package/dist/docs/CONTRIBUTING.md +546 -0
  2. package/dist/docs/architecture.md +80 -0
  3. package/dist/docs/assets/connected_devtools.png +0 -0
  4. package/dist/docs/assets/gemini-screenshot.png +0 -0
  5. package/dist/docs/assets/release_patch.png +0 -0
  6. package/dist/docs/assets/theme-ansi-light.png +0 -0
  7. package/dist/docs/assets/theme-ansi.png +0 -0
  8. package/dist/docs/assets/theme-atom-one.png +0 -0
  9. package/dist/docs/assets/theme-ayu-light.png +0 -0
  10. package/dist/docs/assets/theme-ayu.png +0 -0
  11. package/dist/docs/assets/theme-custom.png +0 -0
  12. package/dist/docs/assets/theme-default-light.png +0 -0
  13. package/dist/docs/assets/theme-default.png +0 -0
  14. package/dist/docs/assets/theme-dracula.png +0 -0
  15. package/dist/docs/assets/theme-github-light.png +0 -0
  16. package/dist/docs/assets/theme-github.png +0 -0
  17. package/dist/docs/assets/theme-google-light.png +0 -0
  18. package/dist/docs/assets/theme-xcode-light.png +0 -0
  19. package/dist/docs/changelogs/index.md +592 -0
  20. package/dist/docs/changelogs/latest.md +225 -0
  21. package/dist/docs/changelogs/preview.md +129 -0
  22. package/dist/docs/changelogs/releases.md +896 -0
  23. package/dist/docs/cli/authentication.md +3 -0
  24. package/dist/docs/cli/checkpointing.md +94 -0
  25. package/dist/docs/cli/commands.md +354 -0
  26. package/dist/docs/cli/configuration.md +780 -0
  27. package/dist/docs/cli/custom-commands.md +315 -0
  28. package/dist/docs/cli/enterprise.md +565 -0
  29. package/dist/docs/cli/gemini-ignore.md +71 -0
  30. package/dist/docs/cli/gemini-md.md +108 -0
  31. package/dist/docs/cli/generation-settings.md +210 -0
  32. package/dist/docs/cli/headless.md +388 -0
  33. package/dist/docs/cli/index.md +63 -0
  34. package/dist/docs/cli/keyboard-shortcuts.md +143 -0
  35. package/dist/docs/cli/model-routing.md +37 -0
  36. package/dist/docs/cli/model.md +62 -0
  37. package/dist/docs/cli/sandbox.md +171 -0
  38. package/dist/docs/cli/session-management.md +158 -0
  39. package/dist/docs/cli/settings.md +112 -0
  40. package/dist/docs/cli/system-prompt.md +93 -0
  41. package/dist/docs/cli/telemetry.md +791 -0
  42. package/dist/docs/cli/themes.md +237 -0
  43. package/dist/docs/cli/token-caching.md +20 -0
  44. package/dist/docs/cli/trusted-folders.md +95 -0
  45. package/dist/docs/cli/tutorials.md +83 -0
  46. package/dist/docs/cli/uninstall.md +47 -0
  47. package/dist/docs/core/index.md +101 -0
  48. package/dist/docs/core/memport.md +244 -0
  49. package/dist/docs/core/policy-engine.md +267 -0
  50. package/dist/docs/core/tools-api.md +131 -0
  51. package/dist/docs/examples/proxy-script.md +83 -0
  52. package/dist/docs/extensions/extension-releasing.md +183 -0
  53. package/dist/docs/extensions/getting-started-extensions.md +245 -0
  54. package/dist/docs/extensions/index.md +293 -0
  55. package/dist/docs/faq.md +154 -0
  56. package/dist/docs/get-started/authentication.md +321 -0
  57. package/dist/docs/get-started/configuration-v1.md +888 -0
  58. package/dist/docs/get-started/configuration.md +1444 -0
  59. package/dist/docs/get-started/deployment.md +143 -0
  60. package/dist/docs/get-started/examples.md +219 -0
  61. package/dist/docs/get-started/gemini-3.md +116 -0
  62. package/dist/docs/get-started/index.md +71 -0
  63. package/dist/docs/get-started/installation.md +141 -0
  64. package/dist/docs/hooks/best-practices.md +806 -0
  65. package/dist/docs/hooks/index.md +665 -0
  66. package/dist/docs/hooks/reference.md +168 -0
  67. package/dist/docs/hooks/writing-hooks.md +1026 -0
  68. package/dist/docs/ide-integration/ide-companion-spec.md +267 -0
  69. package/dist/docs/ide-integration/index.md +202 -0
  70. package/dist/docs/index.md +147 -0
  71. package/dist/docs/integration-tests.md +211 -0
  72. package/dist/docs/issue-and-pr-automation.md +134 -0
  73. package/dist/docs/local-development.md +128 -0
  74. package/dist/docs/mermaid/context.mmd +103 -0
  75. package/dist/docs/mermaid/render-path.mmd +64 -0
  76. package/dist/docs/npm.md +62 -0
  77. package/dist/docs/quota-and-pricing.md +158 -0
  78. package/dist/docs/release-confidence.md +164 -0
  79. package/dist/docs/releases.md +540 -0
  80. package/dist/docs/sidebar.json +297 -0
  81. package/dist/docs/tools/file-system.md +217 -0
  82. package/dist/docs/tools/index.md +95 -0
  83. package/dist/docs/tools/mcp-server.md +1044 -0
  84. package/dist/docs/tools/memory.md +54 -0
  85. package/dist/docs/tools/shell.md +260 -0
  86. package/dist/docs/tools/todos.md +57 -0
  87. package/dist/docs/tools/web-fetch.md +59 -0
  88. package/dist/docs/tools/web-search.md +42 -0
  89. package/dist/docs/tos-privacy.md +96 -0
  90. package/dist/docs/troubleshooting.md +158 -0
  91. package/dist/google-gemini-cli-core-0.21.0-nightly.20251219.70696e364.tgz +0 -0
  92. package/dist/src/agents/delegate-to-agent-tool.test.js +1 -0
  93. package/dist/src/agents/delegate-to-agent-tool.test.js.map +1 -1
  94. package/dist/src/agents/introspection-agent.d.ts +23 -0
  95. package/dist/src/agents/introspection-agent.js +72 -0
  96. package/dist/src/agents/introspection-agent.js.map +1 -0
  97. package/dist/src/agents/introspection-agent.test.d.ts +6 -0
  98. package/dist/src/agents/introspection-agent.test.js +47 -0
  99. package/dist/src/agents/introspection-agent.test.js.map +1 -0
  100. package/dist/src/agents/local-executor.d.ts +0 -6
  101. package/dist/src/agents/local-executor.js +73 -47
  102. package/dist/src/agents/local-executor.js.map +1 -1
  103. package/dist/src/agents/local-executor.test.d.ts +1 -7
  104. package/dist/src/agents/local-executor.test.js +27 -9
  105. package/dist/src/agents/local-executor.test.js.map +1 -1
  106. package/dist/src/agents/registry.d.ts +1 -0
  107. package/dist/src/agents/registry.js +51 -7
  108. package/dist/src/agents/registry.js.map +1 -1
  109. package/dist/src/agents/registry.test.js +112 -1
  110. package/dist/src/agents/registry.test.js.map +1 -1
  111. package/dist/src/agents/toml-loader.d.ts +65 -0
  112. package/dist/src/agents/toml-loader.js +176 -0
  113. package/dist/src/agents/toml-loader.js.map +1 -0
  114. package/dist/src/agents/toml-loader.test.d.ts +6 -0
  115. package/dist/src/agents/toml-loader.test.js +190 -0
  116. package/dist/src/agents/toml-loader.test.js.map +1 -0
  117. package/dist/src/availability/modelAvailabilityService.d.ts +2 -1
  118. package/dist/src/config/config.d.ts +9 -0
  119. package/dist/src/config/config.js +29 -0
  120. package/dist/src/config/config.js.map +1 -1
  121. package/dist/src/config/config.test.js +59 -1
  122. package/dist/src/config/config.test.js.map +1 -1
  123. package/dist/src/config/storage.d.ts +2 -0
  124. package/dist/src/config/storage.js +6 -0
  125. package/dist/src/config/storage.js.map +1 -1
  126. package/dist/src/config/storage.test.js +8 -0
  127. package/dist/src/config/storage.test.js.map +1 -1
  128. package/dist/src/core/client.js +8 -4
  129. package/dist/src/core/client.js.map +1 -1
  130. package/dist/src/core/client.test.js +20 -0
  131. package/dist/src/core/client.test.js.map +1 -1
  132. package/dist/src/core/clientHookTriggers.js +2 -2
  133. package/dist/src/core/clientHookTriggers.js.map +1 -1
  134. package/dist/src/core/coreToolHookTriggers.js +3 -3
  135. package/dist/src/core/coreToolHookTriggers.js.map +1 -1
  136. package/dist/src/core/geminiChatHookTriggers.js +3 -3
  137. package/dist/src/core/geminiChatHookTriggers.js.map +1 -1
  138. package/dist/src/core/sessionHookTriggers.js +3 -3
  139. package/dist/src/core/sessionHookTriggers.js.map +1 -1
  140. package/dist/src/generated/git-commit.d.ts +2 -2
  141. package/dist/src/generated/git-commit.js +2 -2
  142. package/dist/src/hooks/hookEventHandler.js +10 -4
  143. package/dist/src/hooks/hookEventHandler.js.map +1 -1
  144. package/dist/src/hooks/hookEventHandler.test.js +40 -0
  145. package/dist/src/hooks/hookEventHandler.test.js.map +1 -1
  146. package/dist/src/hooks/hookPlanner.js +3 -1
  147. package/dist/src/hooks/hookPlanner.js.map +1 -1
  148. package/dist/src/hooks/hookPlanner.test.js +61 -0
  149. package/dist/src/hooks/hookPlanner.test.js.map +1 -1
  150. package/dist/src/hooks/hookRegistry.d.ts +1 -1
  151. package/dist/src/hooks/hookRegistry.js +2 -2
  152. package/dist/src/hooks/hookRegistry.js.map +1 -1
  153. package/dist/src/hooks/hookRegistry.test.js +73 -0
  154. package/dist/src/hooks/hookRegistry.test.js.map +1 -1
  155. package/dist/src/hooks/hookRunner.js +14 -10
  156. package/dist/src/hooks/hookRunner.js.map +1 -1
  157. package/dist/src/hooks/hookRunner.test.js +81 -33
  158. package/dist/src/hooks/hookRunner.test.js.map +1 -1
  159. package/dist/src/hooks/types.d.ts +2 -0
  160. package/dist/src/hooks/types.js.map +1 -1
  161. package/dist/src/mcp/oauth-provider.js +6 -2
  162. package/dist/src/mcp/oauth-provider.js.map +1 -1
  163. package/dist/src/mcp/oauth-provider.test.js +4 -1
  164. package/dist/src/mcp/oauth-provider.test.js.map +1 -1
  165. package/dist/src/mcp/oauth-utils.d.ts +8 -1
  166. package/dist/src/mcp/oauth-utils.js +30 -1
  167. package/dist/src/mcp/oauth-utils.js.map +1 -1
  168. package/dist/src/mcp/oauth-utils.test.js +42 -0
  169. package/dist/src/mcp/oauth-utils.test.js.map +1 -1
  170. package/dist/src/services/contextManager.d.ts +5 -11
  171. package/dist/src/services/contextManager.js +20 -17
  172. package/dist/src/services/contextManager.js.map +1 -1
  173. package/dist/src/services/contextManager.test.js +40 -41
  174. package/dist/src/services/contextManager.test.js.map +1 -1
  175. package/dist/src/services/shellExecutionService.js +18 -2
  176. package/dist/src/services/shellExecutionService.js.map +1 -1
  177. package/dist/src/tools/get-internal-docs.d.ts +27 -0
  178. package/dist/src/tools/get-internal-docs.js +129 -0
  179. package/dist/src/tools/get-internal-docs.js.map +1 -0
  180. package/dist/src/tools/get-internal-docs.test.d.ts +6 -0
  181. package/dist/src/tools/get-internal-docs.test.js +56 -0
  182. package/dist/src/tools/get-internal-docs.test.js.map +1 -0
  183. package/dist/src/tools/tool-names.d.ts +14 -0
  184. package/dist/src/tools/tool-names.js +55 -0
  185. package/dist/src/tools/tool-names.js.map +1 -1
  186. package/dist/src/tools/tool-names.test.d.ts +6 -0
  187. package/dist/src/tools/tool-names.test.js +43 -0
  188. package/dist/src/tools/tool-names.test.js.map +1 -0
  189. package/dist/src/tools/tool-registry.d.ts +0 -1
  190. package/dist/src/tools/tool-registry.js +1 -1
  191. package/dist/src/tools/tool-registry.js.map +1 -1
  192. package/dist/src/tools/tool-registry.test.js +2 -1
  193. package/dist/src/tools/tool-registry.test.js.map +1 -1
  194. package/dist/src/utils/environmentContext.js +3 -0
  195. package/dist/src/utils/environmentContext.js.map +1 -1
  196. package/dist/src/utils/environmentContext.test.js +2 -0
  197. package/dist/src/utils/environmentContext.test.js.map +1 -1
  198. package/dist/src/utils/events.d.ts +3 -2
  199. package/dist/src/utils/events.js.map +1 -1
  200. package/dist/src/utils/googleQuotaErrors.js +20 -0
  201. package/dist/src/utils/googleQuotaErrors.js.map +1 -1
  202. package/dist/src/utils/googleQuotaErrors.test.js +53 -2
  203. package/dist/src/utils/googleQuotaErrors.test.js.map +1 -1
  204. package/dist/src/utils/memoryDiscovery.js +1 -1
  205. package/dist/src/utils/memoryDiscovery.js.map +1 -1
  206. package/dist/src/utils/memoryDiscovery.test.js +3 -1
  207. package/dist/src/utils/memoryDiscovery.test.js.map +1 -1
  208. package/dist/src/utils/shell-utils.js +25 -4
  209. package/dist/src/utils/shell-utils.js.map +1 -1
  210. package/dist/tsconfig.tsbuildinfo +1 -1
  211. package/package.json +1 -6
  212. package/dist/google-gemini-cli-core-0.21.0-nightly.20251216.bb0c0d8ee.tgz +0 -0
@@ -0,0 +1,1444 @@
1
+ # Gemini CLI configuration
2
+
3
+ > **Note on configuration format, 9/17/25:** The format of the `settings.json`
4
+ > file has been updated to a new, more organized structure.
5
+ >
6
+ > - The new format will be supported in the stable release starting
7
+ > **[09/10/25]**.
8
+ > - Automatic migration from the old format to the new format will begin on
9
+ > **[09/17/25]**.
10
+ >
11
+ > For details on the previous format, please see the
12
+ > [v1 Configuration documentation](./configuration-v1.md).
13
+
14
+ Gemini CLI offers several ways to configure its behavior, including environment
15
+ variables, command-line arguments, and settings files. This document outlines
16
+ the different configuration methods and available settings.
17
+
18
+ ## Configuration layers
19
+
20
+ Configuration is applied in the following order of precedence (lower numbers are
21
+ overridden by higher numbers):
22
+
23
+ 1. **Default values:** Hardcoded defaults within the application.
24
+ 2. **System defaults file:** System-wide default settings that can be
25
+ overridden by other settings files.
26
+ 3. **User settings file:** Global settings for the current user.
27
+ 4. **Project settings file:** Project-specific settings.
28
+ 5. **System settings file:** System-wide settings that override all other
29
+ settings files.
30
+ 6. **Environment variables:** System-wide or session-specific variables,
31
+ potentially loaded from `.env` files.
32
+ 7. **Command-line arguments:** Values passed when launching the CLI.
33
+
34
+ ## Settings files
35
+
36
+ Gemini CLI uses JSON settings files for persistent configuration. There are four
37
+ locations for these files:
38
+
39
+ > **Tip:** JSON-aware editors can use autocomplete and validation by pointing to
40
+ > the generated schema at `schemas/settings.schema.json` in this repository.
41
+ > When working outside the repo, reference the hosted schema at
42
+ > `https://raw.githubusercontent.com/google-gemini/gemini-cli/main/schemas/settings.schema.json`.
43
+
44
+ - **System defaults file:**
45
+ - **Location:** `/etc/gemini-cli/system-defaults.json` (Linux),
46
+ `C:\ProgramData\gemini-cli\system-defaults.json` (Windows) or
47
+ `/Library/Application Support/GeminiCli/system-defaults.json` (macOS). The
48
+ path can be overridden using the `GEMINI_CLI_SYSTEM_DEFAULTS_PATH`
49
+ environment variable.
50
+ - **Scope:** Provides a base layer of system-wide default settings. These
51
+ settings have the lowest precedence and are intended to be overridden by
52
+ user, project, or system override settings.
53
+ - **User settings file:**
54
+ - **Location:** `~/.gemini/settings.json` (where `~` is your home directory).
55
+ - **Scope:** Applies to all Gemini CLI sessions for the current user. User
56
+ settings override system defaults.
57
+ - **Project settings file:**
58
+ - **Location:** `.gemini/settings.json` within your project's root directory.
59
+ - **Scope:** Applies only when running Gemini CLI from that specific project.
60
+ Project settings override user settings and system defaults.
61
+ - **System settings file:**
62
+ - **Location:** `/etc/gemini-cli/settings.json` (Linux),
63
+ `C:\ProgramData\gemini-cli\settings.json` (Windows) or
64
+ `/Library/Application Support/GeminiCli/settings.json` (macOS). The path can
65
+ be overridden using the `GEMINI_CLI_SYSTEM_SETTINGS_PATH` environment
66
+ variable.
67
+ - **Scope:** Applies to all Gemini CLI sessions on the system, for all users.
68
+ System settings act as overrides, taking precedence over all other settings
69
+ files. May be useful for system administrators at enterprises to have
70
+ controls over users' Gemini CLI setups.
71
+
72
+ **Note on environment variables in settings:** String values within your
73
+ `settings.json` and `gemini-extension.json` files can reference environment
74
+ variables using either `$VAR_NAME` or `${VAR_NAME}` syntax. These variables will
75
+ be automatically resolved when the settings are loaded. For example, if you have
76
+ an environment variable `MY_API_TOKEN`, you could use it in `settings.json` like
77
+ this: `"apiKey": "$MY_API_TOKEN"`. Additionally, each extension can have its own
78
+ `.env` file in its directory, which will be loaded automatically.
79
+
80
+ > **Note for Enterprise Users:** For guidance on deploying and managing Gemini
81
+ > CLI in a corporate environment, please see the
82
+ > [Enterprise Configuration](../cli/enterprise.md) documentation.
83
+
84
+ ### The `.gemini` directory in your project
85
+
86
+ In addition to a project settings file, a project's `.gemini` directory can
87
+ contain other project-specific files related to Gemini CLI's operation, such as:
88
+
89
+ - [Custom sandbox profiles](#sandboxing) (e.g.,
90
+ `.gemini/sandbox-macos-custom.sb`, `.gemini/sandbox.Dockerfile`).
91
+
92
+ ### Available settings in `settings.json`
93
+
94
+ Settings are organized into categories. All settings should be placed within
95
+ their corresponding top-level category object in your `settings.json` file.
96
+
97
+ <!-- SETTINGS-AUTOGEN:START -->
98
+
99
+ #### `general`
100
+
101
+ - **`general.previewFeatures`** (boolean):
102
+ - **Description:** Enable preview features (e.g., preview models).
103
+ - **Default:** `false`
104
+
105
+ - **`general.preferredEditor`** (string):
106
+ - **Description:** The preferred editor to open files in.
107
+ - **Default:** `undefined`
108
+
109
+ - **`general.vimMode`** (boolean):
110
+ - **Description:** Enable Vim keybindings
111
+ - **Default:** `false`
112
+
113
+ - **`general.disableAutoUpdate`** (boolean):
114
+ - **Description:** Disable automatic updates
115
+ - **Default:** `false`
116
+
117
+ - **`general.disableUpdateNag`** (boolean):
118
+ - **Description:** Disable update notification prompts.
119
+ - **Default:** `false`
120
+
121
+ - **`general.checkpointing.enabled`** (boolean):
122
+ - **Description:** Enable session checkpointing for recovery
123
+ - **Default:** `false`
124
+ - **Requires restart:** Yes
125
+
126
+ - **`general.enablePromptCompletion`** (boolean):
127
+ - **Description:** Enable AI-powered prompt completion suggestions while
128
+ typing.
129
+ - **Default:** `false`
130
+ - **Requires restart:** Yes
131
+
132
+ - **`general.retryFetchErrors`** (boolean):
133
+ - **Description:** Retry on "exception TypeError: fetch failed sending
134
+ request" errors.
135
+ - **Default:** `false`
136
+
137
+ - **`general.debugKeystrokeLogging`** (boolean):
138
+ - **Description:** Enable debug logging of keystrokes to the console.
139
+ - **Default:** `false`
140
+
141
+ - **`general.sessionRetention.enabled`** (boolean):
142
+ - **Description:** Enable automatic session cleanup
143
+ - **Default:** `false`
144
+
145
+ - **`general.sessionRetention.maxAge`** (string):
146
+ - **Description:** Maximum age of sessions to keep (e.g., "30d", "7d", "24h",
147
+ "1w")
148
+ - **Default:** `undefined`
149
+
150
+ - **`general.sessionRetention.maxCount`** (number):
151
+ - **Description:** Alternative: Maximum number of sessions to keep (most
152
+ recent)
153
+ - **Default:** `undefined`
154
+
155
+ - **`general.sessionRetention.minRetention`** (string):
156
+ - **Description:** Minimum retention period (safety limit, defaults to "1d")
157
+ - **Default:** `"1d"`
158
+
159
+ #### `output`
160
+
161
+ - **`output.format`** (enum):
162
+ - **Description:** The format of the CLI output.
163
+ - **Default:** `"text"`
164
+ - **Values:** `"text"`, `"json"`
165
+
166
+ #### `ui`
167
+
168
+ - **`ui.theme`** (string):
169
+ - **Description:** The color theme for the UI. See the CLI themes guide for
170
+ available options.
171
+ - **Default:** `undefined`
172
+
173
+ - **`ui.customThemes`** (object):
174
+ - **Description:** Custom theme definitions.
175
+ - **Default:** `{}`
176
+
177
+ - **`ui.hideWindowTitle`** (boolean):
178
+ - **Description:** Hide the window title bar
179
+ - **Default:** `false`
180
+ - **Requires restart:** Yes
181
+
182
+ - **`ui.showStatusInTitle`** (boolean):
183
+ - **Description:** Show Gemini CLI status and thoughts in the terminal window
184
+ title
185
+ - **Default:** `false`
186
+
187
+ - **`ui.hideTips`** (boolean):
188
+ - **Description:** Hide helpful tips in the UI
189
+ - **Default:** `false`
190
+
191
+ - **`ui.hideBanner`** (boolean):
192
+ - **Description:** Hide the application banner
193
+ - **Default:** `false`
194
+
195
+ - **`ui.hideContextSummary`** (boolean):
196
+ - **Description:** Hide the context summary (GEMINI.md, MCP servers) above the
197
+ input.
198
+ - **Default:** `false`
199
+
200
+ - **`ui.footer.hideCWD`** (boolean):
201
+ - **Description:** Hide the current working directory path in the footer.
202
+ - **Default:** `false`
203
+
204
+ - **`ui.footer.hideSandboxStatus`** (boolean):
205
+ - **Description:** Hide the sandbox status indicator in the footer.
206
+ - **Default:** `false`
207
+
208
+ - **`ui.footer.hideModelInfo`** (boolean):
209
+ - **Description:** Hide the model name and context usage in the footer.
210
+ - **Default:** `false`
211
+
212
+ - **`ui.footer.hideContextPercentage`** (boolean):
213
+ - **Description:** Hides the context window remaining percentage.
214
+ - **Default:** `true`
215
+
216
+ - **`ui.hideFooter`** (boolean):
217
+ - **Description:** Hide the footer from the UI
218
+ - **Default:** `false`
219
+
220
+ - **`ui.showMemoryUsage`** (boolean):
221
+ - **Description:** Display memory usage information in the UI
222
+ - **Default:** `false`
223
+
224
+ - **`ui.showLineNumbers`** (boolean):
225
+ - **Description:** Show line numbers in the chat.
226
+ - **Default:** `true`
227
+
228
+ - **`ui.showCitations`** (boolean):
229
+ - **Description:** Show citations for generated text in the chat.
230
+ - **Default:** `false`
231
+
232
+ - **`ui.showModelInfoInChat`** (boolean):
233
+ - **Description:** Show the model name in the chat for each model turn.
234
+ - **Default:** `false`
235
+
236
+ - **`ui.useFullWidth`** (boolean):
237
+ - **Description:** Use the entire width of the terminal for output.
238
+ - **Default:** `true`
239
+
240
+ - **`ui.useAlternateBuffer`** (boolean):
241
+ - **Description:** Use an alternate screen buffer for the UI, preserving shell
242
+ history.
243
+ - **Default:** `false`
244
+ - **Requires restart:** Yes
245
+
246
+ - **`ui.incrementalRendering`** (boolean):
247
+ - **Description:** Enable incremental rendering for the UI. This option will
248
+ reduce flickering but may cause rendering artifacts. Only supported when
249
+ useAlternateBuffer is enabled.
250
+ - **Default:** `true`
251
+ - **Requires restart:** Yes
252
+
253
+ - **`ui.customWittyPhrases`** (array):
254
+ - **Description:** Custom witty phrases to display during loading. When
255
+ provided, the CLI cycles through these instead of the defaults.
256
+ - **Default:** `[]`
257
+
258
+ - **`ui.accessibility.disableLoadingPhrases`** (boolean):
259
+ - **Description:** Disable loading phrases for accessibility
260
+ - **Default:** `false`
261
+ - **Requires restart:** Yes
262
+
263
+ - **`ui.accessibility.screenReader`** (boolean):
264
+ - **Description:** Render output in plain-text to be more screen reader
265
+ accessible
266
+ - **Default:** `false`
267
+ - **Requires restart:** Yes
268
+
269
+ #### `ide`
270
+
271
+ - **`ide.enabled`** (boolean):
272
+ - **Description:** Enable IDE integration mode
273
+ - **Default:** `false`
274
+ - **Requires restart:** Yes
275
+
276
+ - **`ide.hasSeenNudge`** (boolean):
277
+ - **Description:** Whether the user has seen the IDE integration nudge.
278
+ - **Default:** `false`
279
+
280
+ #### `privacy`
281
+
282
+ - **`privacy.usageStatisticsEnabled`** (boolean):
283
+ - **Description:** Enable collection of usage statistics
284
+ - **Default:** `true`
285
+ - **Requires restart:** Yes
286
+
287
+ #### `model`
288
+
289
+ - **`model.name`** (string):
290
+ - **Description:** The Gemini model to use for conversations.
291
+ - **Default:** `undefined`
292
+
293
+ - **`model.maxSessionTurns`** (number):
294
+ - **Description:** Maximum number of user/model/tool turns to keep in a
295
+ session. -1 means unlimited.
296
+ - **Default:** `-1`
297
+
298
+ - **`model.summarizeToolOutput`** (object):
299
+ - **Description:** Enables or disables summarization of tool output. Configure
300
+ per-tool token budgets (for example {"run_shell_command": {"tokenBudget":
301
+ 2000}}). Currently only the run_shell_command tool supports summarization.
302
+ - **Default:** `undefined`
303
+
304
+ - **`model.compressionThreshold`** (number):
305
+ - **Description:** The fraction of context usage at which to trigger context
306
+ compression (e.g. 0.2, 0.3).
307
+ - **Default:** `0.5`
308
+ - **Requires restart:** Yes
309
+
310
+ - **`model.skipNextSpeakerCheck`** (boolean):
311
+ - **Description:** Skip the next speaker check.
312
+ - **Default:** `true`
313
+
314
+ #### `modelConfigs`
315
+
316
+ - **`modelConfigs.aliases`** (object):
317
+ - **Description:** Named presets for model configs. Can be used in place of a
318
+ model name and can inherit from other aliases using an `extends` property.
319
+ - **Default:**
320
+
321
+ ```json
322
+ {
323
+ "base": {
324
+ "modelConfig": {
325
+ "generateContentConfig": {
326
+ "temperature": 0,
327
+ "topP": 1
328
+ }
329
+ }
330
+ },
331
+ "chat-base": {
332
+ "extends": "base",
333
+ "modelConfig": {
334
+ "generateContentConfig": {
335
+ "thinkingConfig": {
336
+ "includeThoughts": true
337
+ },
338
+ "temperature": 1,
339
+ "topP": 0.95,
340
+ "topK": 64
341
+ }
342
+ }
343
+ },
344
+ "chat-base-2.5": {
345
+ "extends": "chat-base",
346
+ "modelConfig": {
347
+ "generateContentConfig": {
348
+ "thinkingConfig": {
349
+ "thinkingBudget": 8192
350
+ }
351
+ }
352
+ }
353
+ },
354
+ "chat-base-3": {
355
+ "extends": "chat-base",
356
+ "modelConfig": {
357
+ "generateContentConfig": {
358
+ "thinkingConfig": {
359
+ "thinkingLevel": "HIGH"
360
+ }
361
+ }
362
+ }
363
+ },
364
+ "gemini-3-pro-preview": {
365
+ "extends": "chat-base-3",
366
+ "modelConfig": {
367
+ "model": "gemini-3-pro-preview"
368
+ }
369
+ },
370
+ "gemini-3-flash-preview": {
371
+ "extends": "chat-base-3",
372
+ "modelConfig": {
373
+ "model": "gemini-3-flash-preview"
374
+ }
375
+ },
376
+ "gemini-2.5-pro": {
377
+ "extends": "chat-base-2.5",
378
+ "modelConfig": {
379
+ "model": "gemini-2.5-pro"
380
+ }
381
+ },
382
+ "gemini-2.5-flash": {
383
+ "extends": "chat-base-2.5",
384
+ "modelConfig": {
385
+ "model": "gemini-2.5-flash"
386
+ }
387
+ },
388
+ "gemini-2.5-flash-lite": {
389
+ "extends": "chat-base-2.5",
390
+ "modelConfig": {
391
+ "model": "gemini-2.5-flash-lite"
392
+ }
393
+ },
394
+ "gemini-2.5-flash-base": {
395
+ "extends": "base",
396
+ "modelConfig": {
397
+ "model": "gemini-2.5-flash"
398
+ }
399
+ },
400
+ "classifier": {
401
+ "extends": "base",
402
+ "modelConfig": {
403
+ "model": "gemini-2.5-flash-lite",
404
+ "generateContentConfig": {
405
+ "maxOutputTokens": 1024,
406
+ "thinkingConfig": {
407
+ "thinkingBudget": 512
408
+ }
409
+ }
410
+ }
411
+ },
412
+ "prompt-completion": {
413
+ "extends": "base",
414
+ "modelConfig": {
415
+ "model": "gemini-2.5-flash-lite",
416
+ "generateContentConfig": {
417
+ "temperature": 0.3,
418
+ "maxOutputTokens": 16000,
419
+ "thinkingConfig": {
420
+ "thinkingBudget": 0
421
+ }
422
+ }
423
+ }
424
+ },
425
+ "edit-corrector": {
426
+ "extends": "base",
427
+ "modelConfig": {
428
+ "model": "gemini-2.5-flash-lite",
429
+ "generateContentConfig": {
430
+ "thinkingConfig": {
431
+ "thinkingBudget": 0
432
+ }
433
+ }
434
+ }
435
+ },
436
+ "summarizer-default": {
437
+ "extends": "base",
438
+ "modelConfig": {
439
+ "model": "gemini-2.5-flash-lite",
440
+ "generateContentConfig": {
441
+ "maxOutputTokens": 2000
442
+ }
443
+ }
444
+ },
445
+ "summarizer-shell": {
446
+ "extends": "base",
447
+ "modelConfig": {
448
+ "model": "gemini-2.5-flash-lite",
449
+ "generateContentConfig": {
450
+ "maxOutputTokens": 2000
451
+ }
452
+ }
453
+ },
454
+ "web-search": {
455
+ "extends": "gemini-2.5-flash-base",
456
+ "modelConfig": {
457
+ "generateContentConfig": {
458
+ "tools": [
459
+ {
460
+ "googleSearch": {}
461
+ }
462
+ ]
463
+ }
464
+ }
465
+ },
466
+ "web-fetch": {
467
+ "extends": "gemini-2.5-flash-base",
468
+ "modelConfig": {
469
+ "generateContentConfig": {
470
+ "tools": [
471
+ {
472
+ "urlContext": {}
473
+ }
474
+ ]
475
+ }
476
+ }
477
+ },
478
+ "web-fetch-fallback": {
479
+ "extends": "gemini-2.5-flash-base",
480
+ "modelConfig": {}
481
+ },
482
+ "loop-detection": {
483
+ "extends": "gemini-2.5-flash-base",
484
+ "modelConfig": {}
485
+ },
486
+ "loop-detection-double-check": {
487
+ "extends": "base",
488
+ "modelConfig": {
489
+ "model": "gemini-2.5-pro"
490
+ }
491
+ },
492
+ "llm-edit-fixer": {
493
+ "extends": "gemini-2.5-flash-base",
494
+ "modelConfig": {}
495
+ },
496
+ "next-speaker-checker": {
497
+ "extends": "gemini-2.5-flash-base",
498
+ "modelConfig": {}
499
+ },
500
+ "chat-compression-3-pro": {
501
+ "modelConfig": {
502
+ "model": "gemini-3-pro-preview"
503
+ }
504
+ },
505
+ "chat-compression-3-flash": {
506
+ "modelConfig": {
507
+ "model": "gemini-3-flash-preview"
508
+ }
509
+ },
510
+ "chat-compression-2.5-pro": {
511
+ "modelConfig": {
512
+ "model": "gemini-2.5-pro"
513
+ }
514
+ },
515
+ "chat-compression-2.5-flash": {
516
+ "modelConfig": {
517
+ "model": "gemini-2.5-flash"
518
+ }
519
+ },
520
+ "chat-compression-2.5-flash-lite": {
521
+ "modelConfig": {
522
+ "model": "gemini-2.5-flash-lite"
523
+ }
524
+ },
525
+ "chat-compression-default": {
526
+ "modelConfig": {
527
+ "model": "gemini-2.5-pro"
528
+ }
529
+ }
530
+ }
531
+ ```
532
+
533
+ - **`modelConfigs.customAliases`** (object):
534
+ - **Description:** Custom named presets for model configs. These are merged
535
+ with (and override) the built-in aliases.
536
+ - **Default:** `{}`
537
+
538
+ - **`modelConfigs.customOverrides`** (array):
539
+ - **Description:** Custom model config overrides. These are merged with (and
540
+ added to) the built-in overrides.
541
+ - **Default:** `[]`
542
+
543
+ - **`modelConfigs.overrides`** (array):
544
+ - **Description:** Apply specific configuration overrides based on matches,
545
+ with a primary key of model (or alias). The most specific match will be
546
+ used.
547
+ - **Default:** `[]`
548
+
549
+ #### `context`
550
+
551
+ - **`context.fileName`** (string | string[]):
552
+ - **Description:** The name of the context file or files to load into memory.
553
+ Accepts either a single string or an array of strings.
554
+ - **Default:** `undefined`
555
+
556
+ - **`context.importFormat`** (string):
557
+ - **Description:** The format to use when importing memory.
558
+ - **Default:** `undefined`
559
+
560
+ - **`context.discoveryMaxDirs`** (number):
561
+ - **Description:** Maximum number of directories to search for memory.
562
+ - **Default:** `200`
563
+
564
+ - **`context.includeDirectories`** (array):
565
+ - **Description:** Additional directories to include in the workspace context.
566
+ Missing directories will be skipped with a warning.
567
+ - **Default:** `[]`
568
+
569
+ - **`context.loadMemoryFromIncludeDirectories`** (boolean):
570
+ - **Description:** Controls how /memory refresh loads GEMINI.md files. When
571
+ true, include directories are scanned; when false, only the current
572
+ directory is used.
573
+ - **Default:** `false`
574
+
575
+ - **`context.fileFiltering.respectGitIgnore`** (boolean):
576
+ - **Description:** Respect .gitignore files when searching
577
+ - **Default:** `true`
578
+ - **Requires restart:** Yes
579
+
580
+ - **`context.fileFiltering.respectGeminiIgnore`** (boolean):
581
+ - **Description:** Respect .geminiignore files when searching
582
+ - **Default:** `true`
583
+ - **Requires restart:** Yes
584
+
585
+ - **`context.fileFiltering.enableRecursiveFileSearch`** (boolean):
586
+ - **Description:** Enable recursive file search functionality when completing
587
+ @ references in the prompt.
588
+ - **Default:** `true`
589
+ - **Requires restart:** Yes
590
+
591
+ - **`context.fileFiltering.disableFuzzySearch`** (boolean):
592
+ - **Description:** Disable fuzzy search when searching for files.
593
+ - **Default:** `false`
594
+ - **Requires restart:** Yes
595
+
596
+ #### `tools`
597
+
598
+ - **`tools.sandbox`** (boolean | string):
599
+ - **Description:** Sandbox execution environment. Set to a boolean to enable
600
+ or disable the sandbox, or provide a string path to a sandbox profile.
601
+ - **Default:** `undefined`
602
+ - **Requires restart:** Yes
603
+
604
+ - **`tools.shell.enableInteractiveShell`** (boolean):
605
+ - **Description:** Use node-pty for an interactive shell experience. Fallback
606
+ to child_process still applies.
607
+ - **Default:** `true`
608
+ - **Requires restart:** Yes
609
+
610
+ - **`tools.shell.pager`** (string):
611
+ - **Description:** The pager command to use for shell output. Defaults to
612
+ `cat`.
613
+ - **Default:** `"cat"`
614
+
615
+ - **`tools.shell.showColor`** (boolean):
616
+ - **Description:** Show color in shell output.
617
+ - **Default:** `false`
618
+
619
+ - **`tools.shell.inactivityTimeout`** (number):
620
+ - **Description:** The maximum time in seconds allowed without output from the
621
+ shell command. Defaults to 5 minutes.
622
+ - **Default:** `300`
623
+
624
+ - **`tools.autoAccept`** (boolean):
625
+ - **Description:** Automatically accept and execute tool calls that are
626
+ considered safe (e.g., read-only operations).
627
+ - **Default:** `false`
628
+
629
+ - **`tools.core`** (array):
630
+ - **Description:** Restrict the set of built-in tools with an allowlist. Match
631
+ semantics mirror tools.allowed; see the built-in tools documentation for
632
+ available names.
633
+ - **Default:** `undefined`
634
+ - **Requires restart:** Yes
635
+
636
+ - **`tools.allowed`** (array):
637
+ - **Description:** Tool names that bypass the confirmation dialog. Useful for
638
+ trusted commands (for example ["run_shell_command(git)",
639
+ "run_shell_command(npm test)"]). See shell tool command restrictions for
640
+ matching details.
641
+ - **Default:** `undefined`
642
+ - **Requires restart:** Yes
643
+
644
+ - **`tools.exclude`** (array):
645
+ - **Description:** Tool names to exclude from discovery.
646
+ - **Default:** `undefined`
647
+ - **Requires restart:** Yes
648
+
649
+ - **`tools.discoveryCommand`** (string):
650
+ - **Description:** Command to run for tool discovery.
651
+ - **Default:** `undefined`
652
+ - **Requires restart:** Yes
653
+
654
+ - **`tools.callCommand`** (string):
655
+ - **Description:** Defines a custom shell command for invoking discovered
656
+ tools. The command must take the tool name as the first argument, read JSON
657
+ arguments from stdin, and emit JSON results on stdout.
658
+ - **Default:** `undefined`
659
+ - **Requires restart:** Yes
660
+
661
+ - **`tools.useRipgrep`** (boolean):
662
+ - **Description:** Use ripgrep for file content search instead of the fallback
663
+ implementation. Provides faster search performance.
664
+ - **Default:** `true`
665
+
666
+ - **`tools.enableToolOutputTruncation`** (boolean):
667
+ - **Description:** Enable truncation of large tool outputs.
668
+ - **Default:** `true`
669
+ - **Requires restart:** Yes
670
+
671
+ - **`tools.truncateToolOutputThreshold`** (number):
672
+ - **Description:** Truncate tool output if it is larger than this many
673
+ characters. Set to -1 to disable.
674
+ - **Default:** `4000000`
675
+ - **Requires restart:** Yes
676
+
677
+ - **`tools.truncateToolOutputLines`** (number):
678
+ - **Description:** The number of lines to keep when truncating tool output.
679
+ - **Default:** `1000`
680
+ - **Requires restart:** Yes
681
+
682
+ - **`tools.enableMessageBusIntegration`** (boolean):
683
+ - **Description:** Enable policy-based tool confirmation via message bus
684
+ integration. When enabled, tools automatically respect policy engine
685
+ decisions (ALLOW/DENY/ASK_USER) without requiring individual tool
686
+ implementations.
687
+ - **Default:** `true`
688
+ - **Requires restart:** Yes
689
+
690
+ - **`tools.enableHooks`** (boolean):
691
+ - **Description:** Enable the hooks system for intercepting and customizing
692
+ Gemini CLI behavior. When enabled, hooks configured in settings will execute
693
+ at appropriate lifecycle events (BeforeTool, AfterTool, BeforeModel, etc.).
694
+ Requires MessageBus integration.
695
+ - **Default:** `false`
696
+ - **Requires restart:** Yes
697
+
698
+ #### `mcp`
699
+
700
+ - **`mcp.serverCommand`** (string):
701
+ - **Description:** Command to start an MCP server.
702
+ - **Default:** `undefined`
703
+ - **Requires restart:** Yes
704
+
705
+ - **`mcp.allowed`** (array):
706
+ - **Description:** A list of MCP servers to allow.
707
+ - **Default:** `undefined`
708
+ - **Requires restart:** Yes
709
+
710
+ - **`mcp.excluded`** (array):
711
+ - **Description:** A list of MCP servers to exclude.
712
+ - **Default:** `undefined`
713
+ - **Requires restart:** Yes
714
+
715
+ #### `useSmartEdit`
716
+
717
+ - **`useSmartEdit`** (boolean):
718
+ - **Description:** Enable the smart-edit tool instead of the replace tool.
719
+ - **Default:** `true`
720
+
721
+ #### `useWriteTodos`
722
+
723
+ - **`useWriteTodos`** (boolean):
724
+ - **Description:** Enable the write_todos tool.
725
+ - **Default:** `true`
726
+
727
+ #### `security`
728
+
729
+ - **`security.disableYoloMode`** (boolean):
730
+ - **Description:** Disable YOLO mode, even if enabled by a flag.
731
+ - **Default:** `false`
732
+ - **Requires restart:** Yes
733
+
734
+ - **`security.enablePermanentToolApproval`** (boolean):
735
+ - **Description:** Enable the "Allow for all future sessions" option in tool
736
+ confirmation dialogs.
737
+ - **Default:** `false`
738
+
739
+ - **`security.blockGitExtensions`** (boolean):
740
+ - **Description:** Blocks installing and loading extensions from Git.
741
+ - **Default:** `false`
742
+ - **Requires restart:** Yes
743
+
744
+ - **`security.folderTrust.enabled`** (boolean):
745
+ - **Description:** Setting to track whether Folder trust is enabled.
746
+ - **Default:** `false`
747
+ - **Requires restart:** Yes
748
+
749
+ - **`security.auth.selectedType`** (string):
750
+ - **Description:** The currently selected authentication type.
751
+ - **Default:** `undefined`
752
+ - **Requires restart:** Yes
753
+
754
+ - **`security.auth.enforcedType`** (string):
755
+ - **Description:** The required auth type. If this does not match the selected
756
+ auth type, the user will be prompted to re-authenticate.
757
+ - **Default:** `undefined`
758
+ - **Requires restart:** Yes
759
+
760
+ - **`security.auth.useExternal`** (boolean):
761
+ - **Description:** Whether to use an external authentication flow.
762
+ - **Default:** `undefined`
763
+ - **Requires restart:** Yes
764
+
765
+ #### `advanced`
766
+
767
+ - **`advanced.autoConfigureMemory`** (boolean):
768
+ - **Description:** Automatically configure Node.js memory limits
769
+ - **Default:** `false`
770
+ - **Requires restart:** Yes
771
+
772
+ - **`advanced.dnsResolutionOrder`** (string):
773
+ - **Description:** The DNS resolution order.
774
+ - **Default:** `undefined`
775
+ - **Requires restart:** Yes
776
+
777
+ - **`advanced.excludedEnvVars`** (array):
778
+ - **Description:** Environment variables to exclude from project context.
779
+ - **Default:**
780
+
781
+ ```json
782
+ ["DEBUG", "DEBUG_MODE"]
783
+ ```
784
+
785
+ - **`advanced.bugCommand`** (object):
786
+ - **Description:** Configuration for the bug report command.
787
+ - **Default:** `undefined`
788
+
789
+ #### `experimental`
790
+
791
+ - **`experimental.enableAgents`** (boolean):
792
+ - **Description:** Enable local and remote subagents. Warning: Experimental
793
+ feature, uses YOLO mode for subagents
794
+ - **Default:** `false`
795
+ - **Requires restart:** Yes
796
+
797
+ - **`experimental.extensionManagement`** (boolean):
798
+ - **Description:** Enable extension management features.
799
+ - **Default:** `true`
800
+ - **Requires restart:** Yes
801
+
802
+ - **`experimental.extensionReloading`** (boolean):
803
+ - **Description:** Enables extension loading/unloading within the CLI session.
804
+ - **Default:** `false`
805
+ - **Requires restart:** Yes
806
+
807
+ - **`experimental.jitContext`** (boolean):
808
+ - **Description:** Enable Just-In-Time (JIT) context loading.
809
+ - **Default:** `false`
810
+ - **Requires restart:** Yes
811
+
812
+ - **`experimental.codebaseInvestigatorSettings.enabled`** (boolean):
813
+ - **Description:** Enable the Codebase Investigator agent.
814
+ - **Default:** `true`
815
+ - **Requires restart:** Yes
816
+
817
+ - **`experimental.codebaseInvestigatorSettings.maxNumTurns`** (number):
818
+ - **Description:** Maximum number of turns for the Codebase Investigator
819
+ agent.
820
+ - **Default:** `10`
821
+ - **Requires restart:** Yes
822
+
823
+ - **`experimental.codebaseInvestigatorSettings.maxTimeMinutes`** (number):
824
+ - **Description:** Maximum time for the Codebase Investigator agent (in
825
+ minutes).
826
+ - **Default:** `3`
827
+ - **Requires restart:** Yes
828
+
829
+ - **`experimental.codebaseInvestigatorSettings.thinkingBudget`** (number):
830
+ - **Description:** The thinking budget for the Codebase Investigator agent.
831
+ - **Default:** `8192`
832
+ - **Requires restart:** Yes
833
+
834
+ - **`experimental.codebaseInvestigatorSettings.model`** (string):
835
+ - **Description:** The model to use for the Codebase Investigator agent.
836
+ - **Default:** `"auto"`
837
+ - **Requires restart:** Yes
838
+
839
+ - **`experimental.introspectionAgentSettings.enabled`** (boolean):
840
+ - **Description:** Enable the Introspection Agent.
841
+ - **Default:** `false`
842
+ - **Requires restart:** Yes
843
+
844
+ #### `hooks`
845
+
846
+ - **`hooks.disabled`** (array):
847
+ - **Description:** List of hook names (commands) that should be disabled.
848
+ Hooks in this list will not execute even if configured.
849
+ - **Default:** `[]`
850
+
851
+ - **`hooks.BeforeTool`** (array):
852
+ - **Description:** Hooks that execute before tool execution. Can intercept,
853
+ validate, or modify tool calls.
854
+ - **Default:** `[]`
855
+
856
+ - **`hooks.AfterTool`** (array):
857
+ - **Description:** Hooks that execute after tool execution. Can process
858
+ results, log outputs, or trigger follow-up actions.
859
+ - **Default:** `[]`
860
+
861
+ - **`hooks.BeforeAgent`** (array):
862
+ - **Description:** Hooks that execute before agent loop starts. Can set up
863
+ context or initialize resources.
864
+ - **Default:** `[]`
865
+
866
+ - **`hooks.AfterAgent`** (array):
867
+ - **Description:** Hooks that execute after agent loop completes. Can perform
868
+ cleanup or summarize results.
869
+ - **Default:** `[]`
870
+
871
+ - **`hooks.Notification`** (array):
872
+ - **Description:** Hooks that execute on notification events (errors,
873
+ warnings, info). Can log or alert on specific conditions.
874
+ - **Default:** `[]`
875
+
876
+ - **`hooks.SessionStart`** (array):
877
+ - **Description:** Hooks that execute when a session starts. Can initialize
878
+ session-specific resources or state.
879
+ - **Default:** `[]`
880
+
881
+ - **`hooks.SessionEnd`** (array):
882
+ - **Description:** Hooks that execute when a session ends. Can perform cleanup
883
+ or persist session data.
884
+ - **Default:** `[]`
885
+
886
+ - **`hooks.PreCompress`** (array):
887
+ - **Description:** Hooks that execute before chat history compression. Can
888
+ back up or analyze conversation before compression.
889
+ - **Default:** `[]`
890
+
891
+ - **`hooks.BeforeModel`** (array):
892
+ - **Description:** Hooks that execute before LLM requests. Can modify prompts,
893
+ inject context, or control model parameters.
894
+ - **Default:** `[]`
895
+
896
+ - **`hooks.AfterModel`** (array):
897
+ - **Description:** Hooks that execute after LLM responses. Can process
898
+ outputs, extract information, or log interactions.
899
+ - **Default:** `[]`
900
+
901
+ - **`hooks.BeforeToolSelection`** (array):
902
+ - **Description:** Hooks that execute before tool selection. Can filter or
903
+ prioritize available tools dynamically.
904
+ - **Default:** `[]`
905
+ <!-- SETTINGS-AUTOGEN:END -->
906
+
907
+ #### `mcpServers`
908
+
909
+ Configures connections to one or more Model-Context Protocol (MCP) servers for
910
+ discovering and using custom tools. Gemini CLI attempts to connect to each
911
+ configured MCP server to discover available tools. If multiple MCP servers
912
+ expose a tool with the same name, the tool names will be prefixed with the
913
+ server alias you defined in the configuration (e.g.,
914
+ `serverAlias__actualToolName`) to avoid conflicts. Note that the system might
915
+ strip certain schema properties from MCP tool definitions for compatibility. At
916
+ least one of `command`, `url`, or `httpUrl` must be provided. If multiple are
917
+ specified, the order of precedence is `httpUrl`, then `url`, then `command`.
918
+
919
+ - **`mcpServers.<SERVER_NAME>`** (object): The server parameters for the named
920
+ server.
921
+ - `command` (string, optional): The command to execute to start the MCP server
922
+ via standard I/O.
923
+ - `args` (array of strings, optional): Arguments to pass to the command.
924
+ - `env` (object, optional): Environment variables to set for the server
925
+ process.
926
+ - `cwd` (string, optional): The working directory in which to start the
927
+ server.
928
+ - `url` (string, optional): The URL of an MCP server that uses Server-Sent
929
+ Events (SSE) for communication.
930
+ - `httpUrl` (string, optional): The URL of an MCP server that uses streamable
931
+ HTTP for communication.
932
+ - `headers` (object, optional): A map of HTTP headers to send with requests to
933
+ `url` or `httpUrl`.
934
+ - `timeout` (number, optional): Timeout in milliseconds for requests to this
935
+ MCP server.
936
+ - `trust` (boolean, optional): Trust this server and bypass all tool call
937
+ confirmations.
938
+ - `description` (string, optional): A brief description of the server, which
939
+ may be used for display purposes.
940
+ - `includeTools` (array of strings, optional): List of tool names to include
941
+ from this MCP server. When specified, only the tools listed here will be
942
+ available from this server (allowlist behavior). If not specified, all tools
943
+ from the server are enabled by default.
944
+ - `excludeTools` (array of strings, optional): List of tool names to exclude
945
+ from this MCP server. Tools listed here will not be available to the model,
946
+ even if they are exposed by the server. **Note:** `excludeTools` takes
947
+ precedence over `includeTools` - if a tool is in both lists, it will be
948
+ excluded.
949
+
950
+ #### `telemetry`
951
+
952
+ Configures logging and metrics collection for Gemini CLI. For more information,
953
+ see [Telemetry](../cli/telemetry.md).
954
+
955
+ - **Properties:**
956
+ - **`enabled`** (boolean): Whether or not telemetry is enabled.
957
+ - **`target`** (string): The destination for collected telemetry. Supported
958
+ values are `local` and `gcp`.
959
+ - **`otlpEndpoint`** (string): The endpoint for the OTLP Exporter.
960
+ - **`otlpProtocol`** (string): The protocol for the OTLP Exporter (`grpc` or
961
+ `http`).
962
+ - **`logPrompts`** (boolean): Whether or not to include the content of user
963
+ prompts in the logs.
964
+ - **`outfile`** (string): The file to write telemetry to when `target` is
965
+ `local`.
966
+ - **`useCollector`** (boolean): Whether to use an external OTLP collector.
967
+
968
+ ### Example `settings.json`
969
+
970
+ Here is an example of a `settings.json` file with the nested structure, new as
971
+ of v0.3.0:
972
+
973
+ ```json
974
+ {
975
+ "general": {
976
+ "vimMode": true,
977
+ "preferredEditor": "code",
978
+ "sessionRetention": {
979
+ "enabled": true,
980
+ "maxAge": "30d",
981
+ "maxCount": 100
982
+ }
983
+ },
984
+ "ui": {
985
+ "theme": "GitHub",
986
+ "hideBanner": true,
987
+ "hideTips": false,
988
+ "customWittyPhrases": [
989
+ "You forget a thousand things every day. Make sure this is one of ’em",
990
+ "Connecting to AGI"
991
+ ]
992
+ },
993
+ "tools": {
994
+ "sandbox": "docker",
995
+ "discoveryCommand": "bin/get_tools",
996
+ "callCommand": "bin/call_tool",
997
+ "exclude": ["write_file"]
998
+ },
999
+ "mcpServers": {
1000
+ "mainServer": {
1001
+ "command": "bin/mcp_server.py"
1002
+ },
1003
+ "anotherServer": {
1004
+ "command": "node",
1005
+ "args": ["mcp_server.js", "--verbose"]
1006
+ }
1007
+ },
1008
+ "telemetry": {
1009
+ "enabled": true,
1010
+ "target": "local",
1011
+ "otlpEndpoint": "http://localhost:4317",
1012
+ "logPrompts": true
1013
+ },
1014
+ "privacy": {
1015
+ "usageStatisticsEnabled": true
1016
+ },
1017
+ "model": {
1018
+ "name": "gemini-1.5-pro-latest",
1019
+ "maxSessionTurns": 10,
1020
+ "summarizeToolOutput": {
1021
+ "run_shell_command": {
1022
+ "tokenBudget": 100
1023
+ }
1024
+ }
1025
+ },
1026
+ "context": {
1027
+ "fileName": ["CONTEXT.md", "GEMINI.md"],
1028
+ "includeDirectories": ["path/to/dir1", "~/path/to/dir2", "../path/to/dir3"],
1029
+ "loadFromIncludeDirectories": true,
1030
+ "fileFiltering": {
1031
+ "respectGitIgnore": false
1032
+ }
1033
+ },
1034
+ "advanced": {
1035
+ "excludedEnvVars": ["DEBUG", "DEBUG_MODE", "NODE_ENV"]
1036
+ }
1037
+ }
1038
+ ```
1039
+
1040
+ ## Shell history
1041
+
1042
+ The CLI keeps a history of shell commands you run. To avoid conflicts between
1043
+ different projects, this history is stored in a project-specific directory
1044
+ within your user's home folder.
1045
+
1046
+ - **Location:** `~/.gemini/tmp/<project_hash>/shell_history`
1047
+ - `<project_hash>` is a unique identifier generated from your project's root
1048
+ path.
1049
+ - The history is stored in a file named `shell_history`.
1050
+
1051
+ ## Environment variables and `.env` files
1052
+
1053
+ Environment variables are a common way to configure applications, especially for
1054
+ sensitive information like API keys or for settings that might change between
1055
+ environments. For authentication setup, see the
1056
+ [Authentication documentation](./authentication.md) which covers all available
1057
+ authentication methods.
1058
+
1059
+ The CLI automatically loads environment variables from an `.env` file. The
1060
+ loading order is:
1061
+
1062
+ 1. `.env` file in the current working directory.
1063
+ 2. If not found, it searches upwards in parent directories until it finds an
1064
+ `.env` file or reaches the project root (identified by a `.git` folder) or
1065
+ the home directory.
1066
+ 3. If still not found, it looks for `~/.env` (in the user's home directory).
1067
+
1068
+ **Environment variable exclusion:** Some environment variables (like `DEBUG` and
1069
+ `DEBUG_MODE`) are automatically excluded from being loaded from project `.env`
1070
+ files to prevent interference with gemini-cli behavior. Variables from
1071
+ `.gemini/.env` files are never excluded. You can customize this behavior using
1072
+ the `advanced.excludedEnvVars` setting in your `settings.json` file.
1073
+
1074
+ - **`GEMINI_API_KEY`**:
1075
+ - Your API key for the Gemini API.
1076
+ - One of several available [authentication methods](./authentication.md).
1077
+ - Set this in your shell profile (e.g., `~/.bashrc`, `~/.zshrc`) or an `.env`
1078
+ file.
1079
+ - **`GEMINI_MODEL`**:
1080
+ - Specifies the default Gemini model to use.
1081
+ - Overrides the hardcoded default
1082
+ - Example: `export GEMINI_MODEL="gemini-2.5-flash"`
1083
+ - **`GOOGLE_API_KEY`**:
1084
+ - Your Google Cloud API key.
1085
+ - Required for using Vertex AI in express mode.
1086
+ - Ensure you have the necessary permissions.
1087
+ - Example: `export GOOGLE_API_KEY="YOUR_GOOGLE_API_KEY"`.
1088
+ - **`GOOGLE_CLOUD_PROJECT`**:
1089
+ - Your Google Cloud Project ID.
1090
+ - Required for using Code Assist or Vertex AI.
1091
+ - If using Vertex AI, ensure you have the necessary permissions in this
1092
+ project.
1093
+ - **Cloud Shell note:** When running in a Cloud Shell environment, this
1094
+ variable defaults to a special project allocated for Cloud Shell users. If
1095
+ you have `GOOGLE_CLOUD_PROJECT` set in your global environment in Cloud
1096
+ Shell, it will be overridden by this default. To use a different project in
1097
+ Cloud Shell, you must define `GOOGLE_CLOUD_PROJECT` in a `.env` file.
1098
+ - Example: `export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"`.
1099
+ - **`GOOGLE_APPLICATION_CREDENTIALS`** (string):
1100
+ - **Description:** The path to your Google Application Credentials JSON file.
1101
+ - **Example:**
1102
+ `export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/credentials.json"`
1103
+ - **`OTLP_GOOGLE_CLOUD_PROJECT`**:
1104
+ - Your Google Cloud Project ID for Telemetry in Google Cloud
1105
+ - Example: `export OTLP_GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"`.
1106
+ - **`GEMINI_TELEMETRY_ENABLED`**:
1107
+ - Set to `true` or `1` to enable telemetry. Any other value is treated as
1108
+ disabling it.
1109
+ - Overrides the `telemetry.enabled` setting.
1110
+ - **`GEMINI_TELEMETRY_TARGET`**:
1111
+ - Sets the telemetry target (`local` or `gcp`).
1112
+ - Overrides the `telemetry.target` setting.
1113
+ - **`GEMINI_TELEMETRY_OTLP_ENDPOINT`**:
1114
+ - Sets the OTLP endpoint for telemetry.
1115
+ - Overrides the `telemetry.otlpEndpoint` setting.
1116
+ - **`GEMINI_TELEMETRY_OTLP_PROTOCOL`**:
1117
+ - Sets the OTLP protocol (`grpc` or `http`).
1118
+ - Overrides the `telemetry.otlpProtocol` setting.
1119
+ - **`GEMINI_TELEMETRY_LOG_PROMPTS`**:
1120
+ - Set to `true` or `1` to enable or disable logging of user prompts. Any other
1121
+ value is treated as disabling it.
1122
+ - Overrides the `telemetry.logPrompts` setting.
1123
+ - **`GEMINI_TELEMETRY_OUTFILE`**:
1124
+ - Sets the file path to write telemetry to when the target is `local`.
1125
+ - Overrides the `telemetry.outfile` setting.
1126
+ - **`GEMINI_TELEMETRY_USE_COLLECTOR`**:
1127
+ - Set to `true` or `1` to enable or disable using an external OTLP collector.
1128
+ Any other value is treated as disabling it.
1129
+ - Overrides the `telemetry.useCollector` setting.
1130
+ - **`GOOGLE_CLOUD_LOCATION`**:
1131
+ - Your Google Cloud Project Location (e.g., us-central1).
1132
+ - Required for using Vertex AI in non-express mode.
1133
+ - Example: `export GOOGLE_CLOUD_LOCATION="YOUR_PROJECT_LOCATION"`.
1134
+ - **`GEMINI_SANDBOX`**:
1135
+ - Alternative to the `sandbox` setting in `settings.json`.
1136
+ - Accepts `true`, `false`, `docker`, `podman`, or a custom command string.
1137
+ - **`GEMINI_SYSTEM_MD`**:
1138
+ - Replaces the built‑in system prompt with content from a Markdown file.
1139
+ - `true`/`1`: Use project default path `./.gemini/system.md`.
1140
+ - Any other string: Treat as a path (relative/absolute supported, `~`
1141
+ expands).
1142
+ - `false`/`0` or unset: Use the built‑in prompt. See
1143
+ [System Prompt Override](../cli/system-prompt.md).
1144
+ - **`GEMINI_WRITE_SYSTEM_MD`**:
1145
+ - Writes the current built‑in system prompt to a file for review.
1146
+ - `true`/`1`: Write to `./.gemini/system.md`. Otherwise treat the value as a
1147
+ path.
1148
+ - Run the CLI once with this set to generate the file.
1149
+ - **`SEATBELT_PROFILE`** (macOS specific):
1150
+ - Switches the Seatbelt (`sandbox-exec`) profile on macOS.
1151
+ - `permissive-open`: (Default) Restricts writes to the project folder (and a
1152
+ few other folders, see
1153
+ `packages/cli/src/utils/sandbox-macos-permissive-open.sb`) but allows other
1154
+ operations.
1155
+ - `strict`: Uses a strict profile that declines operations by default.
1156
+ - `<profile_name>`: Uses a custom profile. To define a custom profile, create
1157
+ a file named `sandbox-macos-<profile_name>.sb` in your project's `.gemini/`
1158
+ directory (e.g., `my-project/.gemini/sandbox-macos-custom.sb`).
1159
+ - **`DEBUG` or `DEBUG_MODE`** (often used by underlying libraries or the CLI
1160
+ itself):
1161
+ - Set to `true` or `1` to enable verbose debug logging, which can be helpful
1162
+ for troubleshooting.
1163
+ - **Note:** These variables are automatically excluded from project `.env`
1164
+ files by default to prevent interference with gemini-cli behavior. Use
1165
+ `.gemini/.env` files if you need to set these for gemini-cli specifically.
1166
+ - **`NO_COLOR`**:
1167
+ - Set to any value to disable all color output in the CLI.
1168
+ - **`CLI_TITLE`**:
1169
+ - Set to a string to customize the title of the CLI.
1170
+ - **`CODE_ASSIST_ENDPOINT`**:
1171
+ - Specifies the endpoint for the code assist server.
1172
+ - This is useful for development and testing.
1173
+
1174
+ ## Command-line arguments
1175
+
1176
+ Arguments passed directly when running the CLI can override other configurations
1177
+ for that specific session.
1178
+
1179
+ - **`--model <model_name>`** (**`-m <model_name>`**):
1180
+ - Specifies the Gemini model to use for this session.
1181
+ - Example: `npm start -- --model gemini-1.5-pro-latest`
1182
+ - **`--prompt <your_prompt>`** (**`-p <your_prompt>`**):
1183
+ - Used to pass a prompt directly to the command. This invokes Gemini CLI in a
1184
+ non-interactive mode.
1185
+ - For scripting examples, use the `--output-format json` flag to get
1186
+ structured output.
1187
+ - **`--prompt-interactive <your_prompt>`** (**`-i <your_prompt>`**):
1188
+ - Starts an interactive session with the provided prompt as the initial input.
1189
+ - The prompt is processed within the interactive session, not before it.
1190
+ - Cannot be used when piping input from stdin.
1191
+ - Example: `gemini -i "explain this code"`
1192
+ - **`--output-format <format>`**:
1193
+ - **Description:** Specifies the format of the CLI output for non-interactive
1194
+ mode.
1195
+ - **Values:**
1196
+ - `text`: (Default) The standard human-readable output.
1197
+ - `json`: A machine-readable JSON output.
1198
+ - `stream-json`: A streaming JSON output that emits real-time events.
1199
+ - **Note:** For structured output and scripting, use the
1200
+ `--output-format json` or `--output-format stream-json` flag.
1201
+ - **`--sandbox`** (**`-s`**):
1202
+ - Enables sandbox mode for this session.
1203
+ - **`--debug`** (**`-d`**):
1204
+ - Enables debug mode for this session, providing more verbose output.
1205
+
1206
+ - **`--help`** (or **`-h`**):
1207
+ - Displays help information about command-line arguments.
1208
+ - **`--yolo`**:
1209
+ - Enables YOLO mode, which automatically approves all tool calls.
1210
+ - **`--approval-mode <mode>`**:
1211
+ - Sets the approval mode for tool calls. Available modes:
1212
+ - `default`: Prompt for approval on each tool call (default behavior)
1213
+ - `auto_edit`: Automatically approve edit tools (replace, write_file) while
1214
+ prompting for others
1215
+ - `yolo`: Automatically approve all tool calls (equivalent to `--yolo`)
1216
+ - Cannot be used together with `--yolo`. Use `--approval-mode=yolo` instead of
1217
+ `--yolo` for the new unified approach.
1218
+ - Example: `gemini --approval-mode auto_edit`
1219
+ - **`--allowed-tools <tool1,tool2,...>`**:
1220
+ - A comma-separated list of tool names that will bypass the confirmation
1221
+ dialog.
1222
+ - Example: `gemini --allowed-tools "ShellTool(git status)"`
1223
+ - **`--extensions <extension_name ...>`** (**`-e <extension_name ...>`**):
1224
+ - Specifies a list of extensions to use for the session. If not provided, all
1225
+ available extensions are used.
1226
+ - Use the special term `gemini -e none` to disable all extensions.
1227
+ - Example: `gemini -e my-extension -e my-other-extension`
1228
+ - **`--list-extensions`** (**`-l`**):
1229
+ - Lists all available extensions and exits.
1230
+ - **`--resume [session_id]`** (**`-r [session_id]`**):
1231
+ - Resume a previous chat session. Use "latest" for the most recent session,
1232
+ provide a session index number, or provide a full session UUID.
1233
+ - If no session_id is provided, defaults to "latest".
1234
+ - Example: `gemini --resume 5` or `gemini --resume latest` or
1235
+ `gemini --resume a1b2c3d4-e5f6-7890-abcd-ef1234567890` or `gemini --resume`
1236
+ - See [Session Management](../cli/session-management.md) for more details.
1237
+ - **`--list-sessions`**:
1238
+ - List all available chat sessions for the current project and exit.
1239
+ - Shows session indices, dates, message counts, and preview of first user
1240
+ message.
1241
+ - Example: `gemini --list-sessions`
1242
+ - **`--delete-session <identifier>`**:
1243
+ - Delete a specific chat session by its index number or full session UUID.
1244
+ - Use `--list-sessions` first to see available sessions, their indices, and
1245
+ UUIDs.
1246
+ - Example: `gemini --delete-session 3` or
1247
+ `gemini --delete-session a1b2c3d4-e5f6-7890-abcd-ef1234567890`
1248
+ - **`--include-directories <dir1,dir2,...>`**:
1249
+ - Includes additional directories in the workspace for multi-directory
1250
+ support.
1251
+ - Can be specified multiple times or as comma-separated values.
1252
+ - 5 directories can be added at maximum.
1253
+ - Example: `--include-directories /path/to/project1,/path/to/project2` or
1254
+ `--include-directories /path/to/project1 --include-directories /path/to/project2`
1255
+ - **`--screen-reader`**:
1256
+ - Enables screen reader mode, which adjusts the TUI for better compatibility
1257
+ with screen readers.
1258
+ - **`--version`**:
1259
+ - Displays the version of the CLI.
1260
+ - **`--experimental-acp`**:
1261
+ - Starts the agent in ACP mode.
1262
+ - **`--allowed-mcp-server-names`**:
1263
+ - Allowed MCP server names.
1264
+ - **`--fake-responses`**:
1265
+ - Path to a file with fake model responses for testing.
1266
+ - **`--record-responses`**:
1267
+ - Path to a file to record model responses for testing.
1268
+
1269
+ ## Context files (hierarchical instructional context)
1270
+
1271
+ While not strictly configuration for the CLI's _behavior_, context files
1272
+ (defaulting to `GEMINI.md` but configurable via the `context.fileName` setting)
1273
+ are crucial for configuring the _instructional context_ (also referred to as
1274
+ "memory") provided to the Gemini model. This powerful feature allows you to give
1275
+ project-specific instructions, coding style guides, or any relevant background
1276
+ information to the AI, making its responses more tailored and accurate to your
1277
+ needs. The CLI includes UI elements, such as an indicator in the footer showing
1278
+ the number of loaded context files, to keep you informed about the active
1279
+ context.
1280
+
1281
+ - **Purpose:** These Markdown files contain instructions, guidelines, or context
1282
+ that you want the Gemini model to be aware of during your interactions. The
1283
+ system is designed to manage this instructional context hierarchically.
1284
+
1285
+ ### Example context file content (e.g., `GEMINI.md`)
1286
+
1287
+ Here's a conceptual example of what a context file at the root of a TypeScript
1288
+ project might contain:
1289
+
1290
+ ```markdown
1291
+ # Project: My Awesome TypeScript Library
1292
+
1293
+ ## General Instructions:
1294
+
1295
+ - When generating new TypeScript code, please follow the existing coding style.
1296
+ - Ensure all new functions and classes have JSDoc comments.
1297
+ - Prefer functional programming paradigms where appropriate.
1298
+ - All code should be compatible with TypeScript 5.0 and Node.js 20+.
1299
+
1300
+ ## Coding Style:
1301
+
1302
+ - Use 2 spaces for indentation.
1303
+ - Interface names should be prefixed with `I` (e.g., `IUserService`).
1304
+ - Private class members should be prefixed with an underscore (`_`).
1305
+ - Always use strict equality (`===` and `!==`).
1306
+
1307
+ ## Specific Component: `src/api/client.ts`
1308
+
1309
+ - This file handles all outbound API requests.
1310
+ - When adding new API call functions, ensure they include robust error handling
1311
+ and logging.
1312
+ - Use the existing `fetchWithRetry` utility for all GET requests.
1313
+
1314
+ ## Regarding Dependencies:
1315
+
1316
+ - Avoid introducing new external dependencies unless absolutely necessary.
1317
+ - If a new dependency is required, please state the reason.
1318
+ ```
1319
+
1320
+ This example demonstrates how you can provide general project context, specific
1321
+ coding conventions, and even notes about particular files or components. The
1322
+ more relevant and precise your context files are, the better the AI can assist
1323
+ you. Project-specific context files are highly encouraged to establish
1324
+ conventions and context.
1325
+
1326
+ - **Hierarchical loading and precedence:** The CLI implements a sophisticated
1327
+ hierarchical memory system by loading context files (e.g., `GEMINI.md`) from
1328
+ several locations. Content from files lower in this list (more specific)
1329
+ typically overrides or supplements content from files higher up (more
1330
+ general). The exact concatenation order and final context can be inspected
1331
+ using the `/memory show` command. The typical loading order is:
1332
+ 1. **Global context file:**
1333
+ - Location: `~/.gemini/<configured-context-filename>` (e.g.,
1334
+ `~/.gemini/GEMINI.md` in your user home directory).
1335
+ - Scope: Provides default instructions for all your projects.
1336
+ 2. **Project root and ancestors context files:**
1337
+ - Location: The CLI searches for the configured context file in the
1338
+ current working directory and then in each parent directory up to either
1339
+ the project root (identified by a `.git` folder) or your home directory.
1340
+ - Scope: Provides context relevant to the entire project or a significant
1341
+ portion of it.
1342
+ 3. **Sub-directory context files (contextual/local):**
1343
+ - Location: The CLI also scans for the configured context file in
1344
+ subdirectories _below_ the current working directory (respecting common
1345
+ ignore patterns like `node_modules`, `.git`, etc.). The breadth of this
1346
+ search is limited to 200 directories by default, but can be configured
1347
+ with the `context.discoveryMaxDirs` setting in your `settings.json`
1348
+ file.
1349
+ - Scope: Allows for highly specific instructions relevant to a particular
1350
+ component, module, or subsection of your project.
1351
+ - **Concatenation and UI indication:** The contents of all found context files
1352
+ are concatenated (with separators indicating their origin and path) and
1353
+ provided as part of the system prompt to the Gemini model. The CLI footer
1354
+ displays the count of loaded context files, giving you a quick visual cue
1355
+ about the active instructional context.
1356
+ - **Importing content:** You can modularize your context files by importing
1357
+ other Markdown files using the `@path/to/file.md` syntax. For more details,
1358
+ see the [Memory Import Processor documentation](../core/memport.md).
1359
+ - **Commands for memory management:**
1360
+ - Use `/memory refresh` to force a re-scan and reload of all context files
1361
+ from all configured locations. This updates the AI's instructional context.
1362
+ - Use `/memory show` to display the combined instructional context currently
1363
+ loaded, allowing you to verify the hierarchy and content being used by the
1364
+ AI.
1365
+ - See the [Commands documentation](../cli/commands.md#memory) for full details
1366
+ on the `/memory` command and its sub-commands (`show` and `refresh`).
1367
+
1368
+ By understanding and utilizing these configuration layers and the hierarchical
1369
+ nature of context files, you can effectively manage the AI's memory and tailor
1370
+ the Gemini CLI's responses to your specific needs and projects.
1371
+
1372
+ ## Sandboxing
1373
+
1374
+ The Gemini CLI can execute potentially unsafe operations (like shell commands
1375
+ and file modifications) within a sandboxed environment to protect your system.
1376
+
1377
+ Sandboxing is disabled by default, but you can enable it in a few ways:
1378
+
1379
+ - Using `--sandbox` or `-s` flag.
1380
+ - Setting `GEMINI_SANDBOX` environment variable.
1381
+ - Sandbox is enabled when using `--yolo` or `--approval-mode=yolo` by default.
1382
+
1383
+ By default, it uses a pre-built `gemini-cli-sandbox` Docker image.
1384
+
1385
+ For project-specific sandboxing needs, you can create a custom Dockerfile at
1386
+ `.gemini/sandbox.Dockerfile` in your project's root directory. This Dockerfile
1387
+ can be based on the base sandbox image:
1388
+
1389
+ ```dockerfile
1390
+ FROM gemini-cli-sandbox
1391
+
1392
+ # Add your custom dependencies or configurations here
1393
+ # For example:
1394
+ # RUN apt-get update && apt-get install -y some-package
1395
+ # COPY ./my-config /app/my-config
1396
+ ```
1397
+
1398
+ When `.gemini/sandbox.Dockerfile` exists, you can use `BUILD_SANDBOX`
1399
+ environment variable when running Gemini CLI to automatically build the custom
1400
+ sandbox image:
1401
+
1402
+ ```bash
1403
+ BUILD_SANDBOX=1 gemini -s
1404
+ ```
1405
+
1406
+ ## Usage statistics
1407
+
1408
+ To help us improve the Gemini CLI, we collect anonymized usage statistics. This
1409
+ data helps us understand how the CLI is used, identify common issues, and
1410
+ prioritize new features.
1411
+
1412
+ **What we collect:**
1413
+
1414
+ - **Tool calls:** We log the names of the tools that are called, whether they
1415
+ succeed or fail, and how long they take to execute. We do not collect the
1416
+ arguments passed to the tools or any data returned by them.
1417
+ - **API requests:** We log the Gemini model used for each request, the duration
1418
+ of the request, and whether it was successful. We do not collect the content
1419
+ of the prompts or responses.
1420
+ - **Session information:** We collect information about the configuration of the
1421
+ CLI, such as the enabled tools and the approval mode.
1422
+
1423
+ **What we DON'T collect:**
1424
+
1425
+ - **Personally identifiable information (PII):** We do not collect any personal
1426
+ information, such as your name, email address, or API keys.
1427
+ - **Prompt and response content:** We do not log the content of your prompts or
1428
+ the responses from the Gemini model.
1429
+ - **File content:** We do not log the content of any files that are read or
1430
+ written by the CLI.
1431
+
1432
+ **How to opt out:**
1433
+
1434
+ You can opt out of usage statistics collection at any time by setting the
1435
+ `usageStatisticsEnabled` property to `false` under the `privacy` category in
1436
+ your `settings.json` file:
1437
+
1438
+ ```json
1439
+ {
1440
+ "privacy": {
1441
+ "usageStatisticsEnabled": false
1442
+ }
1443
+ }
1444
+ ```