@google/gemini-cli-core 0.21.0-nightly.20251219.70696e364 → 0.21.0-nightly.20251221.8feeffb29
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.js +14 -12
- package/dist/src/agents/local-executor.js.map +1 -1
- package/dist/src/agents/local-executor.test.js +3 -0
- package/dist/src/agents/local-executor.test.js.map +1 -1
- package/dist/src/agents/registry.js +6 -0
- package/dist/src/agents/registry.js.map +1 -1
- package/dist/src/agents/registry.test.js +16 -0
- package/dist/src/agents/registry.test.js.map +1 -1
- package/dist/src/config/config.d.ts +6 -0
- package/dist/src/config/config.js +22 -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/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/hookRunner.js +12 -8
- package/dist/src/hooks/hookRunner.js.map +1 -1
- package/dist/src/hooks/hookRunner.test.js +58 -33
- package/dist/src/hooks/hookRunner.test.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/tools/confirmation-policy.test.d.ts +6 -0
- package/dist/src/tools/confirmation-policy.test.js +152 -0
- package/dist/src/tools/confirmation-policy.test.js.map +1 -0
- package/dist/src/tools/edit.js +5 -1
- package/dist/src/tools/edit.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/smart-edit.js +5 -1
- package/dist/src/tools/smart-edit.js.map +1 -1
- package/dist/src/tools/tool-names.d.ts +1 -0
- package/dist/src/tools/tool-names.js +1 -0
- package/dist/src/tools/tool-names.js.map +1 -1
- package/dist/src/tools/web-fetch.js +5 -1
- package/dist/src/tools/web-fetch.js.map +1 -1
- package/dist/src/tools/write-file.js +5 -1
- package/dist/src/tools/write-file.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/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 -1
- package/dist/google-gemini-cli-core-0.21.0-nightly.20251218.739c02bd6.tgz +0 -0
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
# Gemini CLI extensions
|
|
2
|
+
|
|
3
|
+
_This documentation is up-to-date with the v0.4.0 release._
|
|
4
|
+
|
|
5
|
+
Gemini CLI extensions package prompts, MCP servers, and custom commands into a
|
|
6
|
+
familiar and user-friendly format. With extensions, you can expand the
|
|
7
|
+
capabilities of Gemini CLI and share those capabilities with others. They are
|
|
8
|
+
designed to be easily installable and shareable.
|
|
9
|
+
|
|
10
|
+
To see examples of extensions, you can browse a gallery of
|
|
11
|
+
[Gemini CLI extensions](https://geminicli.com/extensions/browse/).
|
|
12
|
+
|
|
13
|
+
See [getting started docs](getting-started-extensions.md) for a guide on
|
|
14
|
+
creating your first extension.
|
|
15
|
+
|
|
16
|
+
See [releasing docs](extension-releasing.md) for an advanced guide on setting up
|
|
17
|
+
GitHub releases.
|
|
18
|
+
|
|
19
|
+
## Extension management
|
|
20
|
+
|
|
21
|
+
We offer a suite of extension management tools using `gemini extensions`
|
|
22
|
+
commands.
|
|
23
|
+
|
|
24
|
+
Note that these commands are not supported from within the CLI, although you can
|
|
25
|
+
list installed extensions using the `/extensions list` subcommand.
|
|
26
|
+
|
|
27
|
+
Note that all of these commands will only be reflected in active CLI sessions on
|
|
28
|
+
restart.
|
|
29
|
+
|
|
30
|
+
### Installing an extension
|
|
31
|
+
|
|
32
|
+
You can install an extension using `gemini extensions install` with either a
|
|
33
|
+
GitHub URL or a local path.
|
|
34
|
+
|
|
35
|
+
Note that we create a copy of the installed extension, so you will need to run
|
|
36
|
+
`gemini extensions update` to pull in changes from both locally-defined
|
|
37
|
+
extensions and those on GitHub.
|
|
38
|
+
|
|
39
|
+
NOTE: If you are installing an extension from GitHub, you'll need to have `git`
|
|
40
|
+
installed on your machine. See
|
|
41
|
+
[git installation instructions](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
|
|
42
|
+
for help.
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
gemini extensions install <source> [--ref <ref>] [--auto-update] [--pre-release] [--consent]
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
- `<source>`: The github URL or local path of the extension to install.
|
|
49
|
+
- `--ref`: The git ref to install from.
|
|
50
|
+
- `--auto-update`: Enable auto-update for this extension.
|
|
51
|
+
- `--pre-release`: Enable pre-release versions for this extension.
|
|
52
|
+
- `--consent`: Acknowledge the security risks of installing an extension and
|
|
53
|
+
skip the confirmation prompt.
|
|
54
|
+
|
|
55
|
+
### Uninstalling an extension
|
|
56
|
+
|
|
57
|
+
To uninstall one or more extensions, run
|
|
58
|
+
`gemini extensions uninstall <name...>`:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
gemini extensions uninstall gemini-cli-security gemini-cli-another-extension
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Disabling an extension
|
|
65
|
+
|
|
66
|
+
Extensions are, by default, enabled across all workspaces. You can disable an
|
|
67
|
+
extension entirely or for specific workspace.
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
gemini extensions disable <name> [--scope <scope>]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
- `<name>`: The name of the extension to disable.
|
|
74
|
+
- `--scope`: The scope to disable the extension in (`user` or `workspace`).
|
|
75
|
+
|
|
76
|
+
### Enabling an extension
|
|
77
|
+
|
|
78
|
+
You can enable extensions using `gemini extensions enable <name>`. You can also
|
|
79
|
+
enable an extension for a specific workspace using
|
|
80
|
+
`gemini extensions enable <name> --scope=workspace` from within that workspace.
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
gemini extensions enable <name> [--scope <scope>]
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
- `<name>`: The name of the extension to enable.
|
|
87
|
+
- `--scope`: The scope to enable the extension in (`user` or `workspace`).
|
|
88
|
+
|
|
89
|
+
### Updating an extension
|
|
90
|
+
|
|
91
|
+
For extensions installed from a local path or a git repository, you can
|
|
92
|
+
explicitly update to the latest version (as reflected in the
|
|
93
|
+
`gemini-extension.json` `version` field) with `gemini extensions update <name>`.
|
|
94
|
+
|
|
95
|
+
You can update all extensions with:
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
gemini extensions update --all
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Create a boilerplate extension
|
|
102
|
+
|
|
103
|
+
We offer several example extensions `context`, `custom-commands`,
|
|
104
|
+
`exclude-tools` and `mcp-server`. You can view these examples
|
|
105
|
+
[here](https://github.com/google-gemini/gemini-cli/tree/main/packages/cli/src/commands/extensions/examples).
|
|
106
|
+
|
|
107
|
+
To copy one of these examples into a development directory using the type of
|
|
108
|
+
your choosing, run:
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
gemini extensions new <path> [template]
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
- `<path>`: The path to create the extension in.
|
|
115
|
+
- `[template]`: The boilerplate template to use.
|
|
116
|
+
|
|
117
|
+
### Link a local extension
|
|
118
|
+
|
|
119
|
+
The `gemini extensions link` command will create a symbolic link from the
|
|
120
|
+
extension installation directory to the development path.
|
|
121
|
+
|
|
122
|
+
This is useful so you don't have to run `gemini extensions update` every time
|
|
123
|
+
you make changes you'd like to test.
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
gemini extensions link <path>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
- `<path>`: The path of the extension to link.
|
|
130
|
+
|
|
131
|
+
## How it works
|
|
132
|
+
|
|
133
|
+
On startup, Gemini CLI looks for extensions in `<home>/.gemini/extensions`
|
|
134
|
+
|
|
135
|
+
Extensions exist as a directory that contains a `gemini-extension.json` file.
|
|
136
|
+
For example:
|
|
137
|
+
|
|
138
|
+
`<home>/.gemini/extensions/my-extension/gemini-extension.json`
|
|
139
|
+
|
|
140
|
+
### `gemini-extension.json`
|
|
141
|
+
|
|
142
|
+
The `gemini-extension.json` file contains the configuration for the extension.
|
|
143
|
+
The file has the following structure:
|
|
144
|
+
|
|
145
|
+
```json
|
|
146
|
+
{
|
|
147
|
+
"name": "my-extension",
|
|
148
|
+
"version": "1.0.0",
|
|
149
|
+
"mcpServers": {
|
|
150
|
+
"my-server": {
|
|
151
|
+
"command": "node my-server.js"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"contextFileName": "GEMINI.md",
|
|
155
|
+
"excludeTools": ["run_shell_command"]
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
- `name`: The name of the extension. This is used to uniquely identify the
|
|
160
|
+
extension and for conflict resolution when extension commands have the same
|
|
161
|
+
name as user or project commands. The name should be lowercase or numbers and
|
|
162
|
+
use dashes instead of underscores or spaces. This is how users will refer to
|
|
163
|
+
your extension in the CLI. Note that we expect this name to match the
|
|
164
|
+
extension directory name.
|
|
165
|
+
- `version`: The version of the extension.
|
|
166
|
+
- `mcpServers`: A map of MCP servers to settings. The key is the name of the
|
|
167
|
+
server, and the value is the server configuration. These servers will be
|
|
168
|
+
loaded on startup just like MCP servers settingsd in a
|
|
169
|
+
[`settings.json` file](../get-started/configuration.md). If both an extension
|
|
170
|
+
and a `settings.json` file settings an MCP server with the same name, the
|
|
171
|
+
server defined in the `settings.json` file takes precedence.
|
|
172
|
+
- Note that all MCP server configuration options are supported except for
|
|
173
|
+
`trust`.
|
|
174
|
+
- `contextFileName`: The name of the file that contains the context for the
|
|
175
|
+
extension. This will be used to load the context from the extension directory.
|
|
176
|
+
If this property is not used but a `GEMINI.md` file is present in your
|
|
177
|
+
extension directory, then that file will be loaded.
|
|
178
|
+
- `excludeTools`: An array of tool names to exclude from the model. You can also
|
|
179
|
+
specify command-specific restrictions for tools that support it, like the
|
|
180
|
+
`run_shell_command` tool. For example,
|
|
181
|
+
`"excludeTools": ["run_shell_command(rm -rf)"]` will block the `rm -rf`
|
|
182
|
+
command. Note that this differs from the MCP server `excludeTools`
|
|
183
|
+
functionality, which can be listed in the MCP server config.
|
|
184
|
+
|
|
185
|
+
When Gemini CLI starts, it loads all the extensions and merges their
|
|
186
|
+
configurations. If there are any conflicts, the workspace configuration takes
|
|
187
|
+
precedence.
|
|
188
|
+
|
|
189
|
+
### Settings
|
|
190
|
+
|
|
191
|
+
_Note: This is an experimental feature. We do not yet recommend extension
|
|
192
|
+
authors introduce settings as part of their core flows._
|
|
193
|
+
|
|
194
|
+
Extensions can define settings that the user will be prompted to provide upon
|
|
195
|
+
installation. This is useful for things like API keys, URLs, or other
|
|
196
|
+
configuration that the extension needs to function.
|
|
197
|
+
|
|
198
|
+
To define settings, add a `settings` array to your `gemini-extension.json` file.
|
|
199
|
+
Each object in the array should have the following properties:
|
|
200
|
+
|
|
201
|
+
- `name`: A user-friendly name for the setting.
|
|
202
|
+
- `description`: A description of the setting and what it's used for.
|
|
203
|
+
- `envVar`: The name of the environment variable that the setting will be stored
|
|
204
|
+
as.
|
|
205
|
+
- `sensitive`: Optional boolean. If true, obfuscates the input the user provides
|
|
206
|
+
and stores the secret in keychain storage. **Example**
|
|
207
|
+
|
|
208
|
+
```json
|
|
209
|
+
{
|
|
210
|
+
"name": "my-api-extension",
|
|
211
|
+
"version": "1.0.0",
|
|
212
|
+
"settings": [
|
|
213
|
+
{
|
|
214
|
+
"name": "API Key",
|
|
215
|
+
"description": "Your API key for the service.",
|
|
216
|
+
"envVar": "MY_API_KEY"
|
|
217
|
+
}
|
|
218
|
+
]
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
When a user installs this extension, they will be prompted to enter their API
|
|
223
|
+
key. The value will be saved to a `.env` file in the extension's directory
|
|
224
|
+
(e.g., `<home>/.gemini/extensions/my-api-extension/.env`).
|
|
225
|
+
|
|
226
|
+
You can view a list of an extension's settings by running:
|
|
227
|
+
|
|
228
|
+
```
|
|
229
|
+
gemini extensions settings list <extension name>
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
and you can update a given setting using:
|
|
233
|
+
|
|
234
|
+
```
|
|
235
|
+
gemini extensions settings set <extension name> <setting name> [--scope <scope>]
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
- `--scope`: The scope to set the setting in (`user` or `workspace`). This is
|
|
239
|
+
optional and will default to `user`.
|
|
240
|
+
|
|
241
|
+
### Custom commands
|
|
242
|
+
|
|
243
|
+
Extensions can provide [custom commands](../cli/custom-commands.md) by placing
|
|
244
|
+
TOML files in a `commands/` subdirectory within the extension directory. These
|
|
245
|
+
commands follow the same format as user and project custom commands and use
|
|
246
|
+
standard naming conventions.
|
|
247
|
+
|
|
248
|
+
**Example**
|
|
249
|
+
|
|
250
|
+
An extension named `gcp` with the following structure:
|
|
251
|
+
|
|
252
|
+
```
|
|
253
|
+
.gemini/extensions/gcp/
|
|
254
|
+
├── gemini-extension.json
|
|
255
|
+
└── commands/
|
|
256
|
+
├── deploy.toml
|
|
257
|
+
└── gcs/
|
|
258
|
+
└── sync.toml
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Would provide these commands:
|
|
262
|
+
|
|
263
|
+
- `/deploy` - Shows as `[gcp] Custom command from deploy.toml` in help
|
|
264
|
+
- `/gcs:sync` - Shows as `[gcp] Custom command from sync.toml` in help
|
|
265
|
+
|
|
266
|
+
### Conflict resolution
|
|
267
|
+
|
|
268
|
+
Extension commands have the lowest precedence. When a conflict occurs with user
|
|
269
|
+
or project commands:
|
|
270
|
+
|
|
271
|
+
1. **No conflict**: Extension command uses its natural name (e.g., `/deploy`)
|
|
272
|
+
2. **With conflict**: Extension command is renamed with the extension prefix
|
|
273
|
+
(e.g., `/gcp.deploy`)
|
|
274
|
+
|
|
275
|
+
For example, if both a user and the `gcp` extension define a `deploy` command:
|
|
276
|
+
|
|
277
|
+
- `/deploy` - Executes the user's deploy command
|
|
278
|
+
- `/gcp.deploy` - Executes the extension's deploy command (marked with `[gcp]`
|
|
279
|
+
tag)
|
|
280
|
+
|
|
281
|
+
## Variables
|
|
282
|
+
|
|
283
|
+
Gemini CLI extensions allow variable substitution in `gemini-extension.json`.
|
|
284
|
+
This can be useful if e.g., you need the current directory to run an MCP server
|
|
285
|
+
using `"cwd": "${extensionPath}${/}run.ts"`.
|
|
286
|
+
|
|
287
|
+
**Supported variables:**
|
|
288
|
+
|
|
289
|
+
| variable | description |
|
|
290
|
+
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
291
|
+
| `${extensionPath}` | The fully-qualified path of the extension in the user's filesystem e.g., '/Users/username/.gemini/extensions/example-extension'. This will not unwrap symlinks. |
|
|
292
|
+
| `${workspacePath}` | The fully-qualified path of the current workspace. |
|
|
293
|
+
| `${/} or ${pathSeparator}` | The path separator (differs per OS). |
|
package/dist/docs/faq.md
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Frequently asked questions (FAQ)
|
|
2
|
+
|
|
3
|
+
This page provides answers to common questions and solutions to frequent
|
|
4
|
+
problems encountered while using Gemini CLI.
|
|
5
|
+
|
|
6
|
+
## General issues
|
|
7
|
+
|
|
8
|
+
### Why am I getting an `API error: 429 - Resource exhausted`?
|
|
9
|
+
|
|
10
|
+
This error indicates that you have exceeded your API request limit. The Gemini
|
|
11
|
+
API has rate limits to prevent abuse and ensure fair usage.
|
|
12
|
+
|
|
13
|
+
To resolve this, you can:
|
|
14
|
+
|
|
15
|
+
- **Check your usage:** Review your API usage in the Google AI Studio or your
|
|
16
|
+
Google Cloud project dashboard.
|
|
17
|
+
- **Optimize your prompts:** If you are making many requests in a short period,
|
|
18
|
+
try to batch your prompts or introduce delays between requests.
|
|
19
|
+
- **Request a quota increase:** If you consistently need a higher limit, you can
|
|
20
|
+
request a quota increase from Google.
|
|
21
|
+
|
|
22
|
+
### Why am I getting an `ERR_REQUIRE_ESM` error when running `npm run start`?
|
|
23
|
+
|
|
24
|
+
This error typically occurs in Node.js projects when there is a mismatch between
|
|
25
|
+
CommonJS and ES Modules.
|
|
26
|
+
|
|
27
|
+
This is often due to a misconfiguration in your `package.json` or
|
|
28
|
+
`tsconfig.json`. Ensure that:
|
|
29
|
+
|
|
30
|
+
1. Your `package.json` has `"type": "module"`.
|
|
31
|
+
2. Your `tsconfig.json` has `"module": "NodeNext"` or a compatible setting in
|
|
32
|
+
the `compilerOptions`.
|
|
33
|
+
|
|
34
|
+
If the problem persists, try deleting your `node_modules` directory and
|
|
35
|
+
`package-lock.json` file, and then run `npm install` again.
|
|
36
|
+
|
|
37
|
+
### Why don't I see cached token counts in my stats output?
|
|
38
|
+
|
|
39
|
+
Cached token information is only displayed when cached tokens are being used.
|
|
40
|
+
This feature is available for API key users (Gemini API key or Google Cloud
|
|
41
|
+
Vertex AI) but not for OAuth users (such as Google Personal/Enterprise accounts
|
|
42
|
+
like Google Gmail or Google Workspace, respectively). This is because the Gemini
|
|
43
|
+
Code Assist API does not support cached content creation. You can still view
|
|
44
|
+
your total token usage using the `/stats` command in Gemini CLI.
|
|
45
|
+
|
|
46
|
+
## Installation and updates
|
|
47
|
+
|
|
48
|
+
### How do I update Gemini CLI to the latest version?
|
|
49
|
+
|
|
50
|
+
If you installed it globally via `npm`, update it using the command
|
|
51
|
+
`npm install -g @google/gemini-cli@latest`. If you compiled it from source, pull
|
|
52
|
+
the latest changes from the repository, and then rebuild using the command
|
|
53
|
+
`npm run build`.
|
|
54
|
+
|
|
55
|
+
## Platform-specific issues
|
|
56
|
+
|
|
57
|
+
### Why does the CLI crash on Windows when I run a command like `chmod +x`?
|
|
58
|
+
|
|
59
|
+
Commands like `chmod` are specific to Unix-like operating systems (Linux,
|
|
60
|
+
macOS). They are not available on Windows by default.
|
|
61
|
+
|
|
62
|
+
To resolve this, you can:
|
|
63
|
+
|
|
64
|
+
- **Use Windows-equivalent commands:** Instead of `chmod`, you can use `icacls`
|
|
65
|
+
to modify file permissions on Windows.
|
|
66
|
+
- **Use a compatibility layer:** Tools like Git Bash or Windows Subsystem for
|
|
67
|
+
Linux (WSL) provide a Unix-like environment on Windows where these commands
|
|
68
|
+
will work.
|
|
69
|
+
|
|
70
|
+
## Configuration
|
|
71
|
+
|
|
72
|
+
### How do I configure my `GOOGLE_CLOUD_PROJECT`?
|
|
73
|
+
|
|
74
|
+
You can configure your Google Cloud Project ID using an environment variable.
|
|
75
|
+
|
|
76
|
+
Set the `GOOGLE_CLOUD_PROJECT` environment variable in your shell:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
export GOOGLE_CLOUD_PROJECT="your-project-id"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
To make this setting permanent, add this line to your shell's startup file
|
|
83
|
+
(e.g., `~/.bashrc`, `~/.zshrc`).
|
|
84
|
+
|
|
85
|
+
### What is the best way to store my API keys securely?
|
|
86
|
+
|
|
87
|
+
Exposing API keys in scripts or checking them into source control is a security
|
|
88
|
+
risk.
|
|
89
|
+
|
|
90
|
+
To store your API keys securely, you can:
|
|
91
|
+
|
|
92
|
+
- **Use a `.env` file:** Create a `.env` file in your project's `.gemini`
|
|
93
|
+
directory (`.gemini/.env`) and store your keys there. Gemini CLI will
|
|
94
|
+
automatically load these variables.
|
|
95
|
+
- **Use your system's keyring:** For the most secure storage, use your operating
|
|
96
|
+
system's secret management tool (like macOS Keychain, Windows Credential
|
|
97
|
+
Manager, or a secret manager on Linux). You can then have your scripts or
|
|
98
|
+
environment load the key from the secure storage at runtime.
|
|
99
|
+
|
|
100
|
+
### Where are the Gemini CLI configuration and settings files stored?
|
|
101
|
+
|
|
102
|
+
The Gemini CLI configuration is stored in two `settings.json` files:
|
|
103
|
+
|
|
104
|
+
1. In your home directory: `~/.gemini/settings.json`.
|
|
105
|
+
2. In your project's root directory: `./.gemini/settings.json`.
|
|
106
|
+
|
|
107
|
+
Refer to [Gemini CLI Configuration](./get-started/configuration.md) for more
|
|
108
|
+
details.
|
|
109
|
+
|
|
110
|
+
## Google AI Pro/Ultra and subscription FAQs
|
|
111
|
+
|
|
112
|
+
### Where can I learn more about my Google AI Pro or Google AI Ultra subscription?
|
|
113
|
+
|
|
114
|
+
To learn more about your Google AI Pro or Google AI Ultra subscription, visit
|
|
115
|
+
**Manage subscription** in your [subscription settings](https://one.google.com).
|
|
116
|
+
|
|
117
|
+
### How do I know if I have higher limits for Google AI Pro or Ultra?
|
|
118
|
+
|
|
119
|
+
If you're subscribed to Google AI Pro or Ultra, you automatically have higher
|
|
120
|
+
limits to Gemini Code Assist and Gemini CLI. These are shared across Gemini CLI
|
|
121
|
+
and agent mode in the IDE. You can confirm you have higher limits by checking if
|
|
122
|
+
you are still subscribed to Google AI Pro or Ultra in your
|
|
123
|
+
[subscription settings](https://one.google.com).
|
|
124
|
+
|
|
125
|
+
### What is the privacy policy for using Gemini Code Assist or Gemini CLI if I've subscribed to Google AI Pro or Ultra?
|
|
126
|
+
|
|
127
|
+
To learn more about your privacy policy and terms of service governed by your
|
|
128
|
+
subscription, visit
|
|
129
|
+
[Gemini Code Assist: Terms of Service and Privacy Policies](https://developers.google.com/gemini-code-assist/resources/privacy-notices).
|
|
130
|
+
|
|
131
|
+
### I've upgraded to Google AI Pro or Ultra but it still says I am hitting quota limits. Is this a bug?
|
|
132
|
+
|
|
133
|
+
The higher limits in your Google AI Pro or Ultra subscription are for Gemini 2.5
|
|
134
|
+
across both Gemini 2.5 Pro and Flash. They are shared quota across Gemini CLI
|
|
135
|
+
and agent mode in Gemini Code Assist IDE extensions. You can learn more about
|
|
136
|
+
quota limits for Gemini CLI, Gemini Code Assist and agent mode in Gemini Code
|
|
137
|
+
Assist at
|
|
138
|
+
[Quotas and limits](https://developers.google.com/gemini-code-assist/resources/quotas).
|
|
139
|
+
|
|
140
|
+
### If I upgrade to higher limits for Gemini CLI and Gemini Code Assist by purchasing a Google AI Pro or Ultra subscription, will Gemini start using my data to improve its machine learning models?
|
|
141
|
+
|
|
142
|
+
Google does not use your data to improve Google's machine learning models if you
|
|
143
|
+
purchase a paid plan. Note: If you decide to remain on the free version of
|
|
144
|
+
Gemini Code Assist, Gemini Code Assist for individuals, you can also opt out of
|
|
145
|
+
using your data to improve Google's machine learning models. See the
|
|
146
|
+
[Gemini Code Assist for individuals privacy notice](https://developers.google.com/gemini-code-assist/resources/privacy-notice-gemini-code-assist-individuals)
|
|
147
|
+
for more information.
|
|
148
|
+
|
|
149
|
+
## Not seeing your question?
|
|
150
|
+
|
|
151
|
+
Search the
|
|
152
|
+
[Gemini CLI Q&A discussions on GitHub](https://github.com/google-gemini/gemini-cli/discussions/categories/q-a)
|
|
153
|
+
or
|
|
154
|
+
[start a new discussion on GitHub](https://github.com/google-gemini/gemini-cli/discussions/new?category=q-a)
|