diff options
Diffstat (limited to 'docs/cli')
| -rw-r--r-- | docs/cli/authentication.md | 5 | ||||
| -rw-r--r-- | docs/cli/commands.md | 18 | ||||
| -rw-r--r-- | docs/cli/configuration.md | 13 |
3 files changed, 0 insertions, 36 deletions
diff --git a/docs/cli/authentication.md b/docs/cli/authentication.md index 21604ac7..1e133e01 100644 --- a/docs/cli/authentication.md +++ b/docs/cli/authentication.md @@ -3,18 +3,15 @@ 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: 1. **Login with Google (Gemini Code Assist):** - - Use this option to log in with your google account. - 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. - 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). - <a id="workspace-gca">Users may have to specify a GOOGLE_CLOUD_PROJECT if:</a> - 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. 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) 1. You have been assigned a license to a current Gemini Code Assist standard or enterprise subscription. 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.> 1. You are a Google account holder under the age of 18 - - 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). You can temporarily set the environment variable in your current shell session using the following command: @@ -22,7 +19,6 @@ The Gemini CLI requires you to authenticate with Google's AI services. On initia ```bash export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID" ``` - - 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: ```bash @@ -31,7 +27,6 @@ The Gemini CLI requires you to authenticate with Google's AI services. On initia ``` 2. **<a id="gemini-api-key"></a>Gemini API key:** - - Obtain your API key from Google AI Studio: [https://aistudio.google.com/app/apikey](https://aistudio.google.com/app/apikey) - 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: - You can temporarily set the environment variable in your current shell session using the following command: diff --git a/docs/cli/commands.md b/docs/cli/commands.md index c0f60c5f..eda8122a 100644 --- a/docs/cli/commands.md +++ b/docs/cli/commands.md @@ -7,11 +7,9 @@ Gemini CLI supports several built-in commands to help you manage your session, c Slash commands provide meta-level control over the CLI itself. - **`/bug`** - - **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. - **`/chat`** - - **Description:** Save and resume conversation history for branching conversation state interactively, or resuming a previous state from a later session. - **Sub-commands:** - **`save`** @@ -24,24 +22,19 @@ Slash commands provide meta-level control over the CLI itself. - **Description:** Lists available tags for chat state resumption. - **`/clear`** - - **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. - **Keyboard shortcut:** Press **Ctrl+L** at any time to perform a clear action. - **`/compress`** - - **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. - **`/editor`** - - **Description:** Open a dialog for selecting supported editors. - **`/help`** (or **`/?`**) - - **Description:** Display help information about the Gemini CLI, including available commands and their usage. - **`/mcp`** - - **Description:** List configured Model Context Protocol (MCP) servers, their connection status, server details, and available tools. - **Sub-commands:** - **`desc`** or **`descriptions`**: @@ -53,7 +46,6 @@ Slash commands provide meta-level control over the CLI itself. - **Keyboard Shortcut:** Press **Ctrl+T** at any time to toggle between showing and hiding tool descriptions. - **`/memory`** - - **Description:** Manage the AI's instructional context (hierarchical memory loaded from `GEMINI.md` files). - **Sub-commands:** - **`add`**: @@ -65,29 +57,23 @@ Slash commands provide meta-level control over the CLI itself. - **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). - **`/restore`** - - **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. - **Usage:** `/restore [tool_call_id]` - **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. - **`/stats`** - - **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. - [**`/theme`**](./themes.md) - - **Description:** Open a dialog that lets you change the visual theme of Gemini CLI. - **`/auth`** - - **Description:** Open a dialog that lets you change the authentication method. - **`/about`** - - **Description:** Show version info. Please share this information when filing issues. - [**`/tools`**](../tools/index.md) - - **Description:** Display a list of tools that are currently available within Gemini CLI. - **Sub-commands:** - **`desc`** or **`descriptions`**: @@ -96,7 +82,6 @@ Slash commands provide meta-level control over the CLI itself. - **Description:** Hide tool descriptions, showing only the tool names. - **`/quit`** (or **`/exit`**) - - **Description:** Exit Gemini CLI. ## At commands (`@`) @@ -104,7 +89,6 @@ Slash commands provide meta-level control over the CLI itself. 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. - **`@<path_to_file_or_directory>`** - - **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. - **Examples:** - `@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 The `!` prefix lets you interact with your system's shell directly from within Gemini CLI. - **`!<shell_command>`** - - **Description:** Execute the given `<shell_command>` in your system's default shell. Any output or errors from the command are displayed in the terminal. - **Examples:** - `!ls -la` (executes `ls -la` and returns to Gemini CLI) - `!git status` (executes `git status` and returns to Gemini CLI) - **`!` (Toggle shell mode)** - - **Description:** Typing `!` on its own toggles shell mode. - **Entering shell mode:** - When active, shell mode uses a different coloring and a "Shell Mode Indicator". diff --git a/docs/cli/configuration.md b/docs/cli/configuration.md index 8c5d06ab..edf5d9fd 100644 --- a/docs/cli/configuration.md +++ b/docs/cli/configuration.md @@ -34,13 +34,11 @@ In addition to a project settings file, a project's `.gemini` directory can cont ### Available settings in `settings.json`: - **`contextFileName`** (string or array of strings): - - **Description:** Specifies the filename for context files (e.g., `GEMINI.md`, `AGENTS.md`). Can be a single filename or a list of accepted filenames. - **Default:** `GEMINI.md` - **Example:** `"contextFileName": "AGENTS.md"` - **`bugCommand`** (object): - - **Description:** Overrides the default URL for the `/bug` command. - **Default:** `"urlTemplate": "https://github.com/google-gemini/gemini-cli/issues/new?template=bug_report.yml&title={title}&info={info}"` - **Properties:** @@ -53,7 +51,6 @@ In addition to a project settings file, a project's `.gemini` directory can cont ``` - **`fileFiltering`** (object): - - **Description:** Controls git-aware file filtering behavior for @ commands and file discovery tools. - **Default:** `"respectGitIgnore": true, "enableRecursiveFileSearch": true` - **Properties:** @@ -68,43 +65,36 @@ In addition to a project settings file, a project's `.gemini` directory can cont ``` - **`coreTools`** (array of strings): - - **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. - **Default:** All tools available for use by the Gemini model. - **Example:** `"coreTools": ["ReadFileTool", "GlobTool", "SearchText"]`. - **`excludeTools`** (array of strings): - - **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. - **Default**: No tools excluded. - **Example:** `"excludeTools": ["run_shell_command", "findFiles"]`. - **`autoAccept`** (boolean): - - **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. - **Default:** `false` - **Example:** `"autoAccept": true` - **`theme`** (string): - - **Description:** Sets the visual [theme](./themes.md) for Gemini CLI. - **Default:** `"Default"` - **Example:** `"theme": "GitHub"` - **`sandbox`** (boolean or string): - - **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). - **Default:** `false` - **Example:** `"sandbox": "docker"` - **`toolDiscoveryCommand`** (string): - - **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. - **Default:** Empty - **Example:** `"toolDiscoveryCommand": "bin/get_tools"` - **`toolCallCommand`** (string): - - **Description:** Defines a custom shell command for calling a specific tool that was discovered using `toolDiscoveryCommand`. The shell command must meet the following criteria: - 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. - 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 - **Example:** `"toolCallCommand": "bin/call_tool"` - **`mcpServers`** (object): - - **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. - **Default:** Empty - **Properties:** @@ -149,14 +138,12 @@ In addition to a project settings file, a project's `.gemini` directory can cont ``` - **`checkpointing`** (object): - - **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. - **Default:** `{"enabled": false}` - **Properties:** - **`enabled`** (boolean): When `true`, the `/restore` command is available. - **`preferredEditor`** (string): - - **Description:** Specifies the preferred editor to use for viewing diffs. - **Default:** `vscode` - **Example:** `"preferredEditor": "vscode"` |
