@google/gemini-cli 0.1.18 → 0.1.19-nightly.250813.9d023be1
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/package.json +4 -2
- package/dist/src/acp/acpPeer.js +72 -64
- package/dist/src/acp/acpPeer.js.map +1 -1
- package/dist/src/commands/mcp/add.d.ts +7 -0
- package/dist/src/commands/mcp/add.js +155 -0
- package/dist/src/commands/mcp/add.js.map +1 -0
- package/dist/src/commands/mcp/list.d.ts +8 -0
- package/dist/src/commands/mcp/list.js +110 -0
- package/dist/src/commands/mcp/list.js.map +1 -0
- package/dist/src/commands/mcp/remove.d.ts +7 -0
- package/dist/src/commands/mcp/remove.js +44 -0
- package/dist/src/commands/mcp/remove.js.map +1 -0
- package/dist/src/commands/mcp.d.ts +7 -0
- package/dist/src/commands/mcp.js +23 -0
- package/dist/src/commands/mcp.js.map +1 -0
- package/dist/src/config/config.d.ts +1 -2
- package/dist/src/config/config.js +114 -52
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/keyBindings.d.ts +66 -0
- package/dist/src/config/keyBindings.js +136 -0
- package/dist/src/config/keyBindings.js.map +1 -0
- package/dist/src/config/settings.d.ts +3 -50
- package/dist/src/config/settings.js +17 -1
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/config/settingsSchema.d.ts +488 -0
- package/dist/src/config/settingsSchema.js +461 -0
- package/dist/src/config/settingsSchema.js.map +1 -0
- package/dist/src/gemini.js +9 -28
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +1 -1
- package/dist/src/generated/git-commit.js +1 -1
- package/dist/src/nonInteractiveCli.js +0 -1
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.js +3 -2
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/ui/App.js +107 -36
- package/dist/src/ui/App.js.map +1 -1
- package/dist/src/ui/IdeIntegrationNudge.d.ts +16 -0
- package/dist/src/ui/IdeIntegrationNudge.js +52 -0
- package/dist/src/ui/IdeIntegrationNudge.js.map +1 -0
- package/dist/src/ui/commands/chatCommand.js +15 -0
- package/dist/src/ui/commands/chatCommand.js.map +1 -1
- package/dist/src/ui/commands/ideCommand.js +59 -5
- package/dist/src/ui/commands/ideCommand.js.map +1 -1
- package/dist/src/ui/commands/settingsCommand.d.ts +7 -0
- package/dist/src/ui/commands/settingsCommand.js +16 -0
- package/dist/src/ui/commands/settingsCommand.js.map +1 -0
- package/dist/src/ui/commands/setupGithubCommand.js +86 -19
- package/dist/src/ui/commands/setupGithubCommand.js.map +1 -1
- package/dist/src/ui/commands/types.d.ts +13 -2
- package/dist/src/ui/commands/types.js.map +1 -1
- package/dist/src/ui/components/AsciiArt.d.ts +1 -0
- package/dist/src/ui/components/AsciiArt.js +10 -0
- package/dist/src/ui/components/AsciiArt.js.map +1 -1
- package/dist/src/ui/components/AuthDialog.js +5 -4
- package/dist/src/ui/components/AuthDialog.js.map +1 -1
- package/dist/src/ui/components/AuthInProgress.js +6 -5
- package/dist/src/ui/components/AuthInProgress.js.map +1 -1
- package/dist/src/ui/components/ContextSummaryDisplay.js +21 -24
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/ContextUsageDisplay.d.ts +9 -0
- package/dist/src/ui/components/ContextUsageDisplay.js +14 -0
- package/dist/src/ui/components/ContextUsageDisplay.js.map +1 -0
- package/dist/src/ui/components/DebugProfiler.js +5 -4
- package/dist/src/ui/components/DebugProfiler.js.map +1 -1
- package/dist/src/ui/components/EditorSettingsDialog.js +6 -5
- package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -1
- package/dist/src/ui/components/FolderTrustDialog.d.ts +16 -0
- package/dist/src/ui/components/FolderTrustDialog.js +39 -0
- package/dist/src/ui/components/FolderTrustDialog.js.map +1 -0
- package/dist/src/ui/components/Footer.js +14 -5
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/Header.d.ts +0 -1
- package/dist/src/ui/components/Header.js +13 -5
- package/dist/src/ui/components/Header.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.d.ts +1 -0
- package/dist/src/ui/components/InputPrompt.js +90 -34
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/LoadingIndicator.js +10 -5
- package/dist/src/ui/components/LoadingIndicator.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.d.ts +14 -0
- package/dist/src/ui/components/SettingsDialog.js +249 -0
- package/dist/src/ui/components/SettingsDialog.js.map +1 -0
- package/dist/src/ui/components/ShellConfirmationDialog.js +5 -4
- package/dist/src/ui/components/ShellConfirmationDialog.js.map +1 -1
- package/dist/src/ui/components/SuggestionsDisplay.js +1 -1
- package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -1
- package/dist/src/ui/components/ThemeDialog.js +10 -20
- package/dist/src/ui/components/ThemeDialog.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +34 -13
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.js +10 -8
- package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -1
- package/dist/src/ui/components/shared/text-buffer.d.ts +17 -4
- package/dist/src/ui/components/shared/text-buffer.js +224 -70
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/components/shared/vim-buffer-actions.js +137 -151
- package/dist/src/ui/components/shared/vim-buffer-actions.js.map +1 -1
- package/dist/src/ui/contexts/SettingsContext.d.ts +9 -0
- package/dist/src/ui/contexts/SettingsContext.js +15 -0
- package/dist/src/ui/contexts/SettingsContext.js.map +1 -0
- package/dist/src/ui/hooks/atCommandProcessor.js +7 -4
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +6 -2
- package/dist/src/ui/hooks/slashCommandProcessor.js +34 -3
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useAtCompletion.js +4 -1
- package/dist/src/ui/hooks/useAtCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js +5 -5
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +1 -1
- package/dist/src/ui/hooks/useFolderTrust.d.ts +11 -0
- package/dist/src/ui/hooks/useFolderTrust.js +22 -0
- package/dist/src/ui/hooks/useFolderTrust.js.map +1 -0
- package/dist/src/ui/hooks/useGeminiStream.d.ts +2 -1
- package/dist/src/ui/hooks/useGeminiStream.js +33 -19
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.js +2 -2
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
- package/dist/src/ui/hooks/useReactToolScheduler.d.ts +1 -1
- package/dist/src/ui/hooks/useReactToolScheduler.js +15 -15
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -1
- package/dist/src/ui/hooks/useSettingsCommand.d.ts +10 -0
- package/dist/src/ui/hooks/useSettingsCommand.js +21 -0
- package/dist/src/ui/hooks/useSettingsCommand.js.map +1 -0
- package/dist/src/ui/keyMatchers.d.ts +26 -0
- package/dist/src/ui/keyMatchers.js +68 -0
- package/dist/src/ui/keyMatchers.js.map +1 -0
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js +5 -4
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js.map +1 -1
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js +5 -4
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js.map +1 -1
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js +5 -4
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js.map +1 -1
- package/dist/src/ui/semantic-colors.d.ts +7 -0
- package/dist/src/ui/semantic-colors.js +24 -0
- package/dist/src/ui/semantic-colors.js.map +1 -0
- package/dist/src/ui/themes/ansi-light.js +2 -1
- package/dist/src/ui/themes/ansi-light.js.map +1 -1
- package/dist/src/ui/themes/ansi.js +2 -1
- package/dist/src/ui/themes/ansi.js.map +1 -1
- package/dist/src/ui/themes/atom-one-dark.js +2 -1
- package/dist/src/ui/themes/atom-one-dark.js.map +1 -1
- package/dist/src/ui/themes/ayu-light.js +2 -1
- package/dist/src/ui/themes/ayu-light.js.map +1 -1
- package/dist/src/ui/themes/ayu.js +2 -1
- package/dist/src/ui/themes/ayu.js.map +1 -1
- package/dist/src/ui/themes/default-light.js +2 -1
- package/dist/src/ui/themes/default-light.js.map +1 -1
- package/dist/src/ui/themes/default.js +2 -1
- package/dist/src/ui/themes/default.js.map +1 -1
- package/dist/src/ui/themes/dracula.js +2 -1
- package/dist/src/ui/themes/dracula.js.map +1 -1
- package/dist/src/ui/themes/github-dark.js +2 -1
- package/dist/src/ui/themes/github-dark.js.map +1 -1
- package/dist/src/ui/themes/github-light.js +2 -1
- package/dist/src/ui/themes/github-light.js.map +1 -1
- package/dist/src/ui/themes/googlecode.js +2 -1
- package/dist/src/ui/themes/googlecode.js.map +1 -1
- package/dist/src/ui/themes/no-color.js +30 -1
- package/dist/src/ui/themes/no-color.js.map +1 -1
- package/dist/src/ui/themes/semantic-tokens.d.ts +37 -0
- package/dist/src/ui/themes/semantic-tokens.js +94 -0
- package/dist/src/ui/themes/semantic-tokens.js.map +1 -0
- package/dist/src/ui/themes/shades-of-purple.js +2 -1
- package/dist/src/ui/themes/shades-of-purple.js.map +1 -1
- package/dist/src/ui/themes/theme-manager.d.ts +6 -0
- package/dist/src/ui/themes/theme-manager.js +7 -0
- package/dist/src/ui/themes/theme-manager.js.map +1 -1
- package/dist/src/ui/themes/theme.d.ts +45 -2
- package/dist/src/ui/themes/theme.js +92 -107
- package/dist/src/ui/themes/theme.js.map +1 -1
- package/dist/src/ui/themes/xcode.js +2 -1
- package/dist/src/ui/themes/xcode.js.map +1 -1
- package/dist/src/ui/types.d.ts +1 -1
- package/dist/src/ui/utils/CodeColorizer.d.ts +2 -1
- package/dist/src/ui/utils/CodeColorizer.js +4 -3
- package/dist/src/ui/utils/CodeColorizer.js.map +1 -1
- package/dist/src/ui/utils/ConsolePatcher.d.ts +1 -0
- package/dist/src/ui/utils/ConsolePatcher.js +3 -0
- package/dist/src/ui/utils/ConsolePatcher.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.js +4 -2
- package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -1
- package/dist/src/ui/utils/commandUtils.d.ts +1 -0
- package/dist/src/ui/utils/commandUtils.js +22 -1
- package/dist/src/ui/utils/commandUtils.js.map +1 -1
- package/dist/src/ui/utils/isNarrowWidth.d.ts +6 -0
- package/dist/src/ui/utils/isNarrowWidth.js +9 -0
- package/dist/src/ui/utils/isNarrowWidth.js.map +1 -0
- package/dist/src/utils/cleanup.d.ts +2 -2
- package/dist/src/utils/cleanup.js +2 -2
- package/dist/src/utils/cleanup.js.map +1 -1
- package/dist/src/utils/dialogScopeUtils.d.ts +31 -0
- package/dist/src/utils/dialogScopeUtils.js +48 -0
- package/dist/src/utils/dialogScopeUtils.js.map +1 -0
- package/dist/src/utils/gitUtils.d.ts +21 -1
- package/dist/src/utils/gitUtils.js +68 -3
- package/dist/src/utils/gitUtils.js.map +1 -1
- package/dist/src/utils/sandbox.js +426 -405
- package/dist/src/utils/sandbox.js.map +1 -1
- package/dist/src/utils/settingsUtils.d.ts +126 -0
- package/dist/src/utils/settingsUtils.js +327 -0
- package/dist/src/utils/settingsUtils.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -3
- package/dist/google-gemini-cli-0.1.17.tgz +0 -0
- package/dist/src/ui/components/IDEContextDetailDisplay.d.ts +0 -12
- package/dist/src/ui/components/IDEContextDetailDisplay.js +0 -12
- package/dist/src/ui/components/IDEContextDetailDisplay.js.map +0 -1
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>
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@google/gemini-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19-nightly.250813.9d023be1",
|
|
4
4
|
"description": "Gemini CLI",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,12 +25,13 @@
|
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
27
|
"config": {
|
|
28
|
-
"sandboxImageUri": "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.1.
|
|
28
|
+
"sandboxImageUri": "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.1.19-nightly.250813.9d023be1"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@google/gemini-cli-core": "file:../core",
|
|
32
32
|
"@google/genai": "1.9.0",
|
|
33
33
|
"@iarna/toml": "^2.2.5",
|
|
34
|
+
"@modelcontextprotocol/sdk": "^1.15.1",
|
|
34
35
|
"@types/update-notifier": "^6.0.8",
|
|
35
36
|
"command-exists": "^1.2.9",
|
|
36
37
|
"diff": "^7.0.0",
|
|
@@ -52,6 +53,7 @@
|
|
|
52
53
|
"string-width": "^7.1.0",
|
|
53
54
|
"strip-ansi": "^7.1.0",
|
|
54
55
|
"strip-json-comments": "^3.1.1",
|
|
56
|
+
"undici": "^7.10.0",
|
|
55
57
|
"update-notifier": "^7.3.1",
|
|
56
58
|
"yargs": "^17.7.2",
|
|
57
59
|
"zod": "^3.23.8"
|
package/dist/src/acp/acpPeer.js
CHANGED
|
@@ -167,53 +167,54 @@ class GeminiAgent {
|
|
|
167
167
|
if (!tool) {
|
|
168
168
|
return errorResponse(new Error(`Tool "${fc.name}" not found in registry.`));
|
|
169
169
|
}
|
|
170
|
-
let toolCallId;
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
if (confirmationDetails
|
|
175
|
-
content =
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
170
|
+
let toolCallId = undefined;
|
|
171
|
+
try {
|
|
172
|
+
const invocation = tool.build(args);
|
|
173
|
+
const confirmationDetails = await invocation.shouldConfirmExecute(abortSignal);
|
|
174
|
+
if (confirmationDetails) {
|
|
175
|
+
let content = null;
|
|
176
|
+
if (confirmationDetails.type === 'edit') {
|
|
177
|
+
content = {
|
|
178
|
+
type: 'diff',
|
|
179
|
+
path: confirmationDetails.fileName,
|
|
180
|
+
oldText: confirmationDetails.originalContent,
|
|
181
|
+
newText: confirmationDetails.newContent,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
const result = await this.client.requestToolCallConfirmation({
|
|
185
|
+
label: invocation.getDescription(),
|
|
186
|
+
icon: tool.icon,
|
|
187
|
+
content,
|
|
188
|
+
confirmation: toAcpToolCallConfirmation(confirmationDetails),
|
|
189
|
+
locations: invocation.toolLocations(),
|
|
190
|
+
});
|
|
191
|
+
await confirmationDetails.onConfirm(toToolCallOutcome(result.outcome));
|
|
192
|
+
switch (result.outcome) {
|
|
193
|
+
case 'reject':
|
|
194
|
+
return errorResponse(new Error(`Tool "${fc.name}" not allowed to run by the user.`));
|
|
195
|
+
case 'cancel':
|
|
196
|
+
return errorResponse(new Error(`Tool "${fc.name}" was canceled by the user.`));
|
|
197
|
+
case 'allow':
|
|
198
|
+
case 'alwaysAllow':
|
|
199
|
+
case 'alwaysAllowMcpServer':
|
|
200
|
+
case 'alwaysAllowTool':
|
|
201
|
+
break;
|
|
202
|
+
default: {
|
|
203
|
+
const resultOutcome = result.outcome;
|
|
204
|
+
throw new Error(`Unexpected: ${resultOutcome}`);
|
|
205
|
+
}
|
|
203
206
|
}
|
|
207
|
+
toolCallId = result.id;
|
|
204
208
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
}
|
|
215
|
-
try {
|
|
216
|
-
const toolResult = await tool.execute(args, abortSignal);
|
|
209
|
+
else {
|
|
210
|
+
const result = await this.client.pushToolCall({
|
|
211
|
+
icon: tool.icon,
|
|
212
|
+
label: invocation.getDescription(),
|
|
213
|
+
locations: invocation.toolLocations(),
|
|
214
|
+
});
|
|
215
|
+
toolCallId = result.id;
|
|
216
|
+
}
|
|
217
|
+
const toolResult = await invocation.execute(abortSignal);
|
|
217
218
|
const toolCallContent = toToolCallContent(toolResult);
|
|
218
219
|
await this.client.updateToolCall({
|
|
219
220
|
toolCallId,
|
|
@@ -234,11 +235,13 @@ class GeminiAgent {
|
|
|
234
235
|
}
|
|
235
236
|
catch (e) {
|
|
236
237
|
const error = e instanceof Error ? e : new Error(String(e));
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
238
|
+
if (toolCallId) {
|
|
239
|
+
await this.client.updateToolCall({
|
|
240
|
+
toolCallId,
|
|
241
|
+
status: 'error',
|
|
242
|
+
content: { type: 'markdown', markdown: error.message },
|
|
243
|
+
});
|
|
244
|
+
}
|
|
242
245
|
return errorResponse(error);
|
|
243
246
|
}
|
|
244
247
|
}
|
|
@@ -304,7 +307,7 @@ class GeminiAgent {
|
|
|
304
307
|
if (this.config.getEnableRecursiveFileSearch() && globTool) {
|
|
305
308
|
this.#debug(`Path ${pathName} not found directly, attempting glob search.`);
|
|
306
309
|
try {
|
|
307
|
-
const globResult = await globTool.
|
|
310
|
+
const globResult = await globTool.buildAndExecute({
|
|
308
311
|
pattern: `**/*${pathName}*`,
|
|
309
312
|
path: this.config.getTargetDir(),
|
|
310
313
|
}, abortSignal);
|
|
@@ -398,12 +401,15 @@ class GeminiAgent {
|
|
|
398
401
|
paths: pathSpecsToRead,
|
|
399
402
|
respectGitIgnore, // Use configuration setting
|
|
400
403
|
};
|
|
401
|
-
|
|
402
|
-
icon: readManyFilesTool.icon,
|
|
403
|
-
label: readManyFilesTool.getDescription(toolArgs),
|
|
404
|
-
});
|
|
404
|
+
let toolCallId = undefined;
|
|
405
405
|
try {
|
|
406
|
-
const
|
|
406
|
+
const invocation = readManyFilesTool.build(toolArgs);
|
|
407
|
+
const toolCall = await this.client.pushToolCall({
|
|
408
|
+
icon: readManyFilesTool.icon,
|
|
409
|
+
label: invocation.getDescription(),
|
|
410
|
+
});
|
|
411
|
+
toolCallId = toolCall.id;
|
|
412
|
+
const result = await invocation.execute(abortSignal);
|
|
407
413
|
const content = toToolCallContent(result) || {
|
|
408
414
|
type: 'markdown',
|
|
409
415
|
markdown: `Successfully read: ${contentLabelsForDisplay.join(', ')}`,
|
|
@@ -446,14 +452,16 @@ class GeminiAgent {
|
|
|
446
452
|
return processedQueryParts;
|
|
447
453
|
}
|
|
448
454
|
catch (error) {
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
455
|
+
if (toolCallId) {
|
|
456
|
+
await this.client.updateToolCall({
|
|
457
|
+
toolCallId,
|
|
458
|
+
status: 'error',
|
|
459
|
+
content: {
|
|
460
|
+
type: 'markdown',
|
|
461
|
+
markdown: `Error reading files (${contentLabelsForDisplay.join(', ')}): ${getErrorMessage(error)}`,
|
|
462
|
+
},
|
|
463
|
+
});
|
|
464
|
+
}
|
|
457
465
|
throw error;
|
|
458
466
|
}
|
|
459
467
|
}
|