@google/gemini-cli-core 0.1.18 → 0.1.19
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/README.md +199 -132
- package/dist/google-gemini-cli-core-0.1.18.tgz +0 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/src/code_assist/converter.d.ts +3 -2
- package/dist/src/code_assist/converter.js +2 -2
- package/dist/src/code_assist/converter.js.map +1 -1
- package/dist/src/code_assist/converter.test.js +48 -1
- package/dist/src/code_assist/converter.test.js.map +1 -1
- package/dist/src/code_assist/oauth2.js +1 -1
- package/dist/src/code_assist/oauth2.js.map +1 -1
- package/dist/src/code_assist/server.test.js +4 -1
- package/dist/src/code_assist/server.test.js.map +1 -1
- package/dist/src/code_assist/setup.js +4 -4
- package/dist/src/code_assist/setup.js.map +1 -1
- package/dist/src/config/config.d.ts +19 -0
- package/dist/src/config/config.js +29 -5
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +8 -0
- package/dist/src/config/config.test.js.map +1 -1
- package/dist/src/core/client.d.ts +5 -4
- package/dist/src/core/client.js +162 -116
- package/dist/src/core/client.js.map +1 -1
- package/dist/src/core/client.test.js +275 -30
- package/dist/src/core/client.test.js.map +1 -1
- package/dist/src/core/contentGenerator.js +3 -2
- package/dist/src/core/contentGenerator.js.map +1 -1
- package/dist/src/core/contentGenerator.test.js +3 -2
- package/dist/src/core/contentGenerator.test.js.map +1 -1
- package/dist/src/core/coreToolScheduler.d.ts +21 -8
- package/dist/src/core/coreToolScheduler.js +170 -61
- package/dist/src/core/coreToolScheduler.js.map +1 -1
- package/dist/src/core/coreToolScheduler.test.js +181 -37
- package/dist/src/core/coreToolScheduler.test.js.map +1 -1
- package/dist/src/core/geminiChat.d.ts +7 -6
- package/dist/src/core/geminiChat.js +43 -43
- package/dist/src/core/geminiChat.js.map +1 -1
- package/dist/src/core/logger.d.ts +1 -0
- package/dist/src/core/logger.js +18 -0
- package/dist/src/core/logger.js.map +1 -1
- package/dist/src/core/logger.test.js +29 -0
- package/dist/src/core/logger.test.js.map +1 -1
- package/dist/src/core/loggingContentGenerator.d.ts +29 -0
- package/dist/src/core/loggingContentGenerator.js +97 -0
- package/dist/src/core/loggingContentGenerator.js.map +1 -0
- package/dist/src/core/nonInteractiveToolExecutor.js +20 -1
- package/dist/src/core/nonInteractiveToolExecutor.js.map +1 -1
- package/dist/src/core/nonInteractiveToolExecutor.test.js +7 -31
- package/dist/src/core/nonInteractiveToolExecutor.test.js.map +1 -1
- package/dist/src/core/subagent.d.ts +230 -0
- package/dist/src/core/subagent.js +447 -0
- package/dist/src/core/subagent.js.map +1 -0
- package/dist/src/core/subagent.test.d.ts +6 -0
- package/dist/src/core/subagent.test.js +515 -0
- package/dist/src/core/subagent.test.js.map +1 -0
- package/dist/src/core/turn.js +1 -0
- package/dist/src/core/turn.js.map +1 -1
- package/dist/src/core/turn.test.js +4 -0
- package/dist/src/core/turn.test.js.map +1 -1
- package/dist/src/ide/detect-ide.d.ts +8 -1
- package/dist/src/ide/detect-ide.js +40 -3
- package/dist/src/ide/detect-ide.js.map +1 -1
- package/dist/src/ide/ide-client.d.ts +20 -1
- package/dist/src/ide/ide-client.js +144 -18
- package/dist/src/ide/ide-client.js.map +1 -1
- package/dist/src/ide/ide-installer.js +20 -1
- package/dist/src/ide/ide-installer.js.map +1 -1
- package/dist/src/ide/ide-installer.test.js +37 -2
- package/dist/src/ide/ide-installer.test.js.map +1 -1
- package/dist/src/ide/ideContext.d.ts +95 -0
- package/dist/src/ide/ideContext.js +45 -0
- package/dist/src/ide/ideContext.js.map +1 -1
- package/dist/src/mcp/google-auth-provider.js +9 -0
- package/dist/src/mcp/google-auth-provider.js.map +1 -1
- package/dist/src/mcp/google-auth-provider.test.js +45 -10
- package/dist/src/mcp/google-auth-provider.test.js.map +1 -1
- package/dist/src/services/loopDetectionService.js +14 -11
- package/dist/src/services/loopDetectionService.js.map +1 -1
- package/dist/src/services/loopDetectionService.test.js +191 -0
- package/dist/src/services/loopDetectionService.test.js.map +1 -1
- package/dist/src/services/shellExecutionService.js +29 -9
- package/dist/src/services/shellExecutionService.js.map +1 -1
- package/dist/src/services/shellExecutionService.test.js +8 -0
- package/dist/src/services/shellExecutionService.test.js.map +1 -1
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +27 -2
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +187 -58
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -1
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.d.ts +6 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js +186 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js.map +1 -0
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +5 -1
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +8 -0
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -1
- package/dist/src/telemetry/loggers.test.circular.js +7 -2
- package/dist/src/telemetry/loggers.test.circular.js.map +1 -1
- package/dist/src/telemetry/loggers.test.js +7 -2
- package/dist/src/telemetry/loggers.test.js.map +1 -1
- package/dist/src/telemetry/metrics.d.ts +3 -2
- package/dist/src/telemetry/metrics.js +7 -1
- package/dist/src/telemetry/metrics.js.map +1 -1
- package/dist/src/telemetry/metrics.test.js +50 -0
- package/dist/src/telemetry/metrics.test.js.map +1 -1
- package/dist/src/telemetry/tool-call-decision.d.ts +13 -0
- package/dist/src/telemetry/tool-call-decision.js +29 -0
- package/dist/src/telemetry/tool-call-decision.js.map +1 -0
- package/dist/src/telemetry/types.d.ts +4 -7
- package/dist/src/telemetry/types.js +17 -21
- package/dist/src/telemetry/types.js.map +1 -1
- package/dist/src/telemetry/uiTelemetry.d.ts +4 -1
- package/dist/src/telemetry/uiTelemetry.js +3 -1
- package/dist/src/telemetry/uiTelemetry.js.map +1 -1
- package/dist/src/telemetry/uiTelemetry.test.js +13 -2
- package/dist/src/telemetry/uiTelemetry.test.js.map +1 -1
- package/dist/src/test-utils/tools.d.ts +23 -0
- package/dist/src/test-utils/tools.js +41 -0
- package/dist/src/test-utils/tools.js.map +1 -0
- package/dist/src/tools/diffOptions.d.ts +2 -0
- package/dist/src/tools/diffOptions.js +28 -0
- package/dist/src/tools/diffOptions.js.map +1 -1
- package/dist/src/tools/diffOptions.test.d.ts +6 -0
- package/dist/src/tools/diffOptions.test.js +119 -0
- package/dist/src/tools/diffOptions.test.js.map +1 -0
- package/dist/src/tools/edit.d.ts +9 -33
- package/dist/src/tools/edit.js +143 -132
- package/dist/src/tools/edit.js.map +1 -1
- package/dist/src/tools/edit.test.js +117 -51
- package/dist/src/tools/edit.test.js.map +1 -1
- package/dist/src/tools/glob.d.ts +3 -10
- package/dist/src/tools/glob.js +85 -89
- package/dist/src/tools/glob.js.map +1 -1
- package/dist/src/tools/glob.test.js +22 -12
- package/dist/src/tools/glob.test.js.map +1 -1
- package/dist/src/tools/grep.d.ts +3 -35
- package/dist/src/tools/grep.js +111 -83
- package/dist/src/tools/grep.js.map +1 -1
- package/dist/src/tools/grep.test.js +40 -23
- package/dist/src/tools/grep.test.js.map +1 -1
- package/dist/src/tools/ls.js +8 -9
- package/dist/src/tools/ls.js.map +1 -1
- package/dist/src/tools/mcp-client.d.ts +14 -3
- package/dist/src/tools/mcp-client.js +82 -6
- package/dist/src/tools/mcp-client.js.map +1 -1
- package/dist/src/tools/mcp-client.test.js +340 -5
- package/dist/src/tools/mcp-client.test.js.map +1 -1
- package/dist/src/tools/mcp-tool.d.ts +3 -8
- package/dist/src/tools/mcp-tool.js +5 -18
- package/dist/src/tools/mcp-tool.js.map +1 -1
- package/dist/src/tools/memoryTool.d.ts +2 -2
- package/dist/src/tools/memoryTool.js +5 -5
- package/dist/src/tools/memoryTool.js.map +1 -1
- package/dist/src/tools/memoryTool.test.js +10 -1
- package/dist/src/tools/memoryTool.test.js.map +1 -1
- package/dist/src/tools/modifiable-tool.d.ts +8 -5
- package/dist/src/tools/modifiable-tool.js +4 -1
- package/dist/src/tools/modifiable-tool.js.map +1 -1
- package/dist/src/tools/modifiable-tool.test.js +3 -3
- package/dist/src/tools/modifiable-tool.test.js.map +1 -1
- package/dist/src/tools/read-file.d.ts +4 -6
- package/dist/src/tools/read-file.js +92 -45
- package/dist/src/tools/read-file.js.map +1 -1
- package/dist/src/tools/read-file.test.js +192 -130
- package/dist/src/tools/read-file.test.js.map +1 -1
- package/dist/src/tools/read-many-files.js +25 -20
- package/dist/src/tools/read-many-files.js.map +1 -1
- package/dist/src/tools/read-many-files.test.js +22 -11
- package/dist/src/tools/read-many-files.test.js.map +1 -1
- package/dist/src/tools/shell.js +11 -7
- package/dist/src/tools/shell.js.map +1 -1
- package/dist/src/tools/shell.test.js +21 -0
- package/dist/src/tools/shell.test.js.map +1 -1
- package/dist/src/tools/tool-error.d.ts +4 -0
- package/dist/src/tools/tool-error.js +4 -0
- package/dist/src/tools/tool-error.js.map +1 -1
- package/dist/src/tools/tool-registry.d.ts +12 -20
- package/dist/src/tools/tool-registry.js +23 -76
- package/dist/src/tools/tool-registry.js.map +1 -1
- package/dist/src/tools/tool-registry.test.js +19 -192
- package/dist/src/tools/tool-registry.test.js.map +1 -1
- package/dist/src/tools/tools.d.ts +144 -43
- package/dist/src/tools/tools.js +181 -11
- package/dist/src/tools/tools.js.map +1 -1
- package/dist/src/tools/tools.test.d.ts +6 -0
- package/dist/src/tools/tools.test.js +117 -0
- package/dist/src/tools/tools.test.js.map +1 -0
- package/dist/src/tools/web-fetch.js +3 -4
- package/dist/src/tools/web-fetch.js.map +1 -1
- package/dist/src/tools/web-search.js +1 -1
- package/dist/src/tools/web-search.js.map +1 -1
- package/dist/src/tools/write-file.d.ts +6 -2
- package/dist/src/tools/write-file.js +85 -20
- package/dist/src/tools/write-file.js.map +1 -1
- package/dist/src/tools/write-file.test.js +113 -8
- package/dist/src/tools/write-file.test.js.map +1 -1
- package/dist/src/utils/bfsFileSearch.test.js +28 -56
- package/dist/src/utils/bfsFileSearch.test.js.map +1 -1
- package/dist/src/utils/editCorrector.js +8 -9
- package/dist/src/utils/editCorrector.js.map +1 -1
- package/dist/src/utils/environmentContext.d.ts +21 -0
- package/dist/src/utils/environmentContext.js +90 -0
- package/dist/src/utils/environmentContext.js.map +1 -0
- package/dist/src/utils/environmentContext.test.d.ts +6 -0
- package/dist/src/utils/environmentContext.test.js +139 -0
- package/dist/src/utils/environmentContext.test.js.map +1 -0
- package/dist/src/utils/fileUtils.d.ts +7 -0
- package/dist/src/utils/fileUtils.js +15 -12
- package/dist/src/utils/fileUtils.js.map +1 -1
- package/dist/src/utils/fileUtils.test.js +6 -5
- package/dist/src/utils/fileUtils.test.js.map +1 -1
- package/dist/src/utils/filesearch/crawlCache.d.ts +1 -1
- package/dist/src/utils/filesearch/crawlCache.js +4 -1
- package/dist/src/utils/filesearch/crawlCache.js.map +1 -1
- package/dist/src/utils/filesearch/crawlCache.test.js +10 -0
- package/dist/src/utils/filesearch/crawlCache.test.js.map +1 -1
- package/dist/src/utils/filesearch/fileSearch.d.ts +2 -0
- package/dist/src/utils/filesearch/fileSearch.js +32 -7
- package/dist/src/utils/filesearch/fileSearch.js.map +1 -1
- package/dist/src/utils/filesearch/fileSearch.test.js +139 -0
- package/dist/src/utils/filesearch/fileSearch.test.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.js +4 -1
- package/dist/src/utils/memoryDiscovery.js.map +1 -1
- package/dist/src/utils/nextSpeakerChecker.js +5 -6
- package/dist/src/utils/nextSpeakerChecker.js.map +1 -1
- package/dist/src/utils/nextSpeakerChecker.test.js +2 -2
- package/dist/src/utils/nextSpeakerChecker.test.js.map +1 -1
- package/dist/src/utils/schemaValidator.d.ts +1 -8
- package/dist/src/utils/schemaValidator.js +1 -32
- package/dist/src/utils/schemaValidator.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -1
- package/dist/google-gemini-cli-core-0.1.17.tgz +0 -0
package/README.md
CHANGED
|
@@ -1,215 +1,282 @@
|
|
|
1
1
|
# Gemini CLI
|
|
2
2
|
|
|
3
3
|
[](https://github.com/google-gemini/gemini-cli/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/@google/gemini-cli)
|
|
5
|
+
[](https://github.com/google-gemini/gemini-cli/blob/main/LICENSE)
|
|
4
6
|
|
|
5
7
|

|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
tools, understands your code and accelerates your workflows.
|
|
9
|
+
Gemini CLI is an open-source AI agent that brings the power of Gemini directly into your terminal. It provides lightweight access to Gemini, giving you the most direct path from your prompt to our model.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
## 🚀 Why Gemini CLI?
|
|
11
12
|
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
tool, built into Gemini.
|
|
13
|
+
- **🎯 Free tier**: 60 requests/min and 1,000 requests/day with personal Google account
|
|
14
|
+
- **🧠 Powerful Gemini 2.5 Pro**: Access to 1M token context window
|
|
15
|
+
- **🔧 Built-in tools**: Google Search grounding, file operations, shell commands, web fetching
|
|
16
|
+
- **🔌 Extensible**: MCP (Model Context Protocol) support for custom integrations
|
|
17
|
+
- **💻 Terminal-first**: Designed for developers who live in the command line
|
|
18
|
+
- **🛡️ Open source**: Apache 2.0 licensed
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## 📦 Installation
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
### Quick Install
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
#### Run instantly with npx
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
```bash
|
|
27
|
+
# Using npx (no installation required)
|
|
28
|
+
npx https://github.com/google-gemini/gemini-cli
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
#### Install globally with npm
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install -g @google/gemini-cli
|
|
35
|
+
```
|
|
28
36
|
|
|
29
|
-
|
|
30
|
-
npx https://github.com/google-gemini/gemini-cli
|
|
31
|
-
```
|
|
37
|
+
#### Install globally with Homebrew (macOS/Linux)
|
|
32
38
|
|
|
33
|
-
|
|
39
|
+
```bash
|
|
40
|
+
brew install gemini-cli
|
|
41
|
+
```
|
|
34
42
|
|
|
35
|
-
|
|
36
|
-
npm install -g @google/gemini-cli
|
|
37
|
-
```
|
|
43
|
+
#### System Requirements
|
|
38
44
|
|
|
39
|
-
|
|
45
|
+
- Node.js version 20 or higher
|
|
46
|
+
- macOS, Linux, or Windows
|
|
40
47
|
|
|
41
|
-
|
|
42
|
-
gemini
|
|
43
|
-
```
|
|
48
|
+
## 📋 Key Features
|
|
44
49
|
|
|
45
|
-
|
|
50
|
+
With Gemini CLI you can:
|
|
46
51
|
|
|
47
|
-
|
|
48
|
-
|
|
52
|
+
- **Code Understanding & Generation**
|
|
53
|
+
- Query and edit large codebases
|
|
54
|
+
- Generate new apps from PDFs, images, or sketches using multimodal capabilities
|
|
55
|
+
- Debug issues and troubleshoot with natural language
|
|
56
|
+
- **Automation & Integration**
|
|
57
|
+
- Automate operational tasks like querying pull requests or handling complex rebases
|
|
58
|
+
- Use MCP servers to connect new capabilities, including [media generation with Imagen, Veo or Lyria](https://github.com/GoogleCloudPlatform/vertex-ai-creative-studio/tree/main/experiments/mcp-genmedia)
|
|
59
|
+
- Run non-interactively in scripts for workflow automation
|
|
60
|
+
- **Advanced Capabilities**
|
|
61
|
+
- Ground your queries with built-in [Google Search](https://ai.google.dev/gemini-api/docs/grounding) for real-time information
|
|
62
|
+
- Conversation checkpointing to save and resume complex sessions
|
|
63
|
+
- Custom context files (GEMINI.md) to tailor behavior for your projects
|
|
49
64
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
65
|
+
- **🔗 GitHub Integration**
|
|
66
|
+
- Use the Gemini CLI GitHub Action for automated PR reviews
|
|
67
|
+
- Automated issue triage and on-demand AI assistance directly in your repositories
|
|
68
|
+
- Seamless integration with your GitHub workflows
|
|
53
69
|
|
|
54
|
-
|
|
70
|
+
## 🔐 Authentication Options
|
|
55
71
|
|
|
56
|
-
|
|
57
|
-
gemini
|
|
58
|
-
```
|
|
72
|
+
Choose the authentication method that best fits your needs:
|
|
59
73
|
|
|
60
|
-
###
|
|
74
|
+
### Option 1: OAuth login (Using your Google Account)
|
|
61
75
|
|
|
62
|
-
|
|
63
|
-
4. **Authenticate:** When prompted, sign in with your personal Google account. This will grant you up to 60 model requests per minute and 1,000 model requests per day using Gemini.
|
|
76
|
+
**✨ Best for:** Individual developers as well as anyone who has a Gemini Code Assist License. (see [quota limits and terms of service](https://cloud.google.com/gemini/docs/quotas) for details)
|
|
64
77
|
|
|
65
|
-
|
|
78
|
+
**Benefits:**
|
|
66
79
|
|
|
67
|
-
|
|
80
|
+
- **Free tier**: 60 requests/min and 1,000 requests/day
|
|
81
|
+
- **Gemini 2.5 Pro** with 1M token context window
|
|
82
|
+
- **No API key management** - just sign in with your Google account
|
|
83
|
+
- **Automatic updates** to latest models
|
|
68
84
|
|
|
69
|
-
|
|
85
|
+
#### Start Gemini CLI, then choose OAuth and follow the browser authentication flow when prompted
|
|
70
86
|
|
|
71
|
-
|
|
72
|
-
|
|
87
|
+
```bash
|
|
88
|
+
gemini
|
|
89
|
+
```
|
|
73
90
|
|
|
74
|
-
|
|
75
|
-
export GEMINI_API_KEY="YOUR_API_KEY"
|
|
76
|
-
```
|
|
91
|
+
#### If you are using a paid Code Assist License from your organization, remember to set the Google Cloud Project
|
|
77
92
|
|
|
78
|
-
|
|
93
|
+
```bash
|
|
94
|
+
# Set your Google Cloud Project
|
|
95
|
+
export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_NAME"
|
|
96
|
+
gemini
|
|
97
|
+
```
|
|
79
98
|
|
|
80
|
-
###
|
|
99
|
+
### Option 2: Gemini API Key
|
|
81
100
|
|
|
82
|
-
|
|
101
|
+
**✨ Best for:** Developers who need specific model control or paid tier access
|
|
83
102
|
|
|
84
|
-
|
|
85
|
-
2. Set it as an environment variable in your terminal. Replace `YOUR_API_KEY` with your generated key and set GOOGLE_GENAI_USE_VERTEXAI to true
|
|
103
|
+
**Benefits:**
|
|
86
104
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
```
|
|
105
|
+
- **Free tier**: 100 requests/day with Gemini 2.5 Pro
|
|
106
|
+
- **Model selection**: Choose specific Gemini models
|
|
107
|
+
- **Usage-based billing**: Upgrade for higher limits when needed
|
|
91
108
|
|
|
92
|
-
|
|
109
|
+
```bash
|
|
110
|
+
# Get your key from https://aistudio.google.com/apikey
|
|
111
|
+
export GEMINI_API_KEY="YOUR_API_KEY"
|
|
112
|
+
gemini
|
|
113
|
+
```
|
|
93
114
|
|
|
94
|
-
|
|
115
|
+
### Option 3: Vertex AI
|
|
95
116
|
|
|
96
|
-
|
|
117
|
+
**✨ Best for:** Enterprise teams and production workloads
|
|
97
118
|
|
|
98
|
-
|
|
119
|
+
**Benefits:**
|
|
99
120
|
|
|
100
|
-
|
|
121
|
+
- **Enterprise features**: Advanced security and compliance
|
|
122
|
+
- **Scalable**: Higher rate limits with billing account
|
|
123
|
+
- **Integration**: Works with existing Google Cloud infrastructure
|
|
101
124
|
|
|
102
|
-
```
|
|
103
|
-
|
|
125
|
+
```bash
|
|
126
|
+
# Get your key from Google Cloud Console
|
|
127
|
+
export GOOGLE_API_KEY="YOUR_API_KEY"
|
|
128
|
+
export GOOGLE_GENAI_USE_VERTEXAI=true
|
|
104
129
|
gemini
|
|
105
|
-
> Write me a Gemini Discord bot that answers questions using a FAQ.md file I will provide
|
|
106
130
|
```
|
|
107
131
|
|
|
108
|
-
|
|
132
|
+
For Google Workspace accounts and other authentication methods, see the [authentication guide](./docs/cli/authentication.md).
|
|
133
|
+
|
|
134
|
+
## 🚀 Getting Started
|
|
135
|
+
|
|
136
|
+
### Basic Usage
|
|
137
|
+
|
|
138
|
+
#### Start in current directory
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
gemini
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
#### Include multiple directories
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
gemini --include-directories ../lib,../docs
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
#### Use specific model
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
gemini -m gemini-2.5-flash
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
#### Non-interactive mode for scripts
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
gemini -p "Explain the architecture of this codebase"
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Quick Examples
|
|
163
|
+
|
|
164
|
+
#### Start a new project
|
|
165
|
+
|
|
166
|
+
````bash
|
|
167
|
+
cd new-project/
|
|
168
|
+
gemini
|
|
169
|
+
> Write me a Discord bot that answers questions using a FAQ.md file I will provide
|
|
109
170
|
|
|
110
|
-
|
|
171
|
+
#### Analyze existing code
|
|
172
|
+
```bash
|
|
111
173
|
git clone https://github.com/google-gemini/gemini-cli
|
|
112
174
|
cd gemini-cli
|
|
113
175
|
gemini
|
|
114
176
|
> Give me a summary of all of the changes that went in yesterday
|
|
115
|
-
|
|
177
|
+
````
|
|
116
178
|
|
|
117
|
-
|
|
179
|
+
## 🔗 GitHub Integration
|
|
118
180
|
|
|
119
|
-
|
|
120
|
-
- Explore the available **[CLI Commands](./docs/cli/commands.md)**.
|
|
121
|
-
- If you encounter any issues, review the **[troubleshooting guide](./docs/troubleshooting.md)**.
|
|
122
|
-
- For more comprehensive documentation, see the [full documentation](./docs/index.md).
|
|
123
|
-
- Take a look at some [popular tasks](#popular-tasks) for more inspiration.
|
|
124
|
-
- Check out our **[Official Roadmap](./ROADMAP.md)**
|
|
181
|
+
Integrate Gemini CLI directly into your GitHub workflows with the [**Gemini CLI GitHub Action**](https://github.com/google-github-actions/run-gemini-cli). Key features include:
|
|
125
182
|
|
|
126
|
-
|
|
183
|
+
- **Pull Request Reviews**: Automatically review pull requests when they're opened.
|
|
184
|
+
- **Issue Triage**: Automatically triage and label GitHub issues.
|
|
185
|
+
- **On-demand Collaboration**: Mention `@gemini-cli` in issues and pull requests for assistance and task delegation.
|
|
186
|
+
- **Custom Workflows**: Set up your own scheduled tasks and event-driven automations.
|
|
127
187
|
|
|
128
|
-
|
|
129
|
-
having issues.
|
|
188
|
+
## 📚 Documentation
|
|
130
189
|
|
|
131
|
-
|
|
190
|
+
### Getting Started
|
|
132
191
|
|
|
133
|
-
|
|
192
|
+
- [**Quickstart Guide**](./docs/cli/index.md) - Get up and running quickly
|
|
193
|
+
- [**Authentication Setup**](./docs/cli/authentication.md) - Detailed auth configuration
|
|
194
|
+
- [**Configuration Guide**](./docs/cli/configuration.md) - Settings and customization
|
|
195
|
+
- [**Keyboard Shortcuts**](./docs/keyboard-shortcuts.md) - Productivity tips
|
|
134
196
|
|
|
135
|
-
|
|
197
|
+
### Core Features
|
|
136
198
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
199
|
+
- [**Commands Reference**](./docs/cli/commands.md) - All slash commands (`/help`, `/chat`, `/mcp`, etc.)
|
|
200
|
+
- [**Checkpointing**](./docs/checkpointing.md) - Save and resume conversations
|
|
201
|
+
- [**Memory Management**](./docs/tools/memory.md) - Using GEMINI.md context files
|
|
202
|
+
- [**Token Caching**](./docs/cli/token-caching.md) - Optimize token usage
|
|
140
203
|
|
|
141
|
-
|
|
142
|
-
> What security mechanisms are in place?
|
|
143
|
-
```
|
|
204
|
+
### Tools & Extensions
|
|
144
205
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
206
|
+
- [**Built-in Tools Overview**](./docs/tools/index.md)
|
|
207
|
+
- [File System Operations](./docs/tools/file-system.md)
|
|
208
|
+
- [Shell Commands](./docs/tools/shell.md)
|
|
209
|
+
- [Web Fetch & Search](./docs/tools/web-fetch.md)
|
|
210
|
+
- [Multi-file Operations](./docs/tools/multi-file.md)
|
|
211
|
+
- [**MCP Server Integration**](./docs/tools/mcp-server.md) - Extend with custom tools
|
|
212
|
+
- [**Custom Extensions**](./docs/extension.md) - Build your own commands
|
|
148
213
|
|
|
149
|
-
|
|
150
|
-
> Summarize this codebase and highlight the most interesting patterns or techniques I could learn from.
|
|
151
|
-
```
|
|
214
|
+
### Advanced Topics
|
|
152
215
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
216
|
+
- [**Architecture Overview**](./docs/architecture.md) - How Gemini CLI works
|
|
217
|
+
- [**IDE Integration**](./docs/extension.md) - VS Code companion
|
|
218
|
+
- [**Sandboxing & Security**](./docs/sandbox.md) - Safe execution environments
|
|
219
|
+
- [**Enterprise Deployment**](./docs/deployment.md) - Docker, system-wide config
|
|
220
|
+
- [**Telemetry & Monitoring**](./docs/telemetry.md) - Usage tracking
|
|
221
|
+
- [**Tools API Development**](./docs/core/tools-api.md) - Create custom tools
|
|
156
222
|
|
|
157
|
-
|
|
158
|
-
> Which parts of this codebase might be challenging to scale or debug?
|
|
159
|
-
```
|
|
223
|
+
### Configuration & Customization
|
|
160
224
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
225
|
+
- [**Settings Reference**](./docs/cli/configuration.md) - All configuration options
|
|
226
|
+
- [**Theme Customization**](./docs/cli/themes.md) - Visual customization
|
|
227
|
+
- [**.gemini Directory**](./docs/gemini-ignore.md) - Project-specific settings
|
|
228
|
+
- [**Environment Variables**](./docs/cli/configuration.md#environment-variables)
|
|
164
229
|
|
|
165
|
-
|
|
166
|
-
> What kind of error handling and logging strategies does the project use?
|
|
167
|
-
```
|
|
230
|
+
### Troubleshooting & Support
|
|
168
231
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
232
|
+
- [**Troubleshooting Guide**](./docs/troubleshooting.md) - Common issues and solutions
|
|
233
|
+
- [**FAQ**](./docs/troubleshooting.md#frequently-asked-questions) - Quick answers
|
|
234
|
+
- Use `/bug` command to report issues directly from the CLI
|
|
172
235
|
|
|
173
|
-
###
|
|
236
|
+
### Using MCP Servers
|
|
174
237
|
|
|
175
|
-
|
|
176
|
-
> Implement a first draft for GitHub issue #123.
|
|
177
|
-
```
|
|
238
|
+
Configure MCP servers in `~/.gemini/settings.json` to extend Gemini CLI with custom tools:
|
|
178
239
|
|
|
179
240
|
```text
|
|
180
|
-
>
|
|
241
|
+
> @github List my open pull requests
|
|
242
|
+
> @slack Send a summary of today's commits to #dev channel
|
|
243
|
+
> @database Run a query to find inactive users
|
|
181
244
|
```
|
|
182
245
|
|
|
183
|
-
|
|
246
|
+
See the [MCP Server Integration guide](./docs/tools/mcp-server.md) for setup instructions.
|
|
184
247
|
|
|
185
|
-
|
|
248
|
+
## 🤝 Contributing
|
|
186
249
|
|
|
187
|
-
|
|
188
|
-
> Make me a slide deck showing the git history from the last 7 days, grouped by feature and team member.
|
|
189
|
-
```
|
|
250
|
+
We welcome contributions! Gemini CLI is fully open source (Apache 2.0), and we encourage the community to:
|
|
190
251
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
252
|
+
- Report bugs and suggest features
|
|
253
|
+
- Improve documentation
|
|
254
|
+
- Submit code improvements
|
|
255
|
+
- Share your MCP servers and extensions
|
|
194
256
|
|
|
195
|
-
|
|
257
|
+
See our [Contributing Guide](./CONTRIBUTING.md) for development setup, coding standards, and how to submit pull requests.
|
|
196
258
|
|
|
197
|
-
|
|
198
|
-
> Convert all the images in this directory to png, and rename them to use dates from the exif data.
|
|
199
|
-
```
|
|
259
|
+
Check our [Official Roadmap](https://github.com/orgs/google-gemini/projects/11/) for planned features and priorities.
|
|
200
260
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
261
|
+
## 📖 Resources
|
|
262
|
+
|
|
263
|
+
- **[Official Roadmap](./ROADMAP.md)** - See what's coming next
|
|
264
|
+
- **[NPM Package](https://www.npmjs.com/package/@google/gemini-cli)** - Package registry
|
|
265
|
+
- **[GitHub Issues](https://github.com/google-gemini/gemini-cli/issues)** - Report bugs or request features
|
|
266
|
+
- **[Security Advisories](https://github.com/google-gemini/gemini-cli/security/advisories)** - Security updates
|
|
204
267
|
|
|
205
268
|
### Uninstall
|
|
206
269
|
|
|
207
|
-
|
|
270
|
+
See the [Uninstall Guide](docs/Uninstall.md) for removal instructions.
|
|
208
271
|
|
|
209
|
-
##
|
|
272
|
+
## 📄 Legal
|
|
210
273
|
|
|
211
|
-
|
|
274
|
+
- **License**: [Apache License 2.0](LICENSE)
|
|
275
|
+
- **Terms of Service**: [Terms & Privacy](./docs/tos-privacy.md)
|
|
276
|
+
- **Security**: [Security Policy](SECURITY.md)
|
|
212
277
|
|
|
213
|
-
|
|
278
|
+
---
|
|
214
279
|
|
|
215
|
-
|
|
280
|
+
<p align="center">
|
|
281
|
+
Built with ❤️ by Google and the open source community
|
|
282
|
+
</p>
|
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -5,3 +5,5 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export * from './src/index.js';
|
|
7
7
|
export { DEFAULT_GEMINI_MODEL, DEFAULT_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_EMBEDDING_MODEL, } from './src/config/models.js';
|
|
8
|
+
export { logIdeConnection } from './src/telemetry/loggers.js';
|
|
9
|
+
export { IdeConnectionEvent, IdeConnectionType, } from './src/telemetry/types.js';
|
package/dist/index.js
CHANGED
|
@@ -5,4 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export * from './src/index.js';
|
|
7
7
|
export { DEFAULT_GEMINI_MODEL, DEFAULT_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_EMBEDDING_MODEL, } from './src/config/models.js';
|
|
8
|
+
export { logIdeConnection } from './src/telemetry/loggers.js';
|
|
9
|
+
export { IdeConnectionEvent, IdeConnectionType, } from './src/telemetry/types.js';
|
|
8
10
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,8BAA8B,GAC/B,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,8BAA8B,GAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EACL,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,0BAA0B,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { Content, GenerateContentParameters, CountTokensParameters, CountTokensResponse, GenerateContentResponse, GenerationConfigRoutingConfig, MediaResolution, Candidate, ModelSelectionConfig, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, SafetySetting,
|
|
6
|
+
import { Content, ContentListUnion, GenerateContentParameters, CountTokensParameters, CountTokensResponse, GenerateContentResponse, GenerationConfigRoutingConfig, MediaResolution, Candidate, ModelSelectionConfig, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, SafetySetting, SpeechConfigUnion, ThinkingConfig, ToolListUnion, ToolConfig } from '@google/genai';
|
|
7
7
|
export interface CAGenerateContentRequest {
|
|
8
8
|
model: string;
|
|
9
9
|
project?: string;
|
|
@@ -34,7 +34,7 @@ interface VertexGenerationConfig {
|
|
|
34
34
|
frequencyPenalty?: number;
|
|
35
35
|
seed?: number;
|
|
36
36
|
responseMimeType?: string;
|
|
37
|
-
|
|
37
|
+
responseJsonSchema?: unknown;
|
|
38
38
|
routingConfig?: GenerationConfigRoutingConfig;
|
|
39
39
|
modelSelectionConfig?: ModelSelectionConfig;
|
|
40
40
|
responseModalities?: string[];
|
|
@@ -66,4 +66,5 @@ export declare function toCountTokenRequest(req: CountTokensParameters): CaCount
|
|
|
66
66
|
export declare function fromCountTokenResponse(res: CaCountTokenResponse): CountTokensResponse;
|
|
67
67
|
export declare function toGenerateContentRequest(req: GenerateContentParameters, userPromptId: string, project?: string, sessionId?: string): CAGenerateContentRequest;
|
|
68
68
|
export declare function fromGenerateContentResponse(res: CaGenerateContentResponse): GenerateContentResponse;
|
|
69
|
+
export declare function toContents(contents: ContentListUnion): Content[];
|
|
69
70
|
export {};
|
|
@@ -47,7 +47,7 @@ function toVertexGenerateContentRequest(req, sessionId) {
|
|
|
47
47
|
session_id: sessionId,
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
function toContents(contents) {
|
|
50
|
+
export function toContents(contents) {
|
|
51
51
|
if (Array.isArray(contents)) {
|
|
52
52
|
// it's a Content[] or a PartsUnion[]
|
|
53
53
|
return contents.map(toContent);
|
|
@@ -113,7 +113,7 @@ function toVertexGenerationConfig(config) {
|
|
|
113
113
|
frequencyPenalty: config.frequencyPenalty,
|
|
114
114
|
seed: config.seed,
|
|
115
115
|
responseMimeType: config.responseMimeType,
|
|
116
|
-
|
|
116
|
+
responseJsonSchema: config.responseJsonSchema,
|
|
117
117
|
routingConfig: config.routingConfig,
|
|
118
118
|
modelSelectionConfig: config.modelSelectionConfig,
|
|
119
119
|
responseModalities: config.responseModalities,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../../../src/code_assist/converter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAQL,uBAAuB,
|
|
1
|
+
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../../../src/code_assist/converter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAQL,uBAAuB,GAcxB,MAAM,eAAe,C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
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { describe, it, expect } from 'vitest';
|
|
7
|
-
import { toGenerateContentRequest, fromGenerateContentResponse, } from './converter.js';
|
|
7
|
+
import { toGenerateContentRequest, fromGenerateContentResponse, toContents, } from './converter.js';
|
|
8
8
|
import { GenerateContentResponse, FinishReason, BlockedReason, } from '@google/genai';
|
|
9
9
|
describe('converter', () => {
|
|
10
10
|
describe('toCodeAssistRequest', () => {
|
|
@@ -228,5 +228,52 @@ describe('converter', () => {
|
|
|
228
228
|
expect(genaiRes.automaticFunctionCallingHistory).toEqual(codeAssistRes.response.automaticFunctionCallingHistory);
|
|
229
229
|
});
|
|
230
230
|
});
|
|
231
|
+
describe('toContents', () => {
|
|
232
|
+
it('should handle Content', () => {
|
|
233
|
+
const content = {
|
|
234
|
+
role: 'user',
|
|
235
|
+
parts: [{ text: 'hello' }],
|
|
236
|
+
};
|
|
237
|
+
expect(toContents(content)).toEqual([
|
|
238
|
+
{ role: 'user', parts: [{ text: 'hello' }] },
|
|
239
|
+
]);
|
|
240
|
+
});
|
|
241
|
+
it('should handle array of Contents', () => {
|
|
242
|
+
const contents = [
|
|
243
|
+
{ role: 'user', parts: [{ text: 'hello' }] },
|
|
244
|
+
{ role: 'model', parts: [{ text: 'hi' }] },
|
|
245
|
+
];
|
|
246
|
+
expect(toContents(contents)).toEqual([
|
|
247
|
+
{ role: 'user', parts: [{ text: 'hello' }] },
|
|
248
|
+
{ role: 'model', parts: [{ text: 'hi' }] },
|
|
249
|
+
]);
|
|
250
|
+
});
|
|
251
|
+
it('should handle Part', () => {
|
|
252
|
+
const part = { text: 'a part' };
|
|
253
|
+
expect(toContents(part)).toEqual([
|
|
254
|
+
{ role: 'user', parts: [{ text: 'a part' }] },
|
|
255
|
+
]);
|
|
256
|
+
});
|
|
257
|
+
it('should handle array of Parts', () => {
|
|
258
|
+
const parts = [{ text: 'part 1' }, 'part 2'];
|
|
259
|
+
expect(toContents(parts)).toEqual([
|
|
260
|
+
{ role: 'user', parts: [{ text: 'part 1' }] },
|
|
261
|
+
{ role: 'user', parts: [{ text: 'part 2' }] },
|
|
262
|
+
]);
|
|
263
|
+
});
|
|
264
|
+
it('should handle string', () => {
|
|
265
|
+
const str = 'a string';
|
|
266
|
+
expect(toContents(str)).toEqual([
|
|
267
|
+
{ role: 'user', parts: [{ text: 'a string' }] },
|
|
268
|
+
]);
|
|
269
|
+
});
|
|
270
|
+
it('should handle array of strings', () => {
|
|
271
|
+
const strings = ['string 1', 'string 2'];
|
|
272
|
+
expect(toContents(strings)).toEqual([
|
|
273
|
+
{ role: 'user', parts: [{ text: 'string 1' }] },
|
|
274
|
+
{ role: 'user', parts: [{ text: 'string 2' }] },
|
|
275
|
+
]);
|
|
276
|
+
});
|
|
277
|
+
});
|
|
231
278
|
});
|
|
232
279
|
//# sourceMappingURL=converter.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converter.test.js","sourceRoot":"","sources":["../../../src/code_assist/converter.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,wBAAwB,EACxB,2BAA2B,
|
|
1
|
+
{"version":3,"file":"converter.test.js","sourceRoot":"","sources":["../../../src/code_assist/converter.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAE3B,UAAU,GACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAGL,uBAAuB,EACvB,YAAY,EACZ,aAAa,GACd,MAAM,eAAe,CAAC;AAEvB,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,QAAQ,CAAC,qBAAqB,EAAE,GAA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AAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -295,7 +295,7 @@ async function cacheCredentials(credentials) {
|
|
|
295
295
|
const filePath = getCachedCredentialPath();
|
|
296
296
|
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
297
297
|
const credString = JSON.stringify(credentials, null, 2);
|
|
298
|
-
await fs.writeFile(filePath, credString);
|
|
298
|
+
await fs.writeFile(filePath, credString, { mode: 0o600 });
|
|
299
299
|
}
|
|
300
300
|
function getCachedCredentialPath() {
|
|
301
301
|
return path.join(os.homedir(), GEMINI_DIR, CREDENTIAL_FILENAME);
|