@wxp212/gemini-cli 0.28.3-2

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