@google/gemini-cli-core 0.39.0-preview.2 → 0.40.0-preview.0
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/changelogs/index.md +21 -0
- package/dist/docs/changelogs/latest.md +253 -407
- package/dist/docs/changelogs/preview.md +236 -247
- package/dist/docs/cli/auto-memory.md +143 -0
- package/dist/docs/cli/enterprise.md +1 -1
- package/dist/docs/cli/plan-mode.md +3 -1
- package/dist/docs/cli/settings.md +29 -25
- package/dist/docs/cli/system-prompt.md +6 -6
- package/dist/docs/cli/telemetry.md +18 -11
- package/dist/docs/cli/tutorials/memory-management.md +2 -0
- package/dist/docs/get-started/{authentication.md → authentication.mdx} +139 -93
- package/dist/docs/get-started/index.md +3 -2
- package/dist/docs/get-started/installation.mdx +201 -0
- package/dist/docs/index.md +2 -2
- package/dist/docs/reference/configuration.md +88 -12
- package/dist/docs/reference/policy-engine.md +18 -12
- package/dist/docs/reference/tools.md +22 -0
- package/dist/docs/sidebar.json +13 -1
- package/dist/docs/tools/mcp-resources.md +44 -0
- package/dist/docs/tools/mcp-server.md +2 -1
- package/dist/docs/tools/tracker.md +61 -0
- package/dist/src/agents/agent-tool.js +1 -0
- package/dist/src/agents/agent-tool.js.map +1 -1
- package/dist/src/agents/agentLoader.d.ts +4 -4
- package/dist/src/agents/generalist-agent.js +3 -2
- package/dist/src/agents/generalist-agent.js.map +1 -1
- package/dist/src/agents/local-executor.js +4 -1
- package/dist/src/agents/local-executor.js.map +1 -1
- package/dist/src/agents/registry.js +0 -8
- package/dist/src/agents/registry.js.map +1 -1
- package/dist/src/agents/skill-extraction-agent.d.ts +3 -2
- package/dist/src/agents/skill-extraction-agent.js +72 -67
- package/dist/src/agents/skill-extraction-agent.js.map +1 -1
- package/dist/src/agents/skill-extraction-agent.test.js +54 -0
- package/dist/src/agents/skill-extraction-agent.test.js.map +1 -0
- package/dist/src/config/config.d.ts +21 -6
- package/dist/src/config/config.js +103 -19
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +262 -6
- package/dist/src/config/config.test.js.map +1 -1
- package/dist/src/config/constants.d.ts +1 -0
- package/dist/src/config/constants.js +2 -0
- package/dist/src/config/constants.js.map +1 -1
- package/dist/src/config/memory.js +1 -1
- package/dist/src/config/memory.js.map +1 -1
- package/dist/src/config/path-validation.test.js +15 -6
- package/dist/src/config/path-validation.test.js.map +1 -1
- package/dist/src/config/projectRegistry.js +113 -32
- package/dist/src/config/projectRegistry.js.map +1 -1
- package/dist/src/config/projectRegistry.test.js +51 -0
- package/dist/src/config/projectRegistry.test.js.map +1 -1
- package/dist/src/config/storage.d.ts +3 -1
- package/dist/src/config/storage.js +6 -0
- package/dist/src/config/storage.js.map +1 -1
- package/dist/src/config/storage.test.js +12 -0
- package/dist/src/config/storage.test.js.map +1 -1
- package/dist/src/core/contentGenerator.d.ts +8 -1
- package/dist/src/core/contentGenerator.js +46 -4
- package/dist/src/core/contentGenerator.js.map +1 -1
- package/dist/src/core/contentGenerator.test.js +174 -8
- package/dist/src/core/contentGenerator.test.js.map +1 -1
- package/dist/src/core/geminiChat.test.js +1 -0
- package/dist/src/core/geminiChat.test.js.map +1 -1
- package/dist/src/core/geminiChat_network_retry.test.js +42 -0
- package/dist/src/core/geminiChat_network_retry.test.js.map +1 -1
- package/dist/src/core/localLiteRtLmClient.js +2 -0
- package/dist/src/core/localLiteRtLmClient.js.map +1 -1
- package/dist/src/core/localLiteRtLmClient.test.js +7 -0
- package/dist/src/core/localLiteRtLmClient.test.js.map +1 -1
- package/dist/src/core/loggingContentGenerator.js +3 -0
- package/dist/src/core/loggingContentGenerator.js.map +1 -1
- package/dist/src/core/loggingContentGenerator.test.js +1 -0
- package/dist/src/core/loggingContentGenerator.test.js.map +1 -1
- package/dist/src/core/prompts.d.ts +1 -1
- package/dist/src/core/prompts.js +2 -2
- package/dist/src/core/prompts.js.map +1 -1
- package/dist/src/core/prompts.test.js +2 -2
- package/dist/src/core/prompts.test.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/ide/ide-client.js +3 -4
- package/dist/src/ide/ide-client.js.map +1 -1
- package/dist/src/policy/policies/read-only.toml +4 -1
- package/dist/src/policy/policy-engine.js +4 -0
- package/dist/src/policy/policy-engine.js.map +1 -1
- package/dist/src/policy/policy-engine.test.js +25 -0
- package/dist/src/policy/policy-engine.test.js.map +1 -1
- package/dist/src/policy/toml-loader.test.js +5 -0
- package/dist/src/policy/toml-loader.test.js.map +1 -1
- package/dist/src/prompts/promptProvider.d.ts +1 -1
- package/dist/src/prompts/promptProvider.js +15 -7
- package/dist/src/prompts/promptProvider.js.map +1 -1
- package/dist/src/prompts/promptProvider.test.js +31 -1
- package/dist/src/prompts/promptProvider.test.js.map +1 -1
- package/dist/src/prompts/snippets-memory-v2.test.js +94 -0
- package/dist/src/prompts/snippets-memory-v2.test.js.map +1 -0
- package/dist/src/prompts/snippets.d.ts +19 -1
- package/dist/src/prompts/snippets.js +24 -3
- package/dist/src/prompts/snippets.js.map +1 -1
- package/dist/src/prompts/snippets.legacy.d.ts +6 -1
- package/dist/src/prompts/snippets.legacy.js +10 -3
- package/dist/src/prompts/snippets.legacy.js.map +1 -1
- package/dist/src/sandbox/linux/LinuxSandboxManager.js +16 -2
- package/dist/src/sandbox/linux/LinuxSandboxManager.js.map +1 -1
- package/dist/src/sandbox/linux/bwrapArgsBuilder.js +64 -36
- package/dist/src/sandbox/linux/bwrapArgsBuilder.js.map +1 -1
- package/dist/src/sandbox/linux/bwrapArgsBuilder.test.js +3 -3
- package/dist/src/sandbox/linux/bwrapArgsBuilder.test.js.map +1 -1
- package/dist/src/sandbox/macos/MacOsSandboxManager.js +13 -1
- package/dist/src/sandbox/macos/MacOsSandboxManager.js.map +1 -1
- package/dist/src/sandbox/macos/seatbeltArgsBuilder.js +61 -42
- package/dist/src/sandbox/macos/seatbeltArgsBuilder.js.map +1 -1
- package/dist/src/sandbox/windows/WindowsSandboxManager.js +12 -1
- package/dist/src/sandbox/windows/WindowsSandboxManager.js.map +1 -1
- package/dist/src/scheduler/policy.js +1 -2
- package/dist/src/scheduler/policy.js.map +1 -1
- package/dist/src/scheduler/policy.test.js +35 -2
- package/dist/src/scheduler/policy.test.js.map +1 -1
- package/dist/src/scheduler/scheduler.js +1 -0
- package/dist/src/scheduler/scheduler.js.map +1 -1
- package/dist/src/scheduler/scheduler.test.js +2 -0
- package/dist/src/scheduler/scheduler.test.js.map +1 -1
- package/dist/src/scheduler/scheduler_hooks.test.js +1 -0
- package/dist/src/scheduler/scheduler_hooks.test.js.map +1 -1
- package/dist/src/scheduler/scheduler_parallel.test.js +1 -0
- package/dist/src/scheduler/scheduler_parallel.test.js.map +1 -1
- package/dist/src/scheduler/tool-executor.js +1 -0
- package/dist/src/scheduler/tool-executor.js.map +1 -1
- package/dist/src/services/chatRecordingService.d.ts +1 -0
- package/dist/src/services/chatRecordingService.js +48 -19
- package/dist/src/services/chatRecordingService.js.map +1 -1
- package/dist/src/services/memoryService.d.ts +15 -1
- package/dist/src/services/memoryService.js +276 -57
- package/dist/src/services/memoryService.js.map +1 -1
- package/dist/src/services/memoryService.test.js +296 -2
- package/dist/src/services/memoryService.test.js.map +1 -1
- package/dist/src/services/sandboxManager.integration.test.js +204 -0
- package/dist/src/services/sandboxManager.integration.test.js.map +1 -1
- package/dist/src/services/sandboxManager.js +16 -0
- package/dist/src/services/sandboxManager.js.map +1 -1
- package/dist/src/services/sessionSummaryUtils.d.ts +1 -1
- package/dist/src/services/sessionSummaryUtils.js +111 -38
- package/dist/src/services/sessionSummaryUtils.js.map +1 -1
- package/dist/src/services/sessionSummaryUtils.test.js +204 -51
- package/dist/src/services/sessionSummaryUtils.test.js.map +1 -1
- package/dist/src/services/shellExecutionService.js +7 -1
- package/dist/src/services/shellExecutionService.js.map +1 -1
- package/dist/src/telemetry/config.js +3 -0
- package/dist/src/telemetry/config.js.map +1 -1
- package/dist/src/telemetry/conseca-logger.test.js +1 -0
- package/dist/src/telemetry/conseca-logger.test.js.map +1 -1
- package/dist/src/telemetry/loggers.test.js +72 -4
- package/dist/src/telemetry/loggers.test.js.map +1 -1
- package/dist/src/telemetry/memory-monitor.d.ts +1 -0
- package/dist/src/telemetry/memory-monitor.js +8 -1
- package/dist/src/telemetry/memory-monitor.js.map +1 -1
- package/dist/src/telemetry/memory-monitor.test.js +6 -1
- package/dist/src/telemetry/memory-monitor.test.js.map +1 -1
- package/dist/src/telemetry/trace.d.ts +1 -0
- package/dist/src/telemetry/trace.js +33 -13
- package/dist/src/telemetry/trace.js.map +1 -1
- package/dist/src/telemetry/trace.test.js +50 -10
- package/dist/src/telemetry/trace.test.js.map +1 -1
- package/dist/src/telemetry/types.js +11 -4
- package/dist/src/telemetry/types.js.map +1 -1
- package/dist/src/tools/definitions/base-declarations.d.ts +2 -0
- package/dist/src/tools/definitions/base-declarations.js +3 -0
- package/dist/src/tools/definitions/base-declarations.js.map +1 -1
- package/dist/src/tools/definitions/coreTools.d.ts +3 -1
- package/dist/src/tools/definitions/coreTools.js +13 -1
- package/dist/src/tools/definitions/coreTools.js.map +1 -1
- package/dist/src/tools/definitions/model-family-sets/default-legacy.js +29 -1
- package/dist/src/tools/definitions/model-family-sets/default-legacy.js.map +1 -1
- package/dist/src/tools/definitions/model-family-sets/gemini-3.js +29 -1
- package/dist/src/tools/definitions/model-family-sets/gemini-3.js.map +1 -1
- package/dist/src/tools/definitions/types.d.ts +2 -0
- package/dist/src/tools/get-internal-docs.js +5 -2
- package/dist/src/tools/get-internal-docs.js.map +1 -1
- package/dist/src/tools/list-mcp-resources.d.ts +24 -0
- package/dist/src/tools/list-mcp-resources.js +74 -0
- package/dist/src/tools/list-mcp-resources.js.map +1 -0
- package/dist/src/tools/list-mcp-resources.test.d.ts +6 -0
- package/dist/src/tools/list-mcp-resources.test.js +79 -0
- package/dist/src/tools/list-mcp-resources.test.js.map +1 -0
- package/dist/src/tools/mcp-client-manager.d.ts +3 -1
- package/dist/src/tools/mcp-client-manager.js +24 -1
- package/dist/src/tools/mcp-client-manager.js.map +1 -1
- package/dist/src/tools/mcp-client-manager.test.js +43 -0
- package/dist/src/tools/mcp-client-manager.test.js.map +1 -1
- package/dist/src/tools/memoryTool.d.ts +2 -1
- package/dist/src/tools/memoryTool.js +42 -13
- package/dist/src/tools/memoryTool.js.map +1 -1
- package/dist/src/tools/memoryTool.test.js +23 -3
- package/dist/src/tools/memoryTool.test.js.map +1 -1
- package/dist/src/tools/read-mcp-resource.d.ts +25 -0
- package/dist/src/tools/read-mcp-resource.js +120 -0
- package/dist/src/tools/read-mcp-resource.js.map +1 -0
- package/dist/src/tools/read-mcp-resource.test.d.ts +6 -0
- package/dist/src/tools/read-mcp-resource.test.js +110 -0
- package/dist/src/tools/read-mcp-resource.test.js.map +1 -0
- package/dist/src/tools/ripGrep.d.ts +3 -2
- package/dist/src/tools/ripGrep.js +25 -54
- package/dist/src/tools/ripGrep.js.map +1 -1
- package/dist/src/tools/ripGrep.test.js +73 -131
- package/dist/src/tools/ripGrep.test.js.map +1 -1
- package/dist/src/tools/shell.js +38 -12
- package/dist/src/tools/shell.js.map +1 -1
- package/dist/src/tools/shell.test.js +410 -25
- package/dist/src/tools/shell.test.js.map +1 -1
- package/dist/src/tools/tool-error.d.ts +1 -0
- package/dist/src/tools/tool-error.js +1 -0
- package/dist/src/tools/tool-error.js.map +1 -1
- package/dist/src/tools/tool-names.d.ts +4 -4
- package/dist/src/tools/tool-names.js +6 -2
- package/dist/src/tools/tool-names.js.map +1 -1
- package/dist/src/tools/tool-registry.js +8 -1
- package/dist/src/tools/tool-registry.js.map +1 -1
- package/dist/src/utils/filesearch/fileSearch.d.ts +2 -0
- package/dist/src/utils/filesearch/fileSearch.js +97 -6
- package/dist/src/utils/filesearch/fileSearch.js.map +1 -1
- package/dist/src/utils/filesearch/fileSearch.test.js +54 -0
- package/dist/src/utils/filesearch/fileSearch.test.js.map +1 -1
- package/dist/src/utils/filesearch/fileWatcher.d.ts +25 -0
- package/dist/src/utils/filesearch/fileWatcher.js +86 -0
- package/dist/src/utils/filesearch/fileWatcher.js.map +1 -0
- package/dist/src/utils/filesearch/fileWatcher.test.d.ts +6 -0
- package/dist/src/utils/filesearch/fileWatcher.test.js +142 -0
- package/dist/src/utils/filesearch/fileWatcher.test.js.map +1 -0
- package/dist/src/utils/gitIgnoreParser.js +1 -1
- package/dist/src/utils/gitIgnoreParser.js.map +1 -1
- package/dist/src/utils/ignoreFileParser.js +1 -1
- package/dist/src/utils/ignoreFileParser.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.js +15 -5
- package/dist/src/utils/memoryDiscovery.js.map +1 -1
- package/dist/src/utils/retry.js +18 -6
- package/dist/src/utils/retry.js.map +1 -1
- package/dist/src/utils/retry.test.js +30 -0
- package/dist/src/utils/retry.test.js.map +1 -1
- package/dist/src/utils/shell-utils.d.ts +1 -0
- package/dist/src/utils/shell-utils.js +106 -0
- package/dist/src/utils/shell-utils.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -3
- package/vendor/ripgrep/rg-darwin-arm64 +0 -0
- package/vendor/ripgrep/rg-darwin-x64 +0 -0
- package/vendor/ripgrep/rg-linux-arm64 +0 -0
- package/vendor/ripgrep/rg-linux-x64 +0 -0
- package/vendor/ripgrep/rg-win32-x64.exe +0 -0
- package/dist/docs/get-started/installation.md +0 -181
- package/dist/google-gemini-cli-core-0.39.0-preview.1.tgz +0 -0
- package/dist/src/agents/memory-manager-agent.d.ts +0 -25
- package/dist/src/agents/memory-manager-agent.js +0 -138
- package/dist/src/agents/memory-manager-agent.js.map +0 -1
- package/dist/src/agents/memory-manager-agent.test.js +0 -123
- package/dist/src/agents/memory-manager-agent.test.js.map +0 -1
- package/dist/src/prompts/snippets-memory-manager.test.js +0 -31
- package/dist/src/prompts/snippets-memory-manager.test.js.map +0 -1
- /package/dist/src/agents/{memory-manager-agent.test.d.ts → skill-extraction-agent.test.d.ts} +0 -0
- /package/dist/src/prompts/{snippets-memory-manager.test.d.ts → snippets-memory-v2.test.d.ts} +0 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { Tabs, TabItem } from '@astrojs/starlight/components';
|
|
2
|
+
|
|
1
3
|
# Gemini CLI authentication setup
|
|
2
4
|
|
|
3
5
|
To use Gemini CLI, you'll need to authenticate with Google. This guide helps you
|
|
4
6
|
quickly find the best way to sign in based on your account type and how you're
|
|
5
7
|
using the CLI.
|
|
6
8
|
|
|
7
|
-
<!-- prettier-ignore -->
|
|
8
9
|
> [!TIP]
|
|
9
10
|
> Looking for a high-level comparison of all available subscriptions?
|
|
10
11
|
> To compare features and find the right quota for your needs, see our
|
|
@@ -23,7 +24,7 @@ Select the authentication method that matches your situation in the table below:
|
|
|
23
24
|
| Organization users with a company, school, or Google Workspace account | [Sign in with Google](#login-google) | [Yes](#set-gcp) |
|
|
24
25
|
| AI Studio user with a Gemini API key | [Use Gemini API Key](#gemini-api) | No |
|
|
25
26
|
| Google Cloud Vertex AI user | [Vertex AI](#vertex-ai) | [Yes](#set-gcp) |
|
|
26
|
-
| [Headless mode](#headless) | [Use Gemini API Key](#gemini-api) or<br
|
|
27
|
+
| [Headless mode](#headless) | [Use Gemini API Key](#gemini-api) or<br /> [Vertex AI](#vertex-ai) | No (for Gemini API Key)<br /> [Yes](#set-gcp) (for Vertex AI) |
|
|
27
28
|
|
|
28
29
|
### What is my Google account type?
|
|
29
30
|
|
|
@@ -84,19 +85,24 @@ To authenticate and use Gemini CLI with a Gemini API key:
|
|
|
84
85
|
|
|
85
86
|
2. Set the `GEMINI_API_KEY` environment variable to your key. For example:
|
|
86
87
|
|
|
87
|
-
|
|
88
|
+
<Tabs>
|
|
89
|
+
<TabItem label="macOS/Linux">
|
|
88
90
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
```bash
|
|
92
|
+
# Replace YOUR_GEMINI_API_KEY with the key from AI Studio
|
|
93
|
+
export GEMINI_API_KEY="YOUR_GEMINI_API_KEY"
|
|
94
|
+
```
|
|
93
95
|
|
|
94
|
-
|
|
96
|
+
</TabItem>
|
|
97
|
+
<TabItem label="Windows (PowerShell)">
|
|
95
98
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
```powershell
|
|
100
|
+
# Replace YOUR_GEMINI_API_KEY with the key from AI Studio
|
|
101
|
+
$env:GEMINI_API_KEY="YOUR_GEMINI_API_KEY"
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
</TabItem>
|
|
105
|
+
</Tabs>
|
|
100
106
|
|
|
101
107
|
To make this setting persistent, see
|
|
102
108
|
[Persisting Environment Variables](#persisting-vars).
|
|
@@ -109,7 +115,6 @@ To authenticate and use Gemini CLI with a Gemini API key:
|
|
|
109
115
|
|
|
110
116
|
4. Select **Use Gemini API key**.
|
|
111
117
|
|
|
112
|
-
<!-- prettier-ignore -->
|
|
113
118
|
> [!WARNING]
|
|
114
119
|
> Treat API keys, especially for services like Gemini, as sensitive
|
|
115
120
|
> credentials. Protect them to prevent unauthorized access and potential misuse
|
|
@@ -131,21 +136,26 @@ or the location where you want to run your jobs.
|
|
|
131
136
|
|
|
132
137
|
For example:
|
|
133
138
|
|
|
134
|
-
|
|
139
|
+
<Tabs>
|
|
140
|
+
<TabItem label="macOS/Linux">
|
|
135
141
|
|
|
136
|
-
```bash
|
|
142
|
+
```bash
|
|
137
143
|
# Replace with your project ID and desired location (for example, us-central1)
|
|
138
144
|
export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"
|
|
139
145
|
export GOOGLE_CLOUD_LOCATION="YOUR_PROJECT_LOCATION"
|
|
140
|
-
```
|
|
146
|
+
```
|
|
141
147
|
|
|
142
|
-
|
|
148
|
+
</TabItem>
|
|
149
|
+
<TabItem label="Windows (PowerShell)">
|
|
143
150
|
|
|
144
|
-
```powershell
|
|
151
|
+
```powershell
|
|
145
152
|
# Replace with your project ID and desired location (for example, us-central1)
|
|
146
153
|
$env:GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"
|
|
147
154
|
$env:GOOGLE_CLOUD_LOCATION="YOUR_PROJECT_LOCATION"
|
|
148
|
-
```
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
</TabItem>
|
|
158
|
+
</Tabs>
|
|
149
159
|
|
|
150
160
|
To make any Vertex AI environment variable settings persistent, see
|
|
151
161
|
[Persisting Environment Variables](#persisting-vars).
|
|
@@ -157,17 +167,22 @@ Consider this authentication method if you have Google Cloud CLI installed.
|
|
|
157
167
|
If you have previously set `GOOGLE_API_KEY` or `GEMINI_API_KEY`, you must unset
|
|
158
168
|
them to use ADC.
|
|
159
169
|
|
|
160
|
-
|
|
170
|
+
<Tabs>
|
|
171
|
+
<TabItem label="macOS/Linux">
|
|
161
172
|
|
|
162
|
-
```bash
|
|
173
|
+
```bash
|
|
163
174
|
unset GOOGLE_API_KEY GEMINI_API_KEY
|
|
164
|
-
```
|
|
175
|
+
```
|
|
165
176
|
|
|
166
|
-
|
|
177
|
+
</TabItem>
|
|
178
|
+
<TabItem label="Windows (PowerShell)">
|
|
167
179
|
|
|
168
|
-
```powershell
|
|
180
|
+
```powershell
|
|
169
181
|
Remove-Item Env:\GOOGLE_API_KEY, Env:\GEMINI_API_KEY -ErrorAction Ignore
|
|
170
|
-
```
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
</TabItem>
|
|
185
|
+
</Tabs>
|
|
171
186
|
|
|
172
187
|
1. Verify you have a Google Cloud project and Vertex AI API is enabled.
|
|
173
188
|
|
|
@@ -195,17 +210,22 @@ pipelines, or if your organization restricts user-based ADC or API key creation.
|
|
|
195
210
|
If you have previously set `GOOGLE_API_KEY` or `GEMINI_API_KEY`, you must unset
|
|
196
211
|
them:
|
|
197
212
|
|
|
198
|
-
|
|
213
|
+
<Tabs>
|
|
214
|
+
<TabItem label="macOS/Linux">
|
|
199
215
|
|
|
200
|
-
```bash
|
|
216
|
+
```bash
|
|
201
217
|
unset GOOGLE_API_KEY GEMINI_API_KEY
|
|
202
|
-
```
|
|
218
|
+
```
|
|
203
219
|
|
|
204
|
-
|
|
220
|
+
</TabItem>
|
|
221
|
+
<TabItem label="Windows (PowerShell)">
|
|
205
222
|
|
|
206
|
-
```powershell
|
|
223
|
+
```powershell
|
|
207
224
|
Remove-Item Env:\GOOGLE_API_KEY, Env:\GEMINI_API_KEY -ErrorAction Ignore
|
|
208
|
-
```
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
</TabItem>
|
|
228
|
+
</Tabs>
|
|
209
229
|
|
|
210
230
|
1. [Create a service account and key](https://cloud.google.com/iam/docs/keys-create-delete)
|
|
211
231
|
and download the provided JSON file. Assign the "Vertex AI User" role to the
|
|
@@ -214,19 +234,24 @@ Remove-Item Env:\GOOGLE_API_KEY, Env:\GEMINI_API_KEY -ErrorAction Ignore
|
|
|
214
234
|
2. Set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to the JSON
|
|
215
235
|
file's absolute path. For example:
|
|
216
236
|
|
|
217
|
-
|
|
237
|
+
<Tabs>
|
|
238
|
+
<TabItem label="macOS/Linux">
|
|
218
239
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
240
|
+
```bash
|
|
241
|
+
# Replace /path/to/your/keyfile.json with the actual path
|
|
242
|
+
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/keyfile.json"
|
|
243
|
+
```
|
|
223
244
|
|
|
224
|
-
|
|
245
|
+
</TabItem>
|
|
246
|
+
<TabItem label="Windows (PowerShell)">
|
|
225
247
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
248
|
+
```powershell
|
|
249
|
+
# Replace C:\path\to\your\keyfile.json with the actual path
|
|
250
|
+
$env:GOOGLE_APPLICATION_CREDENTIALS="C:\path\to\your\keyfile.json"
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
</TabItem>
|
|
254
|
+
</Tabs>
|
|
230
255
|
|
|
231
256
|
3. [Configure your Google Cloud Project](#set-gcp).
|
|
232
257
|
|
|
@@ -238,7 +263,6 @@ Remove-Item Env:\GOOGLE_API_KEY, Env:\GEMINI_API_KEY -ErrorAction Ignore
|
|
|
238
263
|
|
|
239
264
|
5. Select **Vertex AI**.
|
|
240
265
|
|
|
241
|
-
<!-- prettier-ignore -->
|
|
242
266
|
> [!WARNING]
|
|
243
267
|
> Protect your service account key file as it gives access to
|
|
244
268
|
> your resources.
|
|
@@ -250,19 +274,24 @@ Remove-Item Env:\GOOGLE_API_KEY, Env:\GEMINI_API_KEY -ErrorAction Ignore
|
|
|
250
274
|
|
|
251
275
|
2. Set the `GOOGLE_API_KEY` environment variable:
|
|
252
276
|
|
|
253
|
-
|
|
277
|
+
<Tabs>
|
|
278
|
+
<TabItem label="macOS/Linux">
|
|
254
279
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
280
|
+
```bash
|
|
281
|
+
# Replace YOUR_GOOGLE_API_KEY with your Vertex AI API key
|
|
282
|
+
export GOOGLE_API_KEY="YOUR_GOOGLE_API_KEY"
|
|
283
|
+
```
|
|
259
284
|
|
|
260
|
-
|
|
285
|
+
</TabItem>
|
|
286
|
+
<TabItem label="Windows (PowerShell)">
|
|
261
287
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
288
|
+
```powershell
|
|
289
|
+
# Replace YOUR_GOOGLE_API_KEY with your Vertex AI API key
|
|
290
|
+
$env:GOOGLE_API_KEY="YOUR_GOOGLE_API_KEY"
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
</TabItem>
|
|
294
|
+
</Tabs>
|
|
266
295
|
|
|
267
296
|
If you see errors like `"API keys are not supported by this API..."`, your
|
|
268
297
|
organization might restrict API key usage for this service. Try the other
|
|
@@ -280,7 +309,6 @@ Remove-Item Env:\GOOGLE_API_KEY, Env:\GEMINI_API_KEY -ErrorAction Ignore
|
|
|
280
309
|
|
|
281
310
|
## Set your Google Cloud project <a id="set-gcp"></a>
|
|
282
311
|
|
|
283
|
-
<!-- prettier-ignore -->
|
|
284
312
|
> [!IMPORTANT]
|
|
285
313
|
> Most individual Google accounts (free and paid) don't require a
|
|
286
314
|
> Google Cloud project for authentication.
|
|
@@ -308,19 +336,24 @@ To configure Gemini CLI to use a Google Cloud project, do the following:
|
|
|
308
336
|
|
|
309
337
|
For example, to set the `GOOGLE_CLOUD_PROJECT_ID` variable:
|
|
310
338
|
|
|
311
|
-
|
|
339
|
+
<Tabs>
|
|
340
|
+
<TabItem label="macOS/Linux">
|
|
312
341
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
342
|
+
```bash
|
|
343
|
+
# Replace YOUR_PROJECT_ID with your actual Google Cloud project ID
|
|
344
|
+
export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"
|
|
345
|
+
```
|
|
317
346
|
|
|
318
|
-
|
|
347
|
+
</TabItem>
|
|
348
|
+
<TabItem label="Windows (PowerShell)">
|
|
319
349
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
350
|
+
```powershell
|
|
351
|
+
# Replace YOUR_PROJECT_ID with your actual Google Cloud project ID
|
|
352
|
+
$env:GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
</TabItem>
|
|
356
|
+
</Tabs>
|
|
324
357
|
|
|
325
358
|
To make this setting persistent, see
|
|
326
359
|
[Persisting Environment Variables](#persisting-vars).
|
|
@@ -333,21 +366,29 @@ persist them with the following methods:
|
|
|
333
366
|
1. **Add your environment variables to your shell configuration file:** Append
|
|
334
367
|
the environment variable commands to your shell's startup file.
|
|
335
368
|
|
|
336
|
-
|
|
369
|
+
<Tabs>
|
|
370
|
+
<TabItem label="macOS/Linux">
|
|
337
371
|
|
|
338
|
-
|
|
339
|
-
echo 'export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"' >> ~/.bashrc
|
|
340
|
-
source ~/.bashrc
|
|
341
|
-
```
|
|
372
|
+
(for example, `~/.bashrc`, `~/.zshrc`, or `~/.profile`):
|
|
342
373
|
|
|
343
|
-
|
|
374
|
+
```bash
|
|
375
|
+
echo 'export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"' >> ~/.bashrc
|
|
376
|
+
source ~/.bashrc
|
|
377
|
+
```
|
|
344
378
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
379
|
+
</TabItem>
|
|
380
|
+
<TabItem label="Windows (PowerShell)">
|
|
381
|
+
|
|
382
|
+
(for example, `$PROFILE`):
|
|
383
|
+
|
|
384
|
+
```powershell
|
|
385
|
+
Add-Content -Path $PROFILE -Value '$env:GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"'
|
|
386
|
+
. $PROFILE
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
</TabItem>
|
|
390
|
+
</Tabs>
|
|
349
391
|
|
|
350
|
-
<!-- prettier-ignore -->
|
|
351
392
|
> [!WARNING]
|
|
352
393
|
> Be aware that when you export API keys or service account
|
|
353
394
|
> paths in your shell configuration file, any process launched from that
|
|
@@ -361,25 +402,30 @@ persist them with the following methods:
|
|
|
361
402
|
|
|
362
403
|
Example for user-wide settings:
|
|
363
404
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
405
|
+
<Tabs>
|
|
406
|
+
<TabItem label="macOS/Linux">
|
|
407
|
+
|
|
408
|
+
```bash
|
|
409
|
+
mkdir -p ~/.gemini
|
|
410
|
+
cat >> ~/.gemini/.env <<'EOF'
|
|
411
|
+
GOOGLE_CLOUD_PROJECT="your-project-id"
|
|
412
|
+
# Add other variables like GEMINI_API_KEY as needed
|
|
413
|
+
EOF
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
</TabItem>
|
|
417
|
+
<TabItem label="Windows (PowerShell)">
|
|
418
|
+
|
|
419
|
+
```powershell
|
|
420
|
+
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.gemini"
|
|
421
|
+
@"
|
|
422
|
+
GOOGLE_CLOUD_PROJECT="your-project-id"
|
|
423
|
+
# Add other variables like GEMINI_API_KEY as needed
|
|
424
|
+
"@ | Out-File -FilePath "$env:USERPROFILE\.gemini\.env" -Encoding utf8 -Append
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
</TabItem>
|
|
428
|
+
</Tabs>
|
|
383
429
|
|
|
384
430
|
Variables are loaded from the first file found, not merged.
|
|
385
431
|
|
|
@@ -24,7 +24,8 @@ Once Gemini CLI is installed, run Gemini CLI from your command line:
|
|
|
24
24
|
gemini
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
For more installation options, see
|
|
27
|
+
For more installation options, see
|
|
28
|
+
[Gemini CLI Installation](./installation.mdx).
|
|
28
29
|
|
|
29
30
|
## Authenticate
|
|
30
31
|
|
|
@@ -46,7 +47,7 @@ cases, you can log in with your existing Google account:
|
|
|
46
47
|
|
|
47
48
|
Certain account types may require you to configure a Google Cloud project. For
|
|
48
49
|
more information, including other authentication methods, see
|
|
49
|
-
[Gemini CLI Authentication Setup](./authentication.
|
|
50
|
+
[Gemini CLI Authentication Setup](./authentication.mdx).
|
|
50
51
|
|
|
51
52
|
## Configure
|
|
52
53
|
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { Tabs, TabItem } from '@astrojs/starlight/components';
|
|
2
|
+
|
|
3
|
+
# Gemini CLI installation, execution, and releases
|
|
4
|
+
|
|
5
|
+
This document provides an overview of Gemini CLI's system requirements,
|
|
6
|
+
installation methods, and release types.
|
|
7
|
+
|
|
8
|
+
## Recommended system specifications
|
|
9
|
+
|
|
10
|
+
- **Operating System:**
|
|
11
|
+
- macOS 15+
|
|
12
|
+
- Windows 11 24H2+
|
|
13
|
+
- Ubuntu 20.04+
|
|
14
|
+
- **Hardware:**
|
|
15
|
+
- "Casual" usage: 4GB+ RAM (short sessions, common tasks and edits)
|
|
16
|
+
- "Power" usage: 16GB+ RAM (long sessions, large codebases, deep context)
|
|
17
|
+
- **Runtime:** Node.js 20.0.0+
|
|
18
|
+
- **Shell:** Bash, Zsh, or PowerShell
|
|
19
|
+
- **Location:**
|
|
20
|
+
[Gemini Code Assist supported locations](https://developers.google.com/gemini-code-assist/resources/available-locations#americas)
|
|
21
|
+
- **Internet connection required**
|
|
22
|
+
|
|
23
|
+
## Install Gemini CLI
|
|
24
|
+
|
|
25
|
+
We recommend most users install Gemini CLI using one of the following
|
|
26
|
+
installation methods. Note that Gemini CLI comes pre-installed on
|
|
27
|
+
[**Cloud Shell**](https://docs.cloud.google.com/shell/docs) and
|
|
28
|
+
[**Cloud Workstations**](https://cloud.google.com/workstations).
|
|
29
|
+
|
|
30
|
+
<Tabs>
|
|
31
|
+
<TabItem label="npm">
|
|
32
|
+
|
|
33
|
+
Install globally with npm:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install -g @google/gemini-cli
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
</TabItem>
|
|
40
|
+
<TabItem label="Homebrew (macOS/Linux)">
|
|
41
|
+
|
|
42
|
+
Install globally with Homebrew:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
brew install gemini-cli
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
</TabItem>
|
|
49
|
+
<TabItem label="MacPorts (macOS)">
|
|
50
|
+
|
|
51
|
+
Install globally with MacPorts:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
sudo port install gemini-cli
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
</TabItem>
|
|
58
|
+
<TabItem label="Anaconda">
|
|
59
|
+
|
|
60
|
+
Install with Anaconda (for restricted environments):
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Create and activate a new environment
|
|
64
|
+
conda create -y -n gemini_env -c conda-forge nodejs
|
|
65
|
+
conda activate gemini_env
|
|
66
|
+
|
|
67
|
+
# Install Gemini CLI globally via npm (inside the environment)
|
|
68
|
+
npm install -g @google/gemini-cli
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
</TabItem>
|
|
72
|
+
</Tabs>
|
|
73
|
+
|
|
74
|
+
## Run Gemini CLI
|
|
75
|
+
|
|
76
|
+
For most users, we recommend running Gemini CLI with the `gemini` command:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
gemini
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
For a list of options and additional commands, see the
|
|
83
|
+
[CLI cheatsheet](../cli/cli-reference.md).
|
|
84
|
+
|
|
85
|
+
You can also run Gemini CLI using one of the following advanced methods:
|
|
86
|
+
|
|
87
|
+
<Tabs>
|
|
88
|
+
<TabItem label="npx">
|
|
89
|
+
|
|
90
|
+
Run instantly with npx. You can run Gemini CLI without permanent installation.
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Using npx (no installation required)
|
|
94
|
+
npx @google/gemini-cli
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
You can also execute the CLI directly from the main branch on GitHub, which is
|
|
98
|
+
helpful for testing features still in development:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
npx https://github.com/google-gemini/gemini-cli
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
</TabItem>
|
|
105
|
+
<TabItem label="Docker/Podman Sandbox">
|
|
106
|
+
|
|
107
|
+
For security and isolation, Gemini CLI can be run inside a container. This is
|
|
108
|
+
the default way that the CLI executes tools that might have side effects.
|
|
109
|
+
|
|
110
|
+
- **Directly from the registry:** You can run the published sandbox image
|
|
111
|
+
directly. This is useful for environments where you only have Docker and want
|
|
112
|
+
to run the CLI.
|
|
113
|
+
```bash
|
|
114
|
+
# Run the published sandbox image
|
|
115
|
+
docker run --rm -it us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.1.1
|
|
116
|
+
```
|
|
117
|
+
- **Using the `--sandbox` flag:** If you have Gemini CLI installed locally
|
|
118
|
+
(using the standard installation described above), you can instruct it to run
|
|
119
|
+
inside the sandbox container.
|
|
120
|
+
```bash
|
|
121
|
+
gemini --sandbox -y -p "your prompt here"
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
</TabItem>
|
|
125
|
+
<TabItem label="From source">
|
|
126
|
+
|
|
127
|
+
Contributors to the project will want to run the CLI directly from the source
|
|
128
|
+
code.
|
|
129
|
+
|
|
130
|
+
- **Development mode:** This method provides hot-reloading and is useful for
|
|
131
|
+
active development.
|
|
132
|
+
```bash
|
|
133
|
+
# From the root of the repository
|
|
134
|
+
npm run start
|
|
135
|
+
```
|
|
136
|
+
- **Production mode (React optimizations):** This method runs the CLI with React
|
|
137
|
+
production mode enabled, which is useful for testing performance without
|
|
138
|
+
development overhead.
|
|
139
|
+
```bash
|
|
140
|
+
# From the root of the repository
|
|
141
|
+
npm run start:prod
|
|
142
|
+
```
|
|
143
|
+
- **Production-like mode (linked package):** This method simulates a global
|
|
144
|
+
installation by linking your local package. It's useful for testing a local
|
|
145
|
+
build in a production workflow.
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
# Link the local cli package to your global node_modules
|
|
149
|
+
npm link packages/cli
|
|
150
|
+
|
|
151
|
+
# Now you can run your local version using the `gemini` command
|
|
152
|
+
gemini
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
</TabItem>
|
|
156
|
+
</Tabs>
|
|
157
|
+
|
|
158
|
+
## Releases
|
|
159
|
+
|
|
160
|
+
Gemini CLI has three release channels: stable, preview, and nightly. For most
|
|
161
|
+
users, we recommend the stable release, which is the default installation.
|
|
162
|
+
|
|
163
|
+
<Tabs>
|
|
164
|
+
<TabItem label="Stable">
|
|
165
|
+
|
|
166
|
+
Stable releases are published each week. A stable release is created from the
|
|
167
|
+
previous week's preview release along with any bug fixes. The stable release
|
|
168
|
+
uses the `latest` tag. Omitting the tag also installs the latest stable
|
|
169
|
+
release by default.
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
# Both commands install the latest stable release.
|
|
173
|
+
npm install -g @google/gemini-cli
|
|
174
|
+
npm install -g @google/gemini-cli@latest
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
</TabItem>
|
|
178
|
+
<TabItem label="Preview">
|
|
179
|
+
|
|
180
|
+
New preview releases will be published each week. These releases are not fully
|
|
181
|
+
vetted and may contain regressions or other outstanding issues. Try out the
|
|
182
|
+
preview release by using the `preview` tag:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
npm install -g @google/gemini-cli@preview
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
</TabItem>
|
|
189
|
+
<TabItem label="Nightly">
|
|
190
|
+
|
|
191
|
+
Nightly releases are published every day. The nightly release includes all
|
|
192
|
+
changes from the main branch at time of release. It should be assumed there are
|
|
193
|
+
pending validations and issues. You can help test the latest changes by
|
|
194
|
+
installing with the `nightly` tag:
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
npm install -g @google/gemini-cli@nightly
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
</TabItem>
|
|
201
|
+
</Tabs>
|
package/dist/docs/index.md
CHANGED
|
@@ -15,9 +15,9 @@ npm install -g @google/gemini-cli
|
|
|
15
15
|
Jump in to Gemini CLI.
|
|
16
16
|
|
|
17
17
|
- **[Quickstart](./get-started/index.md):** Your first session with Gemini CLI.
|
|
18
|
-
- **[Installation](./get-started/installation.
|
|
18
|
+
- **[Installation](./get-started/installation.mdx):** How to install Gemini CLI
|
|
19
19
|
on your system.
|
|
20
|
-
- **[Authentication](./get-started/authentication.
|
|
20
|
+
- **[Authentication](./get-started/authentication.mdx):** Setup instructions for
|
|
21
21
|
personal and enterprise accounts.
|
|
22
22
|
- **[CLI cheatsheet](./cli/cli-reference.md):** A quick reference for common
|
|
23
23
|
commands and options.
|