@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.
- package/dist/docs/CONTRIBUTING.md +546 -0
- package/dist/docs/architecture.md +80 -0
- package/dist/docs/assets/connected_devtools.png +0 -0
- package/dist/docs/assets/gemini-screenshot.png +0 -0
- package/dist/docs/assets/release_patch.png +0 -0
- package/dist/docs/assets/theme-ansi-light.png +0 -0
- package/dist/docs/assets/theme-ansi.png +0 -0
- package/dist/docs/assets/theme-atom-one.png +0 -0
- package/dist/docs/assets/theme-ayu-light.png +0 -0
- package/dist/docs/assets/theme-ayu.png +0 -0
- package/dist/docs/assets/theme-custom.png +0 -0
- package/dist/docs/assets/theme-default-light.png +0 -0
- package/dist/docs/assets/theme-default.png +0 -0
- package/dist/docs/assets/theme-dracula.png +0 -0
- package/dist/docs/assets/theme-github-light.png +0 -0
- package/dist/docs/assets/theme-github.png +0 -0
- package/dist/docs/assets/theme-google-light.png +0 -0
- package/dist/docs/assets/theme-xcode-light.png +0 -0
- package/dist/docs/changelogs/index.md +592 -0
- package/dist/docs/changelogs/latest.md +225 -0
- package/dist/docs/changelogs/preview.md +129 -0
- package/dist/docs/changelogs/releases.md +896 -0
- package/dist/docs/cli/authentication.md +3 -0
- package/dist/docs/cli/checkpointing.md +94 -0
- package/dist/docs/cli/commands.md +354 -0
- package/dist/docs/cli/configuration.md +780 -0
- package/dist/docs/cli/custom-commands.md +315 -0
- package/dist/docs/cli/enterprise.md +565 -0
- package/dist/docs/cli/gemini-ignore.md +71 -0
- package/dist/docs/cli/gemini-md.md +108 -0
- package/dist/docs/cli/generation-settings.md +210 -0
- package/dist/docs/cli/headless.md +388 -0
- package/dist/docs/cli/index.md +63 -0
- package/dist/docs/cli/keyboard-shortcuts.md +143 -0
- package/dist/docs/cli/model-routing.md +37 -0
- package/dist/docs/cli/model.md +62 -0
- package/dist/docs/cli/sandbox.md +171 -0
- package/dist/docs/cli/session-management.md +158 -0
- package/dist/docs/cli/settings.md +112 -0
- package/dist/docs/cli/system-prompt.md +93 -0
- package/dist/docs/cli/telemetry.md +791 -0
- package/dist/docs/cli/themes.md +237 -0
- package/dist/docs/cli/token-caching.md +20 -0
- package/dist/docs/cli/trusted-folders.md +95 -0
- package/dist/docs/cli/tutorials.md +83 -0
- package/dist/docs/cli/uninstall.md +47 -0
- package/dist/docs/core/index.md +101 -0
- package/dist/docs/core/memport.md +244 -0
- package/dist/docs/core/policy-engine.md +267 -0
- package/dist/docs/core/tools-api.md +131 -0
- package/dist/docs/examples/proxy-script.md +83 -0
- package/dist/docs/extensions/extension-releasing.md +183 -0
- package/dist/docs/extensions/getting-started-extensions.md +245 -0
- package/dist/docs/extensions/index.md +293 -0
- package/dist/docs/faq.md +154 -0
- package/dist/docs/get-started/authentication.md +321 -0
- package/dist/docs/get-started/configuration-v1.md +888 -0
- package/dist/docs/get-started/configuration.md +1444 -0
- package/dist/docs/get-started/deployment.md +143 -0
- package/dist/docs/get-started/examples.md +219 -0
- package/dist/docs/get-started/gemini-3.md +116 -0
- package/dist/docs/get-started/index.md +71 -0
- package/dist/docs/get-started/installation.md +141 -0
- package/dist/docs/hooks/best-practices.md +806 -0
- package/dist/docs/hooks/index.md +665 -0
- package/dist/docs/hooks/reference.md +168 -0
- package/dist/docs/hooks/writing-hooks.md +1026 -0
- package/dist/docs/ide-integration/ide-companion-spec.md +267 -0
- package/dist/docs/ide-integration/index.md +202 -0
- package/dist/docs/index.md +147 -0
- package/dist/docs/integration-tests.md +211 -0
- package/dist/docs/issue-and-pr-automation.md +134 -0
- package/dist/docs/local-development.md +128 -0
- package/dist/docs/mermaid/context.mmd +103 -0
- package/dist/docs/mermaid/render-path.mmd +64 -0
- package/dist/docs/npm.md +62 -0
- package/dist/docs/quota-and-pricing.md +158 -0
- package/dist/docs/release-confidence.md +164 -0
- package/dist/docs/releases.md +540 -0
- package/dist/docs/sidebar.json +297 -0
- package/dist/docs/tools/file-system.md +217 -0
- package/dist/docs/tools/index.md +95 -0
- package/dist/docs/tools/mcp-server.md +1044 -0
- package/dist/docs/tools/memory.md +54 -0
- package/dist/docs/tools/shell.md +260 -0
- package/dist/docs/tools/todos.md +57 -0
- package/dist/docs/tools/web-fetch.md +59 -0
- package/dist/docs/tools/web-search.md +42 -0
- package/dist/docs/tos-privacy.md +96 -0
- package/dist/docs/troubleshooting.md +158 -0
- package/dist/google-gemini-cli-core-0.21.0-nightly.20251219.70696e364.tgz +0 -0
- package/dist/src/agents/delegate-to-agent-tool.test.js +1 -0
- package/dist/src/agents/delegate-to-agent-tool.test.js.map +1 -1
- package/dist/src/agents/introspection-agent.d.ts +23 -0
- package/dist/src/agents/introspection-agent.js +72 -0
- package/dist/src/agents/introspection-agent.js.map +1 -0
- package/dist/src/agents/introspection-agent.test.d.ts +6 -0
- package/dist/src/agents/introspection-agent.test.js +47 -0
- package/dist/src/agents/introspection-agent.test.js.map +1 -0
- package/dist/src/agents/local-executor.d.ts +0 -6
- package/dist/src/agents/local-executor.js +73 -47
- package/dist/src/agents/local-executor.js.map +1 -1
- package/dist/src/agents/local-executor.test.d.ts +1 -7
- package/dist/src/agents/local-executor.test.js +27 -9
- package/dist/src/agents/local-executor.test.js.map +1 -1
- package/dist/src/agents/registry.d.ts +1 -0
- package/dist/src/agents/registry.js +51 -7
- package/dist/src/agents/registry.js.map +1 -1
- package/dist/src/agents/registry.test.js +112 -1
- package/dist/src/agents/registry.test.js.map +1 -1
- package/dist/src/agents/toml-loader.d.ts +65 -0
- package/dist/src/agents/toml-loader.js +176 -0
- package/dist/src/agents/toml-loader.js.map +1 -0
- package/dist/src/agents/toml-loader.test.d.ts +6 -0
- package/dist/src/agents/toml-loader.test.js +190 -0
- package/dist/src/agents/toml-loader.test.js.map +1 -0
- package/dist/src/availability/modelAvailabilityService.d.ts +2 -1
- package/dist/src/config/config.d.ts +9 -0
- package/dist/src/config/config.js +29 -0
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +59 -1
- package/dist/src/config/config.test.js.map +1 -1
- package/dist/src/config/storage.d.ts +2 -0
- package/dist/src/config/storage.js +6 -0
- package/dist/src/config/storage.js.map +1 -1
- package/dist/src/config/storage.test.js +8 -0
- package/dist/src/config/storage.test.js.map +1 -1
- package/dist/src/core/client.js +8 -4
- package/dist/src/core/client.js.map +1 -1
- package/dist/src/core/client.test.js +20 -0
- package/dist/src/core/client.test.js.map +1 -1
- package/dist/src/core/clientHookTriggers.js +2 -2
- package/dist/src/core/clientHookTriggers.js.map +1 -1
- package/dist/src/core/coreToolHookTriggers.js +3 -3
- package/dist/src/core/coreToolHookTriggers.js.map +1 -1
- package/dist/src/core/geminiChatHookTriggers.js +3 -3
- package/dist/src/core/geminiChatHookTriggers.js.map +1 -1
- package/dist/src/core/sessionHookTriggers.js +3 -3
- package/dist/src/core/sessionHookTriggers.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +2 -2
- package/dist/src/generated/git-commit.js +2 -2
- package/dist/src/hooks/hookEventHandler.js +10 -4
- package/dist/src/hooks/hookEventHandler.js.map +1 -1
- package/dist/src/hooks/hookEventHandler.test.js +40 -0
- package/dist/src/hooks/hookEventHandler.test.js.map +1 -1
- package/dist/src/hooks/hookPlanner.js +3 -1
- package/dist/src/hooks/hookPlanner.js.map +1 -1
- package/dist/src/hooks/hookPlanner.test.js +61 -0
- package/dist/src/hooks/hookPlanner.test.js.map +1 -1
- package/dist/src/hooks/hookRegistry.d.ts +1 -1
- package/dist/src/hooks/hookRegistry.js +2 -2
- package/dist/src/hooks/hookRegistry.js.map +1 -1
- package/dist/src/hooks/hookRegistry.test.js +73 -0
- package/dist/src/hooks/hookRegistry.test.js.map +1 -1
- package/dist/src/hooks/hookRunner.js +14 -10
- package/dist/src/hooks/hookRunner.js.map +1 -1
- package/dist/src/hooks/hookRunner.test.js +81 -33
- package/dist/src/hooks/hookRunner.test.js.map +1 -1
- package/dist/src/hooks/types.d.ts +2 -0
- package/dist/src/hooks/types.js.map +1 -1
- package/dist/src/mcp/oauth-provider.js +6 -2
- package/dist/src/mcp/oauth-provider.js.map +1 -1
- package/dist/src/mcp/oauth-provider.test.js +4 -1
- package/dist/src/mcp/oauth-provider.test.js.map +1 -1
- package/dist/src/mcp/oauth-utils.d.ts +8 -1
- package/dist/src/mcp/oauth-utils.js +30 -1
- package/dist/src/mcp/oauth-utils.js.map +1 -1
- package/dist/src/mcp/oauth-utils.test.js +42 -0
- package/dist/src/mcp/oauth-utils.test.js.map +1 -1
- package/dist/src/services/contextManager.d.ts +5 -11
- package/dist/src/services/contextManager.js +20 -17
- package/dist/src/services/contextManager.js.map +1 -1
- package/dist/src/services/contextManager.test.js +40 -41
- package/dist/src/services/contextManager.test.js.map +1 -1
- package/dist/src/services/shellExecutionService.js +18 -2
- package/dist/src/services/shellExecutionService.js.map +1 -1
- package/dist/src/tools/get-internal-docs.d.ts +27 -0
- package/dist/src/tools/get-internal-docs.js +129 -0
- package/dist/src/tools/get-internal-docs.js.map +1 -0
- package/dist/src/tools/get-internal-docs.test.d.ts +6 -0
- package/dist/src/tools/get-internal-docs.test.js +56 -0
- package/dist/src/tools/get-internal-docs.test.js.map +1 -0
- package/dist/src/tools/tool-names.d.ts +14 -0
- package/dist/src/tools/tool-names.js +55 -0
- package/dist/src/tools/tool-names.js.map +1 -1
- package/dist/src/tools/tool-names.test.d.ts +6 -0
- package/dist/src/tools/tool-names.test.js +43 -0
- package/dist/src/tools/tool-names.test.js.map +1 -0
- package/dist/src/tools/tool-registry.d.ts +0 -1
- package/dist/src/tools/tool-registry.js +1 -1
- package/dist/src/tools/tool-registry.js.map +1 -1
- package/dist/src/tools/tool-registry.test.js +2 -1
- package/dist/src/tools/tool-registry.test.js.map +1 -1
- package/dist/src/utils/environmentContext.js +3 -0
- package/dist/src/utils/environmentContext.js.map +1 -1
- package/dist/src/utils/environmentContext.test.js +2 -0
- package/dist/src/utils/environmentContext.test.js.map +1 -1
- package/dist/src/utils/events.d.ts +3 -2
- package/dist/src/utils/events.js.map +1 -1
- package/dist/src/utils/googleQuotaErrors.js +20 -0
- package/dist/src/utils/googleQuotaErrors.js.map +1 -1
- package/dist/src/utils/googleQuotaErrors.test.js +53 -2
- package/dist/src/utils/googleQuotaErrors.test.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.js +1 -1
- package/dist/src/utils/memoryDiscovery.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.test.js +3 -1
- package/dist/src/utils/memoryDiscovery.test.js.map +1 -1
- package/dist/src/utils/shell-utils.js +25 -4
- package/dist/src/utils/shell-utils.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -6
- package/dist/google-gemini-cli-core-0.21.0-nightly.20251216.bb0c0d8ee.tgz +0 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
# Themes
|
|
2
|
+
|
|
3
|
+
Gemini CLI supports a variety of themes to customize its color scheme and
|
|
4
|
+
appearance. You can change the theme to suit your preferences via the `/theme`
|
|
5
|
+
command or `"theme":` configuration setting.
|
|
6
|
+
|
|
7
|
+
## Available themes
|
|
8
|
+
|
|
9
|
+
Gemini CLI comes with a selection of pre-defined themes, which you can list
|
|
10
|
+
using the `/theme` command within Gemini CLI:
|
|
11
|
+
|
|
12
|
+
- **Dark themes:**
|
|
13
|
+
- `ANSI`
|
|
14
|
+
- `Atom One`
|
|
15
|
+
- `Ayu`
|
|
16
|
+
- `Default`
|
|
17
|
+
- `Dracula`
|
|
18
|
+
- `GitHub`
|
|
19
|
+
- **Light themes:**
|
|
20
|
+
- `ANSI Light`
|
|
21
|
+
- `Ayu Light`
|
|
22
|
+
- `Default Light`
|
|
23
|
+
- `GitHub Light`
|
|
24
|
+
- `Google Code`
|
|
25
|
+
- `Xcode`
|
|
26
|
+
|
|
27
|
+
### Changing themes
|
|
28
|
+
|
|
29
|
+
1. Enter `/theme` into Gemini CLI.
|
|
30
|
+
2. A dialog or selection prompt appears, listing the available themes.
|
|
31
|
+
3. Using the arrow keys, select a theme. Some interfaces might offer a live
|
|
32
|
+
preview or highlight as you select.
|
|
33
|
+
4. Confirm your selection to apply the theme.
|
|
34
|
+
|
|
35
|
+
**Note:** If a theme is defined in your `settings.json` file (either by name or
|
|
36
|
+
by a file path), you must remove the `"theme"` setting from the file before you
|
|
37
|
+
can change the theme using the `/theme` command.
|
|
38
|
+
|
|
39
|
+
### Theme persistence
|
|
40
|
+
|
|
41
|
+
Selected themes are saved in Gemini CLI's
|
|
42
|
+
[configuration](../get-started/configuration.md) so your preference is
|
|
43
|
+
remembered across sessions.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Custom color themes
|
|
48
|
+
|
|
49
|
+
Gemini CLI allows you to create your own custom color themes by specifying them
|
|
50
|
+
in your `settings.json` file. This gives you full control over the color palette
|
|
51
|
+
used in the CLI.
|
|
52
|
+
|
|
53
|
+
### How to define a custom theme
|
|
54
|
+
|
|
55
|
+
Add a `customThemes` block to your user, project, or system `settings.json`
|
|
56
|
+
file. Each custom theme is defined as an object with a unique name and a set of
|
|
57
|
+
color keys. For example:
|
|
58
|
+
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"ui": {
|
|
62
|
+
"customThemes": {
|
|
63
|
+
"MyCustomTheme": {
|
|
64
|
+
"name": "MyCustomTheme",
|
|
65
|
+
"type": "custom",
|
|
66
|
+
"Background": "#181818",
|
|
67
|
+
...
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Color keys:**
|
|
75
|
+
|
|
76
|
+
- `Background`
|
|
77
|
+
- `Foreground`
|
|
78
|
+
- `LightBlue`
|
|
79
|
+
- `AccentBlue`
|
|
80
|
+
- `AccentPurple`
|
|
81
|
+
- `AccentCyan`
|
|
82
|
+
- `AccentGreen`
|
|
83
|
+
- `AccentYellow`
|
|
84
|
+
- `AccentRed`
|
|
85
|
+
- `Comment`
|
|
86
|
+
- `Gray`
|
|
87
|
+
- `DiffAdded` (optional, for added lines in diffs)
|
|
88
|
+
- `DiffRemoved` (optional, for removed lines in diffs)
|
|
89
|
+
- `DiffModified` (optional, for modified lines in diffs)
|
|
90
|
+
|
|
91
|
+
You can also override individual UI text roles by adding a nested `text` object.
|
|
92
|
+
This object supports the keys `primary`, `secondary`, `link`, `accent`, and
|
|
93
|
+
`response`. When `text.response` is provided it takes precedence over
|
|
94
|
+
`text.primary` for rendering model responses in chat.
|
|
95
|
+
|
|
96
|
+
**Required properties:**
|
|
97
|
+
|
|
98
|
+
- `name` (must match the key in the `customThemes` object and be a string)
|
|
99
|
+
- `type` (must be the string `"custom"`)
|
|
100
|
+
- `Background`
|
|
101
|
+
- `Foreground`
|
|
102
|
+
- `LightBlue`
|
|
103
|
+
- `AccentBlue`
|
|
104
|
+
- `AccentPurple`
|
|
105
|
+
- `AccentCyan`
|
|
106
|
+
- `AccentGreen`
|
|
107
|
+
- `AccentYellow`
|
|
108
|
+
- `AccentRed`
|
|
109
|
+
- `Comment`
|
|
110
|
+
- `Gray`
|
|
111
|
+
|
|
112
|
+
You can use either hex codes (e.g., `#FF0000`) **or** standard CSS color names
|
|
113
|
+
(e.g., `coral`, `teal`, `blue`) for any color value. See
|
|
114
|
+
[CSS color names](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#color_keywords)
|
|
115
|
+
for a full list of supported names.
|
|
116
|
+
|
|
117
|
+
You can define multiple custom themes by adding more entries to the
|
|
118
|
+
`customThemes` object.
|
|
119
|
+
|
|
120
|
+
### Loading themes from a file
|
|
121
|
+
|
|
122
|
+
In addition to defining custom themes in `settings.json`, you can also load a
|
|
123
|
+
theme directly from a JSON file by specifying the file path in your
|
|
124
|
+
`settings.json`. This is useful for sharing themes or keeping them separate from
|
|
125
|
+
your main configuration.
|
|
126
|
+
|
|
127
|
+
To load a theme from a file, set the `theme` property in your `settings.json` to
|
|
128
|
+
the path of your theme file:
|
|
129
|
+
|
|
130
|
+
```json
|
|
131
|
+
{
|
|
132
|
+
"ui": {
|
|
133
|
+
"theme": "/path/to/your/theme.json"
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
The theme file must be a valid JSON file that follows the same structure as a
|
|
139
|
+
custom theme defined in `settings.json`.
|
|
140
|
+
|
|
141
|
+
**Example `my-theme.json`:**
|
|
142
|
+
|
|
143
|
+
```json
|
|
144
|
+
{
|
|
145
|
+
"name": "My File Theme",
|
|
146
|
+
"type": "custom",
|
|
147
|
+
"Background": "#282A36",
|
|
148
|
+
"Foreground": "#F8F8F2",
|
|
149
|
+
"LightBlue": "#82AAFF",
|
|
150
|
+
"AccentBlue": "#61AFEF",
|
|
151
|
+
"AccentPurple": "#BD93F9",
|
|
152
|
+
"AccentCyan": "#8BE9FD",
|
|
153
|
+
"AccentGreen": "#50FA7B",
|
|
154
|
+
"AccentYellow": "#F1FA8C",
|
|
155
|
+
"AccentRed": "#FF5555",
|
|
156
|
+
"Comment": "#6272A4",
|
|
157
|
+
"Gray": "#ABB2BF",
|
|
158
|
+
"DiffAdded": "#A6E3A1",
|
|
159
|
+
"DiffRemoved": "#F38BA8",
|
|
160
|
+
"DiffModified": "#89B4FA",
|
|
161
|
+
"GradientColors": ["#4796E4", "#847ACE", "#C3677F"]
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**Security note:** For your safety, Gemini CLI will only load theme files that
|
|
166
|
+
are located within your home directory. If you attempt to load a theme from
|
|
167
|
+
outside your home directory, a warning will be displayed and the theme will not
|
|
168
|
+
be loaded. This is to prevent loading potentially malicious theme files from
|
|
169
|
+
untrusted sources.
|
|
170
|
+
|
|
171
|
+
### Example custom theme
|
|
172
|
+
|
|
173
|
+
<img src="../assets/theme-custom.png" alt="Custom theme example" width="600" />
|
|
174
|
+
|
|
175
|
+
### Using your custom theme
|
|
176
|
+
|
|
177
|
+
- Select your custom theme using the `/theme` command in Gemini CLI. Your custom
|
|
178
|
+
theme will appear in the theme selection dialog.
|
|
179
|
+
- Or, set it as the default by adding `"theme": "MyCustomTheme"` to the `ui`
|
|
180
|
+
object in your `settings.json`.
|
|
181
|
+
- Custom themes can be set at the user, project, or system level, and follow the
|
|
182
|
+
same [configuration precedence](../get-started/configuration.md) as other
|
|
183
|
+
settings.
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Dark themes
|
|
188
|
+
|
|
189
|
+
### ANSI
|
|
190
|
+
|
|
191
|
+
<img src="/assets/theme-ansi.png" alt="ANSI theme" width="600" />
|
|
192
|
+
|
|
193
|
+
### Atom OneDark
|
|
194
|
+
|
|
195
|
+
<img src="/assets/theme-atom-one.png" alt="Atom One theme" width="600">
|
|
196
|
+
|
|
197
|
+
### Ayu
|
|
198
|
+
|
|
199
|
+
<img src="/assets/theme-ayu.png" alt="Ayu theme" width="600">
|
|
200
|
+
|
|
201
|
+
### Default
|
|
202
|
+
|
|
203
|
+
<img src="/assets/theme-default.png" alt="Default theme" width="600">
|
|
204
|
+
|
|
205
|
+
### Dracula
|
|
206
|
+
|
|
207
|
+
<img src="/assets/theme-dracula.png" alt="Dracula theme" width="600">
|
|
208
|
+
|
|
209
|
+
### GitHub
|
|
210
|
+
|
|
211
|
+
<img src="/assets/theme-github.png" alt="GitHub theme" width="600">
|
|
212
|
+
|
|
213
|
+
## Light themes
|
|
214
|
+
|
|
215
|
+
### ANSI Light
|
|
216
|
+
|
|
217
|
+
<img src="/assets/theme-ansi-light.png" alt="ANSI Light theme" width="600">
|
|
218
|
+
|
|
219
|
+
### Ayu Light
|
|
220
|
+
|
|
221
|
+
<img src="/assets/theme-ayu-light.png" alt="Ayu Light theme" width="600">
|
|
222
|
+
|
|
223
|
+
### Default Light
|
|
224
|
+
|
|
225
|
+
<img src="/assets/theme-default-light.png" alt="Default Light theme" width="600">
|
|
226
|
+
|
|
227
|
+
### GitHub Light
|
|
228
|
+
|
|
229
|
+
<img src="/assets/theme-github-light.png" alt="GitHub Light theme" width="600">
|
|
230
|
+
|
|
231
|
+
### Google Code
|
|
232
|
+
|
|
233
|
+
<img src="/assets/theme-google-light.png" alt="Google Code theme" width="600">
|
|
234
|
+
|
|
235
|
+
### Xcode
|
|
236
|
+
|
|
237
|
+
<img src="/assets/theme-xcode-light.png" alt="Xcode Light theme" width="600">
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Token caching and cost optimization
|
|
2
|
+
|
|
3
|
+
Gemini CLI automatically optimizes API costs through token caching when using
|
|
4
|
+
API key authentication (Gemini API key or Vertex AI). This feature reuses
|
|
5
|
+
previous system instructions and context to reduce the number of tokens
|
|
6
|
+
processed in subsequent requests.
|
|
7
|
+
|
|
8
|
+
**Token caching is available for:**
|
|
9
|
+
|
|
10
|
+
- API key users (Gemini API key)
|
|
11
|
+
- Vertex AI users (with project and location setup)
|
|
12
|
+
|
|
13
|
+
**Token caching is not available for:**
|
|
14
|
+
|
|
15
|
+
- OAuth users (Google Personal/Enterprise accounts) - the Code Assist API does
|
|
16
|
+
not support cached content creation at this time
|
|
17
|
+
|
|
18
|
+
You can view your token usage and cached token savings using the `/stats`
|
|
19
|
+
command. When cached tokens are available, they will be displayed in the stats
|
|
20
|
+
output.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Trusted Folders
|
|
2
|
+
|
|
3
|
+
The Trusted Folders feature is a security setting that gives you control over
|
|
4
|
+
which projects can use the full capabilities of the Gemini CLI. It prevents
|
|
5
|
+
potentially malicious code from running by asking you to approve a folder before
|
|
6
|
+
the CLI loads any project-specific configurations from it.
|
|
7
|
+
|
|
8
|
+
## Enabling the feature
|
|
9
|
+
|
|
10
|
+
The Trusted Folders feature is **disabled by default**. To use it, you must
|
|
11
|
+
first enable it in your settings.
|
|
12
|
+
|
|
13
|
+
Add the following to your user `settings.json` file:
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"security": {
|
|
18
|
+
"folderTrust": {
|
|
19
|
+
"enabled": true
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## How it works: The trust dialog
|
|
26
|
+
|
|
27
|
+
Once the feature is enabled, the first time you run the Gemini CLI from a
|
|
28
|
+
folder, a dialog will automatically appear, prompting you to make a choice:
|
|
29
|
+
|
|
30
|
+
- **Trust folder**: Grants full trust to the current folder (e.g.,
|
|
31
|
+
`my-project`).
|
|
32
|
+
- **Trust parent folder**: Grants trust to the parent directory (e.g.,
|
|
33
|
+
`safe-projects`), which automatically trusts all of its subdirectories as
|
|
34
|
+
well. This is useful if you keep all your safe projects in one place.
|
|
35
|
+
- **Don't trust**: Marks the folder as untrusted. The CLI will operate in a
|
|
36
|
+
restricted "safe mode."
|
|
37
|
+
|
|
38
|
+
Your choice is saved in a central file (`~/.gemini/trustedFolders.json`), so you
|
|
39
|
+
will only be asked once per folder.
|
|
40
|
+
|
|
41
|
+
## Why trust matters: The impact of an untrusted workspace
|
|
42
|
+
|
|
43
|
+
When a folder is **untrusted**, the Gemini CLI runs in a restricted "safe mode"
|
|
44
|
+
to protect you. In this mode, the following features are disabled:
|
|
45
|
+
|
|
46
|
+
1. **Workspace settings are ignored**: The CLI will **not** load the
|
|
47
|
+
`.gemini/settings.json` file from the project. This prevents the loading of
|
|
48
|
+
custom tools and other potentially dangerous configurations.
|
|
49
|
+
|
|
50
|
+
2. **Environment variables are ignored**: The CLI will **not** load any `.env`
|
|
51
|
+
files from the project.
|
|
52
|
+
|
|
53
|
+
3. **Extension management is restricted**: You **cannot install, update, or
|
|
54
|
+
uninstall** extensions.
|
|
55
|
+
|
|
56
|
+
4. **Tool auto-acceptance is disabled**: You will always be prompted before any
|
|
57
|
+
tool is run, even if you have auto-acceptance enabled globally.
|
|
58
|
+
|
|
59
|
+
5. **Automatic memory loading is disabled**: The CLI will not automatically
|
|
60
|
+
load files into context from directories specified in local settings.
|
|
61
|
+
|
|
62
|
+
6. **MCP servers do not connect**: The CLI will not attempt to connect to any
|
|
63
|
+
[Model Context Protocol (MCP)](../tools/mcp-server.md) servers.
|
|
64
|
+
|
|
65
|
+
7. **Custom commands are not loaded**: The CLI will not load any custom
|
|
66
|
+
commands from .toml files, including both project-specific and global user
|
|
67
|
+
commands.
|
|
68
|
+
|
|
69
|
+
Granting trust to a folder unlocks the full functionality of the Gemini CLI for
|
|
70
|
+
that workspace.
|
|
71
|
+
|
|
72
|
+
## Managing your trust settings
|
|
73
|
+
|
|
74
|
+
If you need to change a decision or see all your settings, you have a couple of
|
|
75
|
+
options:
|
|
76
|
+
|
|
77
|
+
- **Change the current folder's trust**: Run the `/permissions` command from
|
|
78
|
+
within the CLI. This will bring up the same interactive dialog, allowing you
|
|
79
|
+
to change the trust level for the current folder.
|
|
80
|
+
|
|
81
|
+
- **View all trust rules**: To see a complete list of all your trusted and
|
|
82
|
+
untrusted folder rules, you can inspect the contents of the
|
|
83
|
+
`~/.gemini/trustedFolders.json` file in your home directory.
|
|
84
|
+
|
|
85
|
+
## The trust check process (advanced)
|
|
86
|
+
|
|
87
|
+
For advanced users, it's helpful to know the exact order of operations for how
|
|
88
|
+
trust is determined:
|
|
89
|
+
|
|
90
|
+
1. **IDE trust signal**: If you are using the
|
|
91
|
+
[IDE Integration](../ide-integration/index.md), the CLI first asks the IDE
|
|
92
|
+
if the workspace is trusted. The IDE's response takes highest priority.
|
|
93
|
+
|
|
94
|
+
2. **Local trust file**: If the IDE is not connected, the CLI checks the
|
|
95
|
+
central `~/.gemini/trustedFolders.json` file.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Tutorials
|
|
2
|
+
|
|
3
|
+
This page contains tutorials for interacting with Gemini CLI.
|
|
4
|
+
|
|
5
|
+
## Setting up a Model Context Protocol (MCP) server
|
|
6
|
+
|
|
7
|
+
> [!CAUTION] Before using a third-party MCP server, ensure you trust its source
|
|
8
|
+
> and understand the tools it provides. Your use of third-party servers is at
|
|
9
|
+
> your own risk.
|
|
10
|
+
|
|
11
|
+
This tutorial demonstrates how to set up an MCP server, using the
|
|
12
|
+
[GitHub MCP server](https://github.com/github/github-mcp-server) as an example.
|
|
13
|
+
The GitHub MCP server provides tools for interacting with GitHub repositories,
|
|
14
|
+
such as creating issues and commenting on pull requests.
|
|
15
|
+
|
|
16
|
+
### Prerequisites
|
|
17
|
+
|
|
18
|
+
Before you begin, ensure you have the following installed and configured:
|
|
19
|
+
|
|
20
|
+
- **Docker:** Install and run [Docker].
|
|
21
|
+
- **GitHub Personal Access Token (PAT):** Create a new [classic] or
|
|
22
|
+
[fine-grained] PAT with the necessary scopes.
|
|
23
|
+
|
|
24
|
+
[Docker]: https://www.docker.com/
|
|
25
|
+
[classic]: https://github.com/settings/tokens/new
|
|
26
|
+
[fine-grained]: https://github.com/settings/personal-access-tokens/new
|
|
27
|
+
|
|
28
|
+
### Guide
|
|
29
|
+
|
|
30
|
+
#### Configure the MCP server in `settings.json`
|
|
31
|
+
|
|
32
|
+
In your project's root directory, create or open the
|
|
33
|
+
[`.gemini/settings.json` file](../get-started/configuration.md). Within the
|
|
34
|
+
file, add the `mcpServers` configuration block, which provides instructions for
|
|
35
|
+
how to launch the GitHub MCP server.
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"mcpServers": {
|
|
40
|
+
"github": {
|
|
41
|
+
"command": "docker",
|
|
42
|
+
"args": [
|
|
43
|
+
"run",
|
|
44
|
+
"-i",
|
|
45
|
+
"--rm",
|
|
46
|
+
"-e",
|
|
47
|
+
"GITHUB_PERSONAL_ACCESS_TOKEN",
|
|
48
|
+
"ghcr.io/github/github-mcp-server"
|
|
49
|
+
],
|
|
50
|
+
"env": {
|
|
51
|
+
"GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_PERSONAL_ACCESS_TOKEN}"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
#### Set your GitHub token
|
|
59
|
+
|
|
60
|
+
> [!CAUTION] Using a broadly scoped personal access token that has access to
|
|
61
|
+
> personal and private repositories can lead to information from the private
|
|
62
|
+
> repository being leaked into the public repository. We recommend using a
|
|
63
|
+
> fine-grained access token that doesn't share access to both public and private
|
|
64
|
+
> repositories.
|
|
65
|
+
|
|
66
|
+
Use an environment variable to store your GitHub PAT:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
GITHUB_PERSONAL_ACCESS_TOKEN="pat_YourActualGitHubTokenHere"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Gemini CLI uses this value in the `mcpServers` configuration that you defined in
|
|
73
|
+
the `settings.json` file.
|
|
74
|
+
|
|
75
|
+
#### Launch Gemini CLI and verify the connection
|
|
76
|
+
|
|
77
|
+
When you launch Gemini CLI, it automatically reads your configuration and
|
|
78
|
+
launches the GitHub MCP server in the background. You can then use natural
|
|
79
|
+
language prompts to ask Gemini CLI to perform GitHub actions. For example:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
"get all open issues assigned to me in the 'foo/bar' repo and prioritize them"
|
|
83
|
+
```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Uninstalling the CLI
|
|
2
|
+
|
|
3
|
+
Your uninstall method depends on how you ran the CLI. Follow the instructions
|
|
4
|
+
for either npx or a global npm installation.
|
|
5
|
+
|
|
6
|
+
## Method 1: Using npx
|
|
7
|
+
|
|
8
|
+
npx runs packages from a temporary cache without a permanent installation. To
|
|
9
|
+
"uninstall" the CLI, you must clear this cache, which will remove gemini-cli and
|
|
10
|
+
any other packages previously executed with npx.
|
|
11
|
+
|
|
12
|
+
The npx cache is a directory named `_npx` inside your main npm cache folder. You
|
|
13
|
+
can find your npm cache path by running `npm config get cache`.
|
|
14
|
+
|
|
15
|
+
**For macOS / Linux**
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# The path is typically ~/.npm/_npx
|
|
19
|
+
rm -rf "$(npm config get cache)/_npx"
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**For Windows**
|
|
23
|
+
|
|
24
|
+
_Command Prompt_
|
|
25
|
+
|
|
26
|
+
```cmd
|
|
27
|
+
:: The path is typically %LocalAppData%\npm-cache\_npx
|
|
28
|
+
rmdir /s /q "%LocalAppData%\npm-cache\_npx"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
_PowerShell_
|
|
32
|
+
|
|
33
|
+
```powershell
|
|
34
|
+
# The path is typically $env:LocalAppData\npm-cache\_npx
|
|
35
|
+
Remove-Item -Path (Join-Path $env:LocalAppData "npm-cache\_npx") -Recurse -Force
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Method 2: Using npm (global install)
|
|
39
|
+
|
|
40
|
+
If you installed the CLI globally (e.g., `npm install -g @google/gemini-cli`),
|
|
41
|
+
use the `npm uninstall` command with the `-g` flag to remove it.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm uninstall -g @google/gemini-cli
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
This command completely removes the package from your system.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Gemini CLI core
|
|
2
|
+
|
|
3
|
+
Gemini CLI's core package (`packages/core`) is the backend portion of Gemini
|
|
4
|
+
CLI, handling communication with the Gemini API, managing tools, and processing
|
|
5
|
+
requests sent from `packages/cli`. For a general overview of Gemini CLI, see the
|
|
6
|
+
[main documentation page](../index.md).
|
|
7
|
+
|
|
8
|
+
## Navigating this section
|
|
9
|
+
|
|
10
|
+
- **[Core tools API](./tools-api.md):** Information on how tools are defined,
|
|
11
|
+
registered, and used by the core.
|
|
12
|
+
- **[Memory Import Processor](./memport.md):** Documentation for the modular
|
|
13
|
+
GEMINI.md import feature using @file.md syntax.
|
|
14
|
+
- **[Policy Engine](./policy-engine.md):** Use the Policy Engine for
|
|
15
|
+
fine-grained control over tool execution.
|
|
16
|
+
|
|
17
|
+
## Role of the core
|
|
18
|
+
|
|
19
|
+
While the `packages/cli` portion of Gemini CLI provides the user interface,
|
|
20
|
+
`packages/core` is responsible for:
|
|
21
|
+
|
|
22
|
+
- **Gemini API interaction:** Securely communicating with the Google Gemini API,
|
|
23
|
+
sending user prompts, and receiving model responses.
|
|
24
|
+
- **Prompt engineering:** Constructing effective prompts for the Gemini model,
|
|
25
|
+
potentially incorporating conversation history, tool definitions, and
|
|
26
|
+
instructional context from `GEMINI.md` files.
|
|
27
|
+
- **Tool management & orchestration:**
|
|
28
|
+
- Registering available tools (e.g., file system tools, shell command
|
|
29
|
+
execution).
|
|
30
|
+
- Interpreting tool use requests from the Gemini model.
|
|
31
|
+
- Executing the requested tools with the provided arguments.
|
|
32
|
+
- Returning tool execution results to the Gemini model for further processing.
|
|
33
|
+
- **Session and state management:** Keeping track of the conversation state,
|
|
34
|
+
including history and any relevant context required for coherent interactions.
|
|
35
|
+
- **Configuration:** Managing core-specific configurations, such as API key
|
|
36
|
+
access, model selection, and tool settings.
|
|
37
|
+
|
|
38
|
+
## Security considerations
|
|
39
|
+
|
|
40
|
+
The core plays a vital role in security:
|
|
41
|
+
|
|
42
|
+
- **API key management:** It handles the `GEMINI_API_KEY` and ensures it's used
|
|
43
|
+
securely when communicating with the Gemini API.
|
|
44
|
+
- **Tool execution:** When tools interact with the local system (e.g.,
|
|
45
|
+
`run_shell_command`), the core (and its underlying tool implementations) must
|
|
46
|
+
do so with appropriate caution, often involving sandboxing mechanisms to
|
|
47
|
+
prevent unintended modifications.
|
|
48
|
+
|
|
49
|
+
## Chat history compression
|
|
50
|
+
|
|
51
|
+
To ensure that long conversations don't exceed the token limits of the Gemini
|
|
52
|
+
model, the core includes a chat history compression feature.
|
|
53
|
+
|
|
54
|
+
When a conversation approaches the token limit for the configured model, the
|
|
55
|
+
core automatically compresses the conversation history before sending it to the
|
|
56
|
+
model. This compression is designed to be lossless in terms of the information
|
|
57
|
+
conveyed, but it reduces the overall number of tokens used.
|
|
58
|
+
|
|
59
|
+
You can find the token limits for each model in the
|
|
60
|
+
[Google AI documentation](https://ai.google.dev/gemini-api/docs/models).
|
|
61
|
+
|
|
62
|
+
## Model fallback
|
|
63
|
+
|
|
64
|
+
Gemini CLI includes a model fallback mechanism to ensure that you can continue
|
|
65
|
+
to use the CLI even if the default "pro" model is rate-limited.
|
|
66
|
+
|
|
67
|
+
If you are using the default "pro" model and the CLI detects that you are being
|
|
68
|
+
rate-limited, it automatically switches to the "flash" model for the current
|
|
69
|
+
session. This allows you to continue working without interruption.
|
|
70
|
+
|
|
71
|
+
## File discovery service
|
|
72
|
+
|
|
73
|
+
The file discovery service is responsible for finding files in the project that
|
|
74
|
+
are relevant to the current context. It is used by the `@` command and other
|
|
75
|
+
tools that need to access files.
|
|
76
|
+
|
|
77
|
+
## Memory discovery service
|
|
78
|
+
|
|
79
|
+
The memory discovery service is responsible for finding and loading the
|
|
80
|
+
`GEMINI.md` files that provide context to the model. It searches for these files
|
|
81
|
+
in a hierarchical manner, starting from the current working directory and moving
|
|
82
|
+
up to the project root and the user's home directory. It also searches in
|
|
83
|
+
subdirectories.
|
|
84
|
+
|
|
85
|
+
This allows you to have global, project-level, and component-level context
|
|
86
|
+
files, which are all combined to provide the model with the most relevant
|
|
87
|
+
information.
|
|
88
|
+
|
|
89
|
+
You can use the [`/memory` command](../cli/commands.md) to `show`, `add`, and
|
|
90
|
+
`refresh` the content of loaded `GEMINI.md` files.
|
|
91
|
+
|
|
92
|
+
## Citations
|
|
93
|
+
|
|
94
|
+
When Gemini finds it is reciting text from a source it appends the citation to
|
|
95
|
+
the output. It is enabled by default but can be disabled with the
|
|
96
|
+
ui.showCitations setting.
|
|
97
|
+
|
|
98
|
+
- When proposing an edit the citations display before giving the user the option
|
|
99
|
+
to accept.
|
|
100
|
+
- Citations are always shown at the end of the model’s turn.
|
|
101
|
+
- We deduplicate citations and display them in alphabetical order.
|