You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: GEMINI.md
-2Lines changed: 0 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,7 +91,6 @@ Rather than relying on Java-esque private or public class members, which can be
91
91
TypeScript's power lies in its ability to provide static type checking, catching potential errors before your code runs. To fully leverage this, it's crucial to avoid the `any` type and be judicious with type assertions.
92
92
93
93
-**The Dangers of `any`**: Using any effectively opts out of TypeScript's type checking for that particular variable or expression. While it might seem convenient in the short term, it introduces significant risks:
94
-
95
94
-**Loss of Type Safety**: You lose all the benefits of type checking, making it easy to introduce runtime errors that TypeScript would otherwise have caught.
96
95
-**Reduced Readability and Maintainability**: Code with `any` types is harder to understand and maintain, as the expected type of data is no longer explicitly defined.
97
96
-**Masking Underlying Issues**: Often, the need for any indicates a deeper problem in the design of your code or the way you're interacting with external libraries. It's a sign that you might need to refine your types or refactor your code.
@@ -163,7 +162,6 @@ Design for a good user experience - Provide clear, minimal, and non-blocking UI
163
162
### Process
164
163
165
164
1. Analyze the user's code for optimization opportunities:
166
-
167
165
- Check for React anti-patterns that prevent compiler optimization
168
166
- Look for component structure issues that limit compiler effectiveness
169
167
- Think about each suggestion you are making and consult React docs for best practices
Copy file name to clipboardExpand all lines: docs/architecture.md
-2Lines changed: 0 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,6 @@ This document provides a high-level overview of the Gemini CLI's architecture.
7
7
The Gemini CLI is primarily composed of two main packages, along with a suite of tools that can be used by the system in the course of handling command-line input:
8
8
9
9
1.**CLI package (`packages/cli`):**
10
-
11
10
-**Purpose:** This contains the user-facing portion of the Gemini CLI, such as handling the initial user input, presenting the final output, and managing the overall user experience.
12
11
-**Key functions contained in the package:**
13
12
-[Input processing](./cli/commands.md)
@@ -17,7 +16,6 @@ The Gemini CLI is primarily composed of two main packages, along with a suite of
-**Purpose:** This acts as the backend for the Gemini CLI. It receives requests sent from `packages/cli`, orchestrates interactions with the Gemini API, and manages the execution of available tools.
22
20
-**Key functions contained in the package:**
23
21
- API client for communicating with the Google Gemini API
Copy file name to clipboardExpand all lines: docs/cli/authentication.md
-5Lines changed: 0 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,26 +3,22 @@
3
3
The Gemini CLI requires you to authenticate with Google's AI services. On initial startup you'll need to configure **one** of the following authentication methods:
4
4
5
5
1.**Login with Google (Gemini Code Assist):**
6
-
7
6
- Use this option to log in with your google account.
8
7
- During initial startup, Gemini CLI will direct you to a webpage for authentication. Once authenticated, your credentials will be cached locally so the web login can be skipped on subsequent runs.
9
8
- Note that the web login must be done in a browser that can communicate with the machine Gemini CLI is being run from. (Specifically, the browser will be redirected to a localhost url that Gemini CLI will be listening on).
10
9
- <aid="workspace-gca">Users may have to specify a GOOGLE_CLOUD_PROJECT if:</a>
11
-
12
10
1. You have a Google Workspace account. Google Workspace is a paid service for businesses and organizations that provides a suite of productivity tools, including a custom email domain (e.g. [email protected]), enhanced security features, and administrative controls. These accounts are often managed by an employer or school.
13
11
1. You have recieved a free Code Assist license through the [Google Developer Program](https://developers.google.com/program/plans-and-pricing) (including qualified Google Developer Experts)
14
12
1. You have been assigned a license to a current Gemini Code Assist standard or enterprise subscription.
15
13
1. You are using the product outside the the [supported regions](https://developers.google.com/gemini-code-assist/resources/available-locations) for free individual usage.>
16
14
1. You are a Google account holder under the age of 18
17
-
18
15
- If you fall into one of these categories, you must first configure a Google Cloud Project Id to use, [enable the Gemini for Cloud API](https://cloud.google.com/gemini/docs/discover/set-up-gemini#enable-api) and [configure access permissions](https://cloud.google.com/gemini/docs/discover/set-up-gemini#grant-iam).
19
16
20
17
You can temporarily set the environment variable in your current shell session using the following command:
21
18
22
19
```bash
23
20
export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"
24
21
```
25
-
26
22
- For repeated use, you can add the environment variable to your `.env` file (located in the project directory or user home directory) or your shell's configuration file (like `~/.bashrc`, `~/.zshrc`, or `~/.profile`). For example, the following command adds the environment variable to a `~/.bashrc` file:
27
23
28
24
```bash
@@ -31,7 +27,6 @@ The Gemini CLI requires you to authenticate with Google's AI services. On initia
31
27
```
32
28
33
29
2. **<a id="gemini-api-key"></a>Gemini API key:**
34
-
35
30
- Obtain your API key from Google AI Studio: [https://aistudio.google.com/app/apikey](https://aistudio.google.com/app/apikey)
36
31
- Set the `GEMINI_API_KEY` environment variable. In the following methods, replace `YOUR_GEMINI_API_KEY` with the API key you obtained from Google AI Studio:
37
32
- You can temporarily set the environment variable in your current shell session using the following command:
Copy file name to clipboardExpand all lines: docs/cli/commands.md
-18Lines changed: 0 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,9 @@ Gemini CLI supports several built-in commands to help you manage your session, c
7
7
Slash commands provide meta-level control over the CLI itself.
8
8
9
9
-**`/bug`**
10
-
11
10
-**Description:** File an issue about Gemini CLI. By default, the issue is filed within the GitHub repository for Gemini CLI. The string you enter after `/bug` will become the headline for the bug being filed. The default `/bug` behavior can be modified using the `bugCommand` setting in your `.gemini/settings.json` files.
12
11
13
12
-**`/chat`**
14
-
15
13
-**Description:** Save and resume conversation history for branching conversation state interactively, or resuming a previous state from a later session.
16
14
-**Sub-commands:**
17
15
-**`save`**
@@ -24,24 +22,19 @@ Slash commands provide meta-level control over the CLI itself.
24
22
-**Description:** Lists available tags for chat state resumption.
25
23
26
24
-**`/clear`**
27
-
28
25
-**Description:** Clear the terminal screen, including the visible session history and scrollback within the CLI. The underlying session data (for history recall) might be preserved depending on the exact implementation, but the visual display is cleared.
29
26
-**Keyboard shortcut:** Press **Ctrl+L** at any time to perform a clear action.
30
27
31
28
-**`/compress`**
32
-
33
29
-**Description:** Replace the entire chat context with a summary. This saves on tokens used for future tasks while retaining a high level summary of what has happened.
34
30
35
31
-**`/editor`**
36
-
37
32
-**Description:** Open a dialog for selecting supported editors.
38
33
39
34
-**`/help`** (or **`/?`**)
40
-
41
35
-**Description:** Display help information about the Gemini CLI, including available commands and their usage.
42
36
43
37
-**`/mcp`**
44
-
45
38
-**Description:** List configured Model Context Protocol (MCP) servers, their connection status, server details, and available tools.
46
39
-**Sub-commands:**
47
40
-**`desc`** or **`descriptions`**:
@@ -53,7 +46,6 @@ Slash commands provide meta-level control over the CLI itself.
53
46
-**Keyboard Shortcut:** Press **Ctrl+T** at any time to toggle between showing and hiding tool descriptions.
54
47
55
48
-**`/memory`**
56
-
57
49
-**Description:** Manage the AI's instructional context (hierarchical memory loaded from `GEMINI.md` files).
58
50
-**Sub-commands:**
59
51
-**`add`**:
@@ -65,29 +57,23 @@ Slash commands provide meta-level control over the CLI itself.
65
57
-**Note:** For more details on how `GEMINI.md` files contribute to hierarchical memory, see the [CLI Configuration documentation](./configuration.md#4-geminimd-files-hierarchical-instructional-context).
66
58
67
59
-**`/restore`**
68
-
69
60
-**Description:** Restores the project files to the state they were in just before a tool was executed. This is particularly useful for undoing file edits made by a tool. If run without a tool call ID, it will list available checkpoints to restore from.
70
61
-**Usage:**`/restore [tool_call_id]`
71
62
-**Note:** Only available if the CLI is invoked with the `--checkpointing` option or configured via [settings](./configuration.md). See [Checkpointing documentation](../checkpointing.md) for more details.
72
63
73
64
-**`/stats`**
74
-
75
65
-**Description:** Display detailed statistics for the current Gemini CLI session, including token usage, cached token savings (when available), and session duration. Note: Cached token information is only displayed when cached tokens are being used, which occurs with API key authentication but not with OAuth authentication at this time.
76
66
77
67
-[**`/theme`**](./themes.md)
78
-
79
68
-**Description:** Open a dialog that lets you change the visual theme of Gemini CLI.
80
69
81
70
-**`/auth`**
82
-
83
71
-**Description:** Open a dialog that lets you change the authentication method.
84
72
85
73
-**`/about`**
86
-
87
74
-**Description:** Show version info. Please share this information when filing issues.
88
75
89
76
-[**`/tools`**](../tools/index.md)
90
-
91
77
-**Description:** Display a list of tools that are currently available within Gemini CLI.
92
78
-**Sub-commands:**
93
79
-**`desc`** or **`descriptions`**:
@@ -96,15 +82,13 @@ Slash commands provide meta-level control over the CLI itself.
96
82
-**Description:** Hide tool descriptions, showing only the tool names.
97
83
98
84
-**`/quit`** (or **`/exit`**)
99
-
100
85
-**Description:** Exit Gemini CLI.
101
86
102
87
## At commands (`@`)
103
88
104
89
At commands are used to include the content of files or directories as part of your prompt to Gemini. These commands include git-aware filtering.
105
90
106
91
-**`@<path_to_file_or_directory>`**
107
-
108
92
-**Description:** Inject the content of the specified file or files into your current prompt. This is useful for asking questions about specific code, text, or collections of files.
109
93
-**Examples:**
110
94
-`@path/to/your/file.txt Explain this text.`
@@ -132,14 +116,12 @@ At commands are used to include the content of files or directories as part of y
132
116
The `!` prefix lets you interact with your system's shell directly from within Gemini CLI.
133
117
134
118
-**`!<shell_command>`**
135
-
136
119
-**Description:** Execute the given `<shell_command>` in your system's default shell. Any output or errors from the command are displayed in the terminal.
137
120
-**Examples:**
138
121
-`!ls -la` (executes `ls -la` and returns to Gemini CLI)
139
122
-`!git status` (executes `git status` and returns to Gemini CLI)
140
123
141
124
-**`!` (Toggle shell mode)**
142
-
143
125
-**Description:** Typing `!` on its own toggles shell mode.
144
126
-**Entering shell mode:**
145
127
- When active, shell mode uses a different coloring and a "Shell Mode Indicator".
@@ -68,43 +65,36 @@ In addition to a project settings file, a project's `.gemini` directory can cont
68
65
```
69
66
70
67
- **`coreTools`** (array of strings):
71
-
72
68
- **Description:** Allows you to specify a list of core tool names that should be made available to the model. This can be used to restrict the set of built-in tools. See [Built-in Tools](../core/tools-api.md#built-in-tools) for a list of core tools.
73
69
- **Default:** All tools available for use by the Gemini model.
- **Description:** Allows you to specify a list of core tool names that should be excluded from the model. A tool listed in both `excludeTools` and `coreTools` is excluded.
- **Description:** Controls whether the CLI automatically accepts and executes tool calls that are considered safe (e.g., read-only operations) without explicit user confirmation. If set to `true`, the CLI will bypass the confirmation prompt for tools deemed safe.
85
79
- **Default:** `false`
86
80
- **Example:** `"autoAccept": true`
87
81
88
82
- **`theme`** (string):
89
-
90
83
- **Description:** Sets the visual [theme](./themes.md) for Gemini CLI.
91
84
- **Default:** `"Default"`
92
85
- **Example:** `"theme": "GitHub"`
93
86
94
87
- **`sandbox`** (boolean or string):
95
-
96
88
- **Description:** Controls whether and how to use sandboxing for tool execution. If set to `true`, Gemini CLI uses a pre-built `gemini-cli-sandbox` Docker image. For more information, see [Sandboxing](#sandboxing).
97
89
- **Default:** `false`
98
90
- **Example:** `"sandbox": "docker"`
99
91
100
92
- **`toolDiscoveryCommand`** (string):
101
-
102
93
- **Description:** Defines a custom shell command for discovering tools from your project. The shell command must return on `stdout` a JSON array of [function declarations](https://ai.google.dev/gemini-api/docs/function-calling#function-declarations). Tool wrappers are optional.
- **Description:** Defines a custom shell command for calling a specific tool that was discovered using `toolDiscoveryCommand`. The shell command must meet the following criteria:
109
99
- It must take function `name` (exactly as in [function declaration](https://ai.google.dev/gemini-api/docs/function-calling#function-declarations)) as first command line argument.
110
100
- It must read function arguments as JSON on `stdin`, analogous to [`functionCall.args`](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#functioncall).
@@ -113,7 +103,6 @@ In addition to a project settings file, a project's `.gemini` directory can cont
- **Description:** Configures connections to one or more Model-Context Protocol (MCP) servers for discovering and using custom tools. Gemini CLI attempts to connect to each configured MCP server to discover available tools. If multiple MCP servers expose a tool with the same name, the tool names will be prefixed with the server alias you defined in the configuration (e.g., `serverAlias__actualToolName`) to avoid conflicts. Note that the system might strip certain schema properties from MCP tool definitions for compatibility.
118
107
- **Default:** Empty
119
108
- **Properties:**
@@ -149,14 +138,12 @@ In addition to a project settings file, a project's `.gemini` directory can cont
149
138
```
150
139
151
140
- **`checkpointing`** (object):
152
-
153
141
- **Description:** Configures the checkpointing feature, which allows you to save and restore conversation and file states. See the [Checkpointing documentation](../checkpointing.md) for more details.
154
142
- **Default:** `{"enabled": false}`
155
143
- **Properties:**
156
144
- **`enabled`** (boolean): When `true`, the `/restore` command is available.
157
145
158
146
- **`preferredEditor`** (string):
159
-
160
147
- **Description:** Specifies the preferred editor to use for viewing diffs.
0 commit comments