@google/gemini-cli-core 0.21.0-nightly.20251218.739c02bd6 → 0.21.0-nightly.20251220.41a1a3eed
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docs/CONTRIBUTING.md +546 -0
- package/dist/docs/architecture.md +80 -0
- package/dist/docs/assets/connected_devtools.png +0 -0
- package/dist/docs/assets/gemini-screenshot.png +0 -0
- package/dist/docs/assets/release_patch.png +0 -0
- package/dist/docs/assets/theme-ansi-light.png +0 -0
- package/dist/docs/assets/theme-ansi.png +0 -0
- package/dist/docs/assets/theme-atom-one.png +0 -0
- package/dist/docs/assets/theme-ayu-light.png +0 -0
- package/dist/docs/assets/theme-ayu.png +0 -0
- package/dist/docs/assets/theme-custom.png +0 -0
- package/dist/docs/assets/theme-default-light.png +0 -0
- package/dist/docs/assets/theme-default.png +0 -0
- package/dist/docs/assets/theme-dracula.png +0 -0
- package/dist/docs/assets/theme-github-light.png +0 -0
- package/dist/docs/assets/theme-github.png +0 -0
- package/dist/docs/assets/theme-google-light.png +0 -0
- package/dist/docs/assets/theme-xcode-light.png +0 -0
- package/dist/docs/changelogs/index.md +592 -0
- package/dist/docs/changelogs/latest.md +225 -0
- package/dist/docs/changelogs/preview.md +129 -0
- package/dist/docs/changelogs/releases.md +896 -0
- package/dist/docs/cli/authentication.md +3 -0
- package/dist/docs/cli/checkpointing.md +94 -0
- package/dist/docs/cli/commands.md +354 -0
- package/dist/docs/cli/configuration.md +780 -0
- package/dist/docs/cli/custom-commands.md +315 -0
- package/dist/docs/cli/enterprise.md +565 -0
- package/dist/docs/cli/gemini-ignore.md +71 -0
- package/dist/docs/cli/gemini-md.md +108 -0
- package/dist/docs/cli/generation-settings.md +210 -0
- package/dist/docs/cli/headless.md +388 -0
- package/dist/docs/cli/index.md +63 -0
- package/dist/docs/cli/keyboard-shortcuts.md +143 -0
- package/dist/docs/cli/model-routing.md +37 -0
- package/dist/docs/cli/model.md +62 -0
- package/dist/docs/cli/sandbox.md +171 -0
- package/dist/docs/cli/session-management.md +158 -0
- package/dist/docs/cli/settings.md +112 -0
- package/dist/docs/cli/system-prompt.md +93 -0
- package/dist/docs/cli/telemetry.md +791 -0
- package/dist/docs/cli/themes.md +237 -0
- package/dist/docs/cli/token-caching.md +20 -0
- package/dist/docs/cli/trusted-folders.md +95 -0
- package/dist/docs/cli/tutorials.md +83 -0
- package/dist/docs/cli/uninstall.md +47 -0
- package/dist/docs/core/index.md +101 -0
- package/dist/docs/core/memport.md +244 -0
- package/dist/docs/core/policy-engine.md +267 -0
- package/dist/docs/core/tools-api.md +131 -0
- package/dist/docs/examples/proxy-script.md +83 -0
- package/dist/docs/extensions/extension-releasing.md +183 -0
- package/dist/docs/extensions/getting-started-extensions.md +245 -0
- package/dist/docs/extensions/index.md +293 -0
- package/dist/docs/faq.md +154 -0
- package/dist/docs/get-started/authentication.md +321 -0
- package/dist/docs/get-started/configuration-v1.md +888 -0
- package/dist/docs/get-started/configuration.md +1444 -0
- package/dist/docs/get-started/deployment.md +143 -0
- package/dist/docs/get-started/examples.md +219 -0
- package/dist/docs/get-started/gemini-3.md +116 -0
- package/dist/docs/get-started/index.md +71 -0
- package/dist/docs/get-started/installation.md +141 -0
- package/dist/docs/hooks/best-practices.md +806 -0
- package/dist/docs/hooks/index.md +665 -0
- package/dist/docs/hooks/reference.md +168 -0
- package/dist/docs/hooks/writing-hooks.md +1026 -0
- package/dist/docs/ide-integration/ide-companion-spec.md +267 -0
- package/dist/docs/ide-integration/index.md +202 -0
- package/dist/docs/index.md +147 -0
- package/dist/docs/integration-tests.md +211 -0
- package/dist/docs/issue-and-pr-automation.md +134 -0
- package/dist/docs/local-development.md +128 -0
- package/dist/docs/mermaid/context.mmd +103 -0
- package/dist/docs/mermaid/render-path.mmd +64 -0
- package/dist/docs/npm.md +62 -0
- package/dist/docs/quota-and-pricing.md +158 -0
- package/dist/docs/release-confidence.md +164 -0
- package/dist/docs/releases.md +540 -0
- package/dist/docs/sidebar.json +297 -0
- package/dist/docs/tools/file-system.md +217 -0
- package/dist/docs/tools/index.md +95 -0
- package/dist/docs/tools/mcp-server.md +1044 -0
- package/dist/docs/tools/memory.md +54 -0
- package/dist/docs/tools/shell.md +260 -0
- package/dist/docs/tools/todos.md +57 -0
- package/dist/docs/tools/web-fetch.md +59 -0
- package/dist/docs/tools/web-search.md +42 -0
- package/dist/docs/tos-privacy.md +96 -0
- package/dist/docs/troubleshooting.md +158 -0
- package/dist/google-gemini-cli-core-0.21.0-nightly.20251219.70696e364.tgz +0 -0
- package/dist/src/agents/delegate-to-agent-tool.test.js +1 -0
- package/dist/src/agents/delegate-to-agent-tool.test.js.map +1 -1
- package/dist/src/agents/introspection-agent.d.ts +23 -0
- package/dist/src/agents/introspection-agent.js +72 -0
- package/dist/src/agents/introspection-agent.js.map +1 -0
- package/dist/src/agents/introspection-agent.test.d.ts +6 -0
- package/dist/src/agents/introspection-agent.test.js +47 -0
- package/dist/src/agents/introspection-agent.test.js.map +1 -0
- package/dist/src/agents/local-executor.d.ts +0 -6
- package/dist/src/agents/local-executor.js +73 -47
- package/dist/src/agents/local-executor.js.map +1 -1
- package/dist/src/agents/local-executor.test.d.ts +1 -7
- package/dist/src/agents/local-executor.test.js +27 -9
- package/dist/src/agents/local-executor.test.js.map +1 -1
- package/dist/src/agents/registry.d.ts +1 -0
- package/dist/src/agents/registry.js +51 -7
- package/dist/src/agents/registry.js.map +1 -1
- package/dist/src/agents/registry.test.js +112 -1
- package/dist/src/agents/registry.test.js.map +1 -1
- package/dist/src/agents/toml-loader.d.ts +65 -0
- package/dist/src/agents/toml-loader.js +176 -0
- package/dist/src/agents/toml-loader.js.map +1 -0
- package/dist/src/agents/toml-loader.test.d.ts +6 -0
- package/dist/src/agents/toml-loader.test.js +190 -0
- package/dist/src/agents/toml-loader.test.js.map +1 -0
- package/dist/src/availability/modelAvailabilityService.d.ts +2 -1
- package/dist/src/config/config.d.ts +9 -0
- package/dist/src/config/config.js +29 -0
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +59 -1
- package/dist/src/config/config.test.js.map +1 -1
- package/dist/src/config/storage.d.ts +2 -0
- package/dist/src/config/storage.js +6 -0
- package/dist/src/config/storage.js.map +1 -1
- package/dist/src/config/storage.test.js +8 -0
- package/dist/src/config/storage.test.js.map +1 -1
- package/dist/src/core/client.js +8 -4
- package/dist/src/core/client.js.map +1 -1
- package/dist/src/core/client.test.js +20 -0
- package/dist/src/core/client.test.js.map +1 -1
- package/dist/src/core/clientHookTriggers.js +2 -2
- package/dist/src/core/clientHookTriggers.js.map +1 -1
- package/dist/src/core/coreToolHookTriggers.js +3 -3
- package/dist/src/core/coreToolHookTriggers.js.map +1 -1
- package/dist/src/core/geminiChatHookTriggers.js +3 -3
- package/dist/src/core/geminiChatHookTriggers.js.map +1 -1
- package/dist/src/core/sessionHookTriggers.js +3 -3
- package/dist/src/core/sessionHookTriggers.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +2 -2
- package/dist/src/generated/git-commit.js +2 -2
- package/dist/src/hooks/hookEventHandler.js +10 -4
- package/dist/src/hooks/hookEventHandler.js.map +1 -1
- package/dist/src/hooks/hookEventHandler.test.js +40 -0
- package/dist/src/hooks/hookEventHandler.test.js.map +1 -1
- package/dist/src/hooks/hookPlanner.js +3 -1
- package/dist/src/hooks/hookPlanner.js.map +1 -1
- package/dist/src/hooks/hookPlanner.test.js +61 -0
- package/dist/src/hooks/hookPlanner.test.js.map +1 -1
- package/dist/src/hooks/hookRegistry.d.ts +1 -1
- package/dist/src/hooks/hookRegistry.js +2 -2
- package/dist/src/hooks/hookRegistry.js.map +1 -1
- package/dist/src/hooks/hookRegistry.test.js +73 -0
- package/dist/src/hooks/hookRegistry.test.js.map +1 -1
- package/dist/src/hooks/hookRunner.js +14 -10
- package/dist/src/hooks/hookRunner.js.map +1 -1
- package/dist/src/hooks/hookRunner.test.js +81 -33
- package/dist/src/hooks/hookRunner.test.js.map +1 -1
- package/dist/src/hooks/types.d.ts +2 -0
- package/dist/src/hooks/types.js.map +1 -1
- package/dist/src/mcp/oauth-provider.js +6 -2
- package/dist/src/mcp/oauth-provider.js.map +1 -1
- package/dist/src/mcp/oauth-provider.test.js +4 -1
- package/dist/src/mcp/oauth-provider.test.js.map +1 -1
- package/dist/src/mcp/oauth-utils.d.ts +8 -1
- package/dist/src/mcp/oauth-utils.js +30 -1
- package/dist/src/mcp/oauth-utils.js.map +1 -1
- package/dist/src/mcp/oauth-utils.test.js +42 -0
- package/dist/src/mcp/oauth-utils.test.js.map +1 -1
- package/dist/src/services/contextManager.d.ts +5 -11
- package/dist/src/services/contextManager.js +20 -17
- package/dist/src/services/contextManager.js.map +1 -1
- package/dist/src/services/contextManager.test.js +40 -41
- package/dist/src/services/contextManager.test.js.map +1 -1
- package/dist/src/services/shellExecutionService.js +18 -2
- package/dist/src/services/shellExecutionService.js.map +1 -1
- package/dist/src/tools/get-internal-docs.d.ts +27 -0
- package/dist/src/tools/get-internal-docs.js +129 -0
- package/dist/src/tools/get-internal-docs.js.map +1 -0
- package/dist/src/tools/get-internal-docs.test.d.ts +6 -0
- package/dist/src/tools/get-internal-docs.test.js +56 -0
- package/dist/src/tools/get-internal-docs.test.js.map +1 -0
- package/dist/src/tools/tool-names.d.ts +14 -0
- package/dist/src/tools/tool-names.js +55 -0
- package/dist/src/tools/tool-names.js.map +1 -1
- package/dist/src/tools/tool-names.test.d.ts +6 -0
- package/dist/src/tools/tool-names.test.js +43 -0
- package/dist/src/tools/tool-names.test.js.map +1 -0
- package/dist/src/tools/tool-registry.d.ts +0 -1
- package/dist/src/tools/tool-registry.js +1 -1
- package/dist/src/tools/tool-registry.js.map +1 -1
- package/dist/src/tools/tool-registry.test.js +2 -1
- package/dist/src/tools/tool-registry.test.js.map +1 -1
- package/dist/src/utils/environmentContext.js +3 -0
- package/dist/src/utils/environmentContext.js.map +1 -1
- package/dist/src/utils/environmentContext.test.js +2 -0
- package/dist/src/utils/environmentContext.test.js.map +1 -1
- package/dist/src/utils/events.d.ts +3 -2
- package/dist/src/utils/events.js.map +1 -1
- package/dist/src/utils/googleQuotaErrors.js +20 -0
- package/dist/src/utils/googleQuotaErrors.js.map +1 -1
- package/dist/src/utils/googleQuotaErrors.test.js +53 -2
- package/dist/src/utils/googleQuotaErrors.test.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.js +1 -1
- package/dist/src/utils/memoryDiscovery.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.test.js +3 -1
- package/dist/src/utils/memoryDiscovery.test.js.map +1 -1
- package/dist/src/utils/shell-utils.js +25 -4
- package/dist/src/utils/shell-utils.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -6
- package/dist/google-gemini-cli-core-0.21.0-nightly.20251216.bb0c0d8ee.tgz +0 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Checkpointing
|
|
2
|
+
|
|
3
|
+
The Gemini CLI includes a Checkpointing feature that automatically saves a
|
|
4
|
+
snapshot of your project's state before any file modifications are made by
|
|
5
|
+
AI-powered tools. This allows you to safely experiment with and apply code
|
|
6
|
+
changes, knowing you can instantly revert back to the state before the tool was
|
|
7
|
+
run.
|
|
8
|
+
|
|
9
|
+
## How it works
|
|
10
|
+
|
|
11
|
+
When you approve a tool that modifies the file system (like `write_file` or
|
|
12
|
+
`replace`), the CLI automatically creates a "checkpoint." This checkpoint
|
|
13
|
+
includes:
|
|
14
|
+
|
|
15
|
+
1. **A Git snapshot:** A commit is made in a special, shadow Git repository
|
|
16
|
+
located in your home directory (`~/.gemini/history/<project_hash>`). This
|
|
17
|
+
snapshot captures the complete state of your project files at that moment.
|
|
18
|
+
It does **not** interfere with your own project's Git repository.
|
|
19
|
+
2. **Conversation history:** The entire conversation you've had with the agent
|
|
20
|
+
up to that point is saved.
|
|
21
|
+
3. **The tool call:** The specific tool call that was about to be executed is
|
|
22
|
+
also stored.
|
|
23
|
+
|
|
24
|
+
If you want to undo the change or simply go back, you can use the `/restore`
|
|
25
|
+
command. Restoring a checkpoint will:
|
|
26
|
+
|
|
27
|
+
- Revert all files in your project to the state captured in the snapshot.
|
|
28
|
+
- Restore the conversation history in the CLI.
|
|
29
|
+
- Re-propose the original tool call, allowing you to run it again, modify it, or
|
|
30
|
+
simply ignore it.
|
|
31
|
+
|
|
32
|
+
All checkpoint data, including the Git snapshot and conversation history, is
|
|
33
|
+
stored locally on your machine. The Git snapshot is stored in the shadow
|
|
34
|
+
repository while the conversation history and tool calls are saved in a JSON
|
|
35
|
+
file in your project's temporary directory, typically located at
|
|
36
|
+
`~/.gemini/tmp/<project_hash>/checkpoints`.
|
|
37
|
+
|
|
38
|
+
## Enabling the feature
|
|
39
|
+
|
|
40
|
+
The Checkpointing feature is disabled by default. To enable it, you need to edit
|
|
41
|
+
your `settings.json` file.
|
|
42
|
+
|
|
43
|
+
> **Note:** The `--checkpointing` command-line flag was removed in version
|
|
44
|
+
> 0.11.0. Checkpointing can now only be enabled through the `settings.json`
|
|
45
|
+
> configuration file.
|
|
46
|
+
|
|
47
|
+
Add the following key to your `settings.json`:
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"general": {
|
|
52
|
+
"checkpointing": {
|
|
53
|
+
"enabled": true
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Using the `/restore` command
|
|
60
|
+
|
|
61
|
+
Once enabled, checkpoints are created automatically. To manage them, you use the
|
|
62
|
+
`/restore` command.
|
|
63
|
+
|
|
64
|
+
### List available checkpoints
|
|
65
|
+
|
|
66
|
+
To see a list of all saved checkpoints for the current project, simply run:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
/restore
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The CLI will display a list of available checkpoint files. These file names are
|
|
73
|
+
typically composed of a timestamp, the name of the file being modified, and the
|
|
74
|
+
name of the tool that was about to be run (e.g.,
|
|
75
|
+
`2025-06-22T10-00-00_000Z-my-file.txt-write_file`).
|
|
76
|
+
|
|
77
|
+
### Restore a specific checkpoint
|
|
78
|
+
|
|
79
|
+
To restore your project to a specific checkpoint, use the checkpoint file from
|
|
80
|
+
the list:
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
/restore <checkpoint_file>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
For example:
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
/restore 2025-06-22T10-00-00_000Z-my-file.txt-write_file
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
After running the command, your files and conversation will be immediately
|
|
93
|
+
restored to the state they were in when the checkpoint was created, and the
|
|
94
|
+
original tool prompt will reappear.
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
# CLI commands
|
|
2
|
+
|
|
3
|
+
Gemini CLI supports several built-in commands to help you manage your session,
|
|
4
|
+
customize the interface, and control its behavior. These commands are prefixed
|
|
5
|
+
with a forward slash (`/`), an at symbol (`@`), or an exclamation mark (`!`).
|
|
6
|
+
|
|
7
|
+
## Slash commands (`/`)
|
|
8
|
+
|
|
9
|
+
Slash commands provide meta-level control over the CLI itself.
|
|
10
|
+
|
|
11
|
+
### Built-in Commands
|
|
12
|
+
|
|
13
|
+
- **`/bug`**
|
|
14
|
+
- **Description:** File an issue about Gemini CLI. By default, the issue is
|
|
15
|
+
filed within the GitHub repository for Gemini CLI. The string you enter
|
|
16
|
+
after `/bug` will become the headline for the bug being filed. The default
|
|
17
|
+
`/bug` behavior can be modified using the `advanced.bugCommand` setting in
|
|
18
|
+
your `.gemini/settings.json` files.
|
|
19
|
+
|
|
20
|
+
- **`/chat`**
|
|
21
|
+
- **Description:** Save and resume conversation history for branching
|
|
22
|
+
conversation state interactively, or resuming a previous state from a later
|
|
23
|
+
session.
|
|
24
|
+
- **Sub-commands:**
|
|
25
|
+
- **`save`**
|
|
26
|
+
- **Description:** Saves the current conversation history. You must add a
|
|
27
|
+
`<tag>` for identifying the conversation state.
|
|
28
|
+
- **Usage:** `/chat save <tag>`
|
|
29
|
+
- **Details on checkpoint location:** The default locations for saved chat
|
|
30
|
+
checkpoints are:
|
|
31
|
+
- Linux/macOS: `~/.gemini/tmp/<project_hash>/`
|
|
32
|
+
- Windows: `C:\Users\<YourUsername>\.gemini\tmp\<project_hash>\`
|
|
33
|
+
- **Behavior:** Chats are saved into a project-specific directory,
|
|
34
|
+
determined by where you run the CLI. Consequently, saved chats are
|
|
35
|
+
only accessible when working within that same project.
|
|
36
|
+
- **Note:** These checkpoints are for manually saving and resuming
|
|
37
|
+
conversation states. For automatic checkpoints created before file
|
|
38
|
+
modifications, see the
|
|
39
|
+
[Checkpointing documentation](../cli/checkpointing.md).
|
|
40
|
+
- **`resume`**
|
|
41
|
+
- **Description:** Resumes a conversation from a previous save.
|
|
42
|
+
- **Usage:** `/chat resume <tag>`
|
|
43
|
+
- **Note:** You can only resume chats that were saved within the current
|
|
44
|
+
project. To resume a chat from a different project, you must run the
|
|
45
|
+
Gemini CLI from that project's directory.
|
|
46
|
+
- **`list`**
|
|
47
|
+
- **Description:** Lists available tags for chat state resumption.
|
|
48
|
+
- **Note:** This command only lists chats saved within the current
|
|
49
|
+
project. Because chat history is project-scoped, chats saved in other
|
|
50
|
+
project directories will not be displayed.
|
|
51
|
+
- **`delete`**
|
|
52
|
+
- **Description:** Deletes a saved conversation checkpoint.
|
|
53
|
+
- **Usage:** `/chat delete <tag>`
|
|
54
|
+
- **`share`**
|
|
55
|
+
- **Description** Writes the current conversation to a provided Markdown
|
|
56
|
+
or JSON file.
|
|
57
|
+
- **Usage** `/chat share file.md` or `/chat share file.json`. If no
|
|
58
|
+
filename is provided, then the CLI will generate one.
|
|
59
|
+
|
|
60
|
+
- **`/clear`**
|
|
61
|
+
- **Description:** Clear the terminal screen, including the visible session
|
|
62
|
+
history and scrollback within the CLI. The underlying session data (for
|
|
63
|
+
history recall) might be preserved depending on the exact implementation,
|
|
64
|
+
but the visual display is cleared.
|
|
65
|
+
- **Keyboard shortcut:** Press **Ctrl+L** at any time to perform a clear
|
|
66
|
+
action.
|
|
67
|
+
|
|
68
|
+
- **`/compress`**
|
|
69
|
+
- **Description:** Replace the entire chat context with a summary. This saves
|
|
70
|
+
on tokens used for future tasks while retaining a high level summary of what
|
|
71
|
+
has happened.
|
|
72
|
+
|
|
73
|
+
- **`/copy`**
|
|
74
|
+
- **Description:** Copies the last output produced by Gemini CLI to your
|
|
75
|
+
clipboard, for easy sharing or reuse.
|
|
76
|
+
- **Note:** This command requires platform-specific clipboard tools to be
|
|
77
|
+
installed.
|
|
78
|
+
- On Linux, it requires `xclip` or `xsel`. You can typically install them
|
|
79
|
+
using your system's package manager.
|
|
80
|
+
- On macOS, it requires `pbcopy`, and on Windows, it requires `clip`. These
|
|
81
|
+
tools are typically pre-installed on their respective systems.
|
|
82
|
+
|
|
83
|
+
- **`/directory`** (or **`/dir`**)
|
|
84
|
+
- **Description:** Manage workspace directories for multi-directory support.
|
|
85
|
+
- **Sub-commands:**
|
|
86
|
+
- **`add`**:
|
|
87
|
+
- **Description:** Add a directory to the workspace. The path can be
|
|
88
|
+
absolute or relative to the current working directory. Moreover, the
|
|
89
|
+
reference from home directory is supported as well.
|
|
90
|
+
- **Usage:** `/directory add <path1>,<path2>`
|
|
91
|
+
- **Note:** Disabled in restrictive sandbox profiles. If you're using
|
|
92
|
+
that, use `--include-directories` when starting the session instead.
|
|
93
|
+
- **`show`**:
|
|
94
|
+
- **Description:** Display all directories added by `/directory add` and
|
|
95
|
+
`--include-directories`.
|
|
96
|
+
- **Usage:** `/directory show`
|
|
97
|
+
|
|
98
|
+
- **`/editor`**
|
|
99
|
+
- **Description:** Open a dialog for selecting supported editors.
|
|
100
|
+
|
|
101
|
+
- **`/extensions`**
|
|
102
|
+
- **Description:** Lists all active extensions in the current Gemini CLI
|
|
103
|
+
session. See [Gemini CLI Extensions](../extensions/index.md).
|
|
104
|
+
|
|
105
|
+
- **`/help`** (or **`/?`**)
|
|
106
|
+
- **Description:** Display help information about Gemini CLI, including
|
|
107
|
+
available commands and their usage.
|
|
108
|
+
|
|
109
|
+
- **`/mcp`**
|
|
110
|
+
- **Description:** Manage configured Model Context Protocol (MCP) servers.
|
|
111
|
+
- **Sub-commands:**
|
|
112
|
+
- **`list`** or **`ls`**:
|
|
113
|
+
- **Description:** List configured MCP servers and tools. This is the
|
|
114
|
+
default action if no subcommand is specified.
|
|
115
|
+
- **`desc`**
|
|
116
|
+
- **Description:** List configured MCP servers and tools with
|
|
117
|
+
descriptions.
|
|
118
|
+
- **`schema`**:
|
|
119
|
+
- **Description:** List configured MCP servers and tools with descriptions
|
|
120
|
+
and schemas.
|
|
121
|
+
- **`auth`**:
|
|
122
|
+
- **Description:** Authenticate with an OAuth-enabled MCP server.
|
|
123
|
+
- **Usage:** `/mcp auth <server-name>`
|
|
124
|
+
- **Details:** If `<server-name>` is provided, it initiates the OAuth flow
|
|
125
|
+
for that server. If no server name is provided, it lists all configured
|
|
126
|
+
servers that support OAuth authentication.
|
|
127
|
+
- **`refresh`**:
|
|
128
|
+
- **Description:** Restarts all MCP servers and re-discovers their
|
|
129
|
+
available tools.
|
|
130
|
+
|
|
131
|
+
- [**`/model`**](./model.md)
|
|
132
|
+
- **Description:** Opens a dialog to choose your Gemini model.
|
|
133
|
+
|
|
134
|
+
- **`/memory`**
|
|
135
|
+
- **Description:** Manage the AI's instructional context (hierarchical memory
|
|
136
|
+
loaded from `GEMINI.md` files).
|
|
137
|
+
- **Sub-commands:**
|
|
138
|
+
- **`add`**:
|
|
139
|
+
- **Description:** Adds the following text to the AI's memory. Usage:
|
|
140
|
+
`/memory add <text to remember>`
|
|
141
|
+
- **`show`**:
|
|
142
|
+
- **Description:** Display the full, concatenated content of the current
|
|
143
|
+
hierarchical memory that has been loaded from all `GEMINI.md` files.
|
|
144
|
+
This lets you inspect the instructional context being provided to the
|
|
145
|
+
Gemini model.
|
|
146
|
+
- **`refresh`**:
|
|
147
|
+
- **Description:** Reload the hierarchical instructional memory from all
|
|
148
|
+
`GEMINI.md` files found in the configured locations (global,
|
|
149
|
+
project/ancestors, and sub-directories). This command updates the model
|
|
150
|
+
with the latest `GEMINI.md` content.
|
|
151
|
+
- **`list`**:
|
|
152
|
+
- **Description:** Lists the paths of the GEMINI.md files in use for
|
|
153
|
+
hierarchical memory.
|
|
154
|
+
- **Note:** For more details on how `GEMINI.md` files contribute to
|
|
155
|
+
hierarchical memory, see the
|
|
156
|
+
[CLI Configuration documentation](../get-started/configuration.md).
|
|
157
|
+
|
|
158
|
+
- **`/restore`**
|
|
159
|
+
- **Description:** Restores the project files to the state they were in just
|
|
160
|
+
before a tool was executed. This is particularly useful for undoing file
|
|
161
|
+
edits made by a tool. If run without a tool call ID, it will list available
|
|
162
|
+
checkpoints to restore from.
|
|
163
|
+
- **Usage:** `/restore [tool_call_id]`
|
|
164
|
+
- **Note:** Only available if checkpointing is configured via
|
|
165
|
+
[settings](../get-started/configuration.md). See
|
|
166
|
+
[Checkpointing documentation](../cli/checkpointing.md) for more details.
|
|
167
|
+
- **`/resume`**
|
|
168
|
+
- **Description:** Browse and resume previous conversation sessions. Opens an
|
|
169
|
+
interactive session browser where you can search, filter, and select from
|
|
170
|
+
automatically saved conversations.
|
|
171
|
+
- **Features:**
|
|
172
|
+
- **Session Browser:** Interactive interface showing all saved sessions with
|
|
173
|
+
timestamps, message counts, and first user message for context
|
|
174
|
+
- **Search:** Use `/` to search through conversation content across all
|
|
175
|
+
sessions
|
|
176
|
+
- **Sorting:** Sort sessions by date or message count
|
|
177
|
+
- **Management:** Delete unwanted sessions directly from the browser
|
|
178
|
+
- **Resume:** Select any session to resume and continue the conversation
|
|
179
|
+
- **Note:** All conversations are automatically saved as you chat - no manual
|
|
180
|
+
saving required. See [Session Management](../cli/session-management.md) for
|
|
181
|
+
complete details.
|
|
182
|
+
|
|
183
|
+
- [**`/settings`**](./settings.md)
|
|
184
|
+
- **Description:** Open the settings editor to view and modify Gemini CLI
|
|
185
|
+
settings.
|
|
186
|
+
- **Details:** This command provides a user-friendly interface for changing
|
|
187
|
+
settings that control the behavior and appearance of Gemini CLI. It is
|
|
188
|
+
equivalent to manually editing the `.gemini/settings.json` file, but with
|
|
189
|
+
validation and guidance to prevent errors. See the
|
|
190
|
+
[settings documentation](./settings.md) for a full list of available
|
|
191
|
+
settings.
|
|
192
|
+
- **Usage:** Simply run `/settings` and the editor will open. You can then
|
|
193
|
+
browse or search for specific settings, view their current values, and
|
|
194
|
+
modify them as desired. Changes to some settings are applied immediately,
|
|
195
|
+
while others require a restart.
|
|
196
|
+
|
|
197
|
+
- **`/stats`**
|
|
198
|
+
- **Description:** Display detailed statistics for the current Gemini CLI
|
|
199
|
+
session, including token usage, cached token savings (when available), and
|
|
200
|
+
session duration. Note: Cached token information is only displayed when
|
|
201
|
+
cached tokens are being used, which occurs with API key authentication but
|
|
202
|
+
not with OAuth authentication at this time.
|
|
203
|
+
|
|
204
|
+
- [**`/theme`**](./themes.md)
|
|
205
|
+
- **Description:** Open a dialog that lets you change the visual theme of
|
|
206
|
+
Gemini CLI.
|
|
207
|
+
|
|
208
|
+
- **`/auth`**
|
|
209
|
+
- **Description:** Open a dialog that lets you change the authentication
|
|
210
|
+
method.
|
|
211
|
+
|
|
212
|
+
- **`/about`**
|
|
213
|
+
- **Description:** Show version info. Please share this information when
|
|
214
|
+
filing issues.
|
|
215
|
+
|
|
216
|
+
- [**`/tools`**](../tools/index.md)
|
|
217
|
+
- **Description:** Display a list of tools that are currently available within
|
|
218
|
+
Gemini CLI.
|
|
219
|
+
- **Usage:** `/tools [desc]`
|
|
220
|
+
- **Sub-commands:**
|
|
221
|
+
- **`desc`** or **`descriptions`**:
|
|
222
|
+
- **Description:** Show detailed descriptions of each tool, including each
|
|
223
|
+
tool's name with its full description as provided to the model.
|
|
224
|
+
- **`nodesc`** or **`nodescriptions`**:
|
|
225
|
+
- **Description:** Hide tool descriptions, showing only the tool names.
|
|
226
|
+
|
|
227
|
+
- **`/privacy`**
|
|
228
|
+
- **Description:** Display the Privacy Notice and allow users to select
|
|
229
|
+
whether they consent to the collection of their data for service improvement
|
|
230
|
+
purposes.
|
|
231
|
+
|
|
232
|
+
- **`/quit`** (or **`/exit`**)
|
|
233
|
+
- **Description:** Exit Gemini CLI.
|
|
234
|
+
|
|
235
|
+
- **`/vim`**
|
|
236
|
+
- **Description:** Toggle vim mode on or off. When vim mode is enabled, the
|
|
237
|
+
input area supports vim-style navigation and editing commands in both NORMAL
|
|
238
|
+
and INSERT modes.
|
|
239
|
+
- **Features:**
|
|
240
|
+
- **NORMAL mode:** Navigate with `h`, `j`, `k`, `l`; jump by words with `w`,
|
|
241
|
+
`b`, `e`; go to line start/end with `0`, `$`, `^`; go to specific lines
|
|
242
|
+
with `G` (or `gg` for first line)
|
|
243
|
+
- **INSERT mode:** Standard text input with escape to return to NORMAL mode
|
|
244
|
+
- **Editing commands:** Delete with `x`, change with `c`, insert with `i`,
|
|
245
|
+
`a`, `o`, `O`; complex operations like `dd`, `cc`, `dw`, `cw`
|
|
246
|
+
- **Count support:** Prefix commands with numbers (e.g., `3h`, `5w`, `10G`)
|
|
247
|
+
- **Repeat last command:** Use `.` to repeat the last editing operation
|
|
248
|
+
- **Persistent setting:** Vim mode preference is saved to
|
|
249
|
+
`~/.gemini/settings.json` and restored between sessions
|
|
250
|
+
- **Status indicator:** When enabled, shows `[NORMAL]` or `[INSERT]` in the
|
|
251
|
+
footer
|
|
252
|
+
|
|
253
|
+
- **`/init`**
|
|
254
|
+
- **Description:** To help users easily create a `GEMINI.md` file, this
|
|
255
|
+
command analyzes the current directory and generates a tailored context
|
|
256
|
+
file, making it simpler for them to provide project-specific instructions to
|
|
257
|
+
the Gemini agent.
|
|
258
|
+
|
|
259
|
+
### Custom commands
|
|
260
|
+
|
|
261
|
+
Custom commands allow you to create personalized shortcuts for your most-used
|
|
262
|
+
prompts. For detailed instructions on how to create, manage, and use them,
|
|
263
|
+
please see the dedicated [Custom Commands documentation](./custom-commands.md).
|
|
264
|
+
|
|
265
|
+
## Input prompt shortcuts
|
|
266
|
+
|
|
267
|
+
These shortcuts apply directly to the input prompt for text manipulation.
|
|
268
|
+
|
|
269
|
+
- **Undo:**
|
|
270
|
+
- **Keyboard shortcut:** Press **Ctrl+z** to undo the last action in the input
|
|
271
|
+
prompt.
|
|
272
|
+
|
|
273
|
+
- **Redo:**
|
|
274
|
+
- **Keyboard shortcut:** Press **Ctrl+Shift+Z** to redo the last undone action
|
|
275
|
+
in the input prompt.
|
|
276
|
+
|
|
277
|
+
## At commands (`@`)
|
|
278
|
+
|
|
279
|
+
At commands are used to include the content of files or directories as part of
|
|
280
|
+
your prompt to Gemini. These commands include git-aware filtering.
|
|
281
|
+
|
|
282
|
+
- **`@<path_to_file_or_directory>`**
|
|
283
|
+
- **Description:** Inject the content of the specified file or files into your
|
|
284
|
+
current prompt. This is useful for asking questions about specific code,
|
|
285
|
+
text, or collections of files.
|
|
286
|
+
- **Examples:**
|
|
287
|
+
- `@path/to/your/file.txt Explain this text.`
|
|
288
|
+
- `@src/my_project/ Summarize the code in this directory.`
|
|
289
|
+
- `What is this file about? @README.md`
|
|
290
|
+
- **Details:**
|
|
291
|
+
- If a path to a single file is provided, the content of that file is read.
|
|
292
|
+
- If a path to a directory is provided, the command attempts to read the
|
|
293
|
+
content of files within that directory and any subdirectories.
|
|
294
|
+
- Spaces in paths should be escaped with a backslash (e.g.,
|
|
295
|
+
`@My\ Documents/file.txt`).
|
|
296
|
+
- The command uses the `read_many_files` tool internally. The content is
|
|
297
|
+
fetched and then inserted into your query before being sent to the Gemini
|
|
298
|
+
model.
|
|
299
|
+
- **Git-aware filtering:** By default, git-ignored files (like
|
|
300
|
+
`node_modules/`, `dist/`, `.env`, `.git/`) are excluded. This behavior can
|
|
301
|
+
be changed via the `context.fileFiltering` settings.
|
|
302
|
+
- **File types:** The command is intended for text-based files. While it
|
|
303
|
+
might attempt to read any file, binary files or very large files might be
|
|
304
|
+
skipped or truncated by the underlying `read_many_files` tool to ensure
|
|
305
|
+
performance and relevance. The tool indicates if files were skipped.
|
|
306
|
+
- **Output:** The CLI will show a tool call message indicating that
|
|
307
|
+
`read_many_files` was used, along with a message detailing the status and
|
|
308
|
+
the path(s) that were processed.
|
|
309
|
+
|
|
310
|
+
- **`@` (Lone at symbol)**
|
|
311
|
+
- **Description:** If you type a lone `@` symbol without a path, the query is
|
|
312
|
+
passed as-is to the Gemini model. This might be useful if you are
|
|
313
|
+
specifically talking _about_ the `@` symbol in your prompt.
|
|
314
|
+
|
|
315
|
+
### Error handling for `@` commands
|
|
316
|
+
|
|
317
|
+
- If the path specified after `@` is not found or is invalid, an error message
|
|
318
|
+
will be displayed, and the query might not be sent to the Gemini model, or it
|
|
319
|
+
will be sent without the file content.
|
|
320
|
+
- If the `read_many_files` tool encounters an error (e.g., permission issues),
|
|
321
|
+
this will also be reported.
|
|
322
|
+
|
|
323
|
+
## Shell mode and passthrough commands (`!`)
|
|
324
|
+
|
|
325
|
+
The `!` prefix lets you interact with your system's shell directly from within
|
|
326
|
+
Gemini CLI.
|
|
327
|
+
|
|
328
|
+
- **`!<shell_command>`**
|
|
329
|
+
- **Description:** Execute the given `<shell_command>` using `bash` on
|
|
330
|
+
Linux/macOS or `powershell.exe -NoProfile -Command` on Windows (unless you
|
|
331
|
+
override `ComSpec`). Any output or errors from the command are displayed in
|
|
332
|
+
the terminal.
|
|
333
|
+
- **Examples:**
|
|
334
|
+
- `!ls -la` (executes `ls -la` and returns to Gemini CLI)
|
|
335
|
+
- `!git status` (executes `git status` and returns to Gemini CLI)
|
|
336
|
+
|
|
337
|
+
- **`!` (Toggle shell mode)**
|
|
338
|
+
- **Description:** Typing `!` on its own toggles shell mode.
|
|
339
|
+
- **Entering shell mode:**
|
|
340
|
+
- When active, shell mode uses a different coloring and a "Shell Mode
|
|
341
|
+
Indicator".
|
|
342
|
+
- While in shell mode, text you type is interpreted directly as a shell
|
|
343
|
+
command.
|
|
344
|
+
- **Exiting shell mode:**
|
|
345
|
+
- When exited, the UI reverts to its standard appearance and normal Gemini
|
|
346
|
+
CLI behavior resumes.
|
|
347
|
+
|
|
348
|
+
- **Caution for all `!` usage:** Commands you execute in shell mode have the
|
|
349
|
+
same permissions and impact as if you ran them directly in your terminal.
|
|
350
|
+
|
|
351
|
+
- **Environment variable:** When a command is executed via `!` or in shell mode,
|
|
352
|
+
the `GEMINI_CLI=1` environment variable is set in the subprocess's
|
|
353
|
+
environment. This allows scripts or tools to detect if they are being run from
|
|
354
|
+
within the Gemini CLI.
|