mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 22:21:22 -07:00
docs: update command-line flag documentation (#12452)
This commit is contained in:
@@ -42,16 +42,19 @@ installed on your machine. See
|
|||||||
for help.
|
for help.
|
||||||
|
|
||||||
```
|
```
|
||||||
gemini extensions install https://github.com/gemini-cli-extensions/security
|
gemini extensions install <source> [--ref <ref>] [--auto-update] [--pre-release] [--consent]
|
||||||
```
|
```
|
||||||
|
|
||||||
This will install the Gemini CLI Security extension, which offers support for a
|
- `<source>`: The github URL or local path of the extension to install.
|
||||||
`/security:analyze` command.
|
- `--ref`: The git ref to install from.
|
||||||
|
- `--auto-update`: Enable auto-update for this extension.
|
||||||
|
- `--pre-release`: Enable pre-release versions for this extension.
|
||||||
|
- `--consent`: Acknowledge the security risks of installing an extension and
|
||||||
|
skip the confirmation prompt.
|
||||||
|
|
||||||
### Uninstalling an extension
|
### Uninstalling an extension
|
||||||
|
|
||||||
To uninstall, run `gemini extensions uninstall extension-name`, so, in the case
|
To uninstall, run `gemini extensions uninstall <name>`:
|
||||||
of the install example:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
gemini extensions uninstall gemini-cli-security
|
gemini extensions uninstall gemini-cli-security
|
||||||
@@ -62,27 +65,31 @@ gemini extensions uninstall gemini-cli-security
|
|||||||
Extensions are, by default, enabled across all workspaces. You can disable an
|
Extensions are, by default, enabled across all workspaces. You can disable an
|
||||||
extension entirely or for specific workspace.
|
extension entirely or for specific workspace.
|
||||||
|
|
||||||
For example, `gemini extensions disable extension-name` will disable the
|
```
|
||||||
extension at the user level, so it will be disabled everywhere.
|
gemini extensions disable <name> [--scope <scope>]
|
||||||
`gemini extensions disable extension-name --scope=workspace` will only disable
|
```
|
||||||
the extension in the current workspace.
|
|
||||||
|
- `<name>`: The name of the extension to disable.
|
||||||
|
- `--scope`: The scope to disable the extension in (`user` or `workspace`).
|
||||||
|
|
||||||
### Enabling an extension
|
### Enabling an extension
|
||||||
|
|
||||||
You can enable extensions using `gemini extensions enable extension-name`. You
|
You can enable extensions using `gemini extensions enable <name>`. You can also
|
||||||
can also enable an extension for a specific workspace using
|
enable an extension for a specific workspace using
|
||||||
`gemini extensions enable extension-name --scope=workspace` from within that
|
`gemini extensions enable <name> --scope=workspace` from within that workspace.
|
||||||
workspace.
|
|
||||||
|
|
||||||
This is useful if you have an extension disabled at the top-level and only
|
```
|
||||||
enabled in specific places.
|
gemini extensions enable <name> [--scope <scope>]
|
||||||
|
```
|
||||||
|
|
||||||
|
- `<name>`: The name of the extension to enable.
|
||||||
|
- `--scope`: The scope to enable the extension in (`user` or `workspace`).
|
||||||
|
|
||||||
### Updating an extension
|
### Updating an extension
|
||||||
|
|
||||||
For extensions installed from a local path or a git repository, you can
|
For extensions installed from a local path or a git repository, you can
|
||||||
explicitly update to the latest version (as reflected in the
|
explicitly update to the latest version (as reflected in the
|
||||||
`gemini-extension.json` `version` field) with
|
`gemini-extension.json` `version` field) with `gemini extensions update <name>`.
|
||||||
`gemini extensions update extension-name`.
|
|
||||||
|
|
||||||
You can update all extensions with:
|
You can update all extensions with:
|
||||||
|
|
||||||
@@ -90,10 +97,6 @@ You can update all extensions with:
|
|||||||
gemini extensions update --all
|
gemini extensions update --all
|
||||||
```
|
```
|
||||||
|
|
||||||
## Extension creation
|
|
||||||
|
|
||||||
We offer commands to make extension development easier.
|
|
||||||
|
|
||||||
### Create a boilerplate extension
|
### Create a boilerplate extension
|
||||||
|
|
||||||
We offer several example extensions `context`, `custom-commands`,
|
We offer several example extensions `context`, `custom-commands`,
|
||||||
@@ -104,9 +107,12 @@ To copy one of these examples into a development directory using the type of
|
|||||||
your choosing, run:
|
your choosing, run:
|
||||||
|
|
||||||
```
|
```
|
||||||
gemini extensions new path/to/directory custom-commands
|
gemini extensions new <path> [template]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- `<path>`: The path to create the extension in.
|
||||||
|
- `[template]`: The boilerplate template to use.
|
||||||
|
|
||||||
### Link a local extension
|
### Link a local extension
|
||||||
|
|
||||||
The `gemini extensions link` command will create a symbolic link from the
|
The `gemini extensions link` command will create a symbolic link from the
|
||||||
@@ -116,9 +122,11 @@ This is useful so you don't have to run `gemini extensions update` every time
|
|||||||
you make changes you'd like to test.
|
you make changes you'd like to test.
|
||||||
|
|
||||||
```
|
```
|
||||||
gemini extensions link path/to/directory
|
gemini extensions link <path>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- `<path>`: The path of the extension to link.
|
||||||
|
|
||||||
## How it works
|
## How it works
|
||||||
|
|
||||||
On startup, Gemini CLI looks for extensions in `<home>/.gemini/extensions`
|
On startup, Gemini CLI looks for extensions in `<home>/.gemini/extensions`
|
||||||
|
|||||||
@@ -736,15 +736,11 @@ for that specific session.
|
|||||||
`--output-format json` or `--output-format stream-json` flag.
|
`--output-format json` or `--output-format stream-json` flag.
|
||||||
- **`--sandbox`** (**`-s`**):
|
- **`--sandbox`** (**`-s`**):
|
||||||
- Enables sandbox mode for this session.
|
- Enables sandbox mode for this session.
|
||||||
- **`--sandbox-image`**:
|
|
||||||
- Sets the sandbox image URI.
|
|
||||||
- **`--debug`** (**`-d`**):
|
- **`--debug`** (**`-d`**):
|
||||||
- Enables debug mode for this session, providing more verbose output.
|
- Enables debug mode for this session, providing more verbose output.
|
||||||
|
|
||||||
- **`--help`** (or **`-h`**):
|
- **`--help`** (or **`-h`**):
|
||||||
- Displays help information about command-line arguments.
|
- Displays help information about command-line arguments.
|
||||||
- **`--show-memory-usage`**:
|
|
||||||
- Displays the current memory usage.
|
|
||||||
- **`--yolo`**:
|
- **`--yolo`**:
|
||||||
- Enables YOLO mode, which automatically approves all tool calls.
|
- Enables YOLO mode, which automatically approves all tool calls.
|
||||||
- **`--approval-mode <mode>`**:
|
- **`--approval-mode <mode>`**:
|
||||||
@@ -760,22 +756,6 @@ for that specific session.
|
|||||||
- A comma-separated list of tool names that will bypass the confirmation
|
- A comma-separated list of tool names that will bypass the confirmation
|
||||||
dialog.
|
dialog.
|
||||||
- Example: `gemini --allowed-tools "ShellTool(git status)"`
|
- Example: `gemini --allowed-tools "ShellTool(git status)"`
|
||||||
- **`--telemetry`**:
|
|
||||||
- Enables [telemetry](../cli/telemetry.md).
|
|
||||||
- **`--telemetry-target`**:
|
|
||||||
- Sets the telemetry target. See [telemetry](../cli/telemetry.md) for more
|
|
||||||
information.
|
|
||||||
- **`--telemetry-otlp-endpoint`**:
|
|
||||||
- Sets the OTLP endpoint for telemetry. See [telemetry](../cli/telemetry.md)
|
|
||||||
for more information.
|
|
||||||
- **`--telemetry-otlp-protocol`**:
|
|
||||||
- Sets the OTLP protocol for telemetry (`grpc` or `http`). Defaults to `grpc`.
|
|
||||||
See [telemetry](../cli/telemetry.md) for more information.
|
|
||||||
- **`--telemetry-log-prompts`**:
|
|
||||||
- Enables logging of prompts for telemetry. See
|
|
||||||
[telemetry](../cli/telemetry.md) for more information.
|
|
||||||
- **`--checkpointing`**:
|
|
||||||
- Enables [checkpointing](../cli/checkpointing.md).
|
|
||||||
- **`--extensions <extension_name ...>`** (**`-e <extension_name ...>`**):
|
- **`--extensions <extension_name ...>`** (**`-e <extension_name ...>`**):
|
||||||
- Specifies a list of extensions to use for the session. If not provided, all
|
- Specifies a list of extensions to use for the session. If not provided, all
|
||||||
available extensions are used.
|
available extensions are used.
|
||||||
@@ -783,9 +763,6 @@ for that specific session.
|
|||||||
- Example: `gemini -e my-extension -e my-other-extension`
|
- Example: `gemini -e my-extension -e my-other-extension`
|
||||||
- **`--list-extensions`** (**`-l`**):
|
- **`--list-extensions`** (**`-l`**):
|
||||||
- Lists all available extensions and exits.
|
- Lists all available extensions and exits.
|
||||||
- **`--proxy`**:
|
|
||||||
- Sets the proxy for the CLI.
|
|
||||||
- Example: `--proxy http://localhost:7890`.
|
|
||||||
- **`--include-directories <dir1,dir2,...>`**:
|
- **`--include-directories <dir1,dir2,...>`**:
|
||||||
- Includes additional directories in the workspace for multi-directory
|
- Includes additional directories in the workspace for multi-directory
|
||||||
support.
|
support.
|
||||||
@@ -798,6 +775,14 @@ for that specific session.
|
|||||||
with screen readers.
|
with screen readers.
|
||||||
- **`--version`**:
|
- **`--version`**:
|
||||||
- Displays the version of the CLI.
|
- Displays the version of the CLI.
|
||||||
|
- **`--experimental-acp`**:
|
||||||
|
- Starts the agent in ACP mode.
|
||||||
|
- **`--allowed-mcp-server-names`**:
|
||||||
|
- Allowed MCP server names.
|
||||||
|
- **`--fake-responses`**:
|
||||||
|
- Path to a file with fake model responses for testing.
|
||||||
|
- **`--record-responses`**:
|
||||||
|
- Path to a file to record model responses for testing.
|
||||||
|
|
||||||
## Context Files (Hierarchical Instructional Context)
|
## Context Files (Hierarchical Instructional Context)
|
||||||
|
|
||||||
|
|||||||
@@ -969,7 +969,8 @@ gemini mcp add --transport sse --header "Authorization: Bearer abc123" secure-ss
|
|||||||
### Listing Servers (`gemini mcp list`)
|
### Listing Servers (`gemini mcp list`)
|
||||||
|
|
||||||
To view all MCP servers currently configured, use the `list` command. It
|
To view all MCP servers currently configured, use the `list` command. It
|
||||||
displays each server's name, configuration details, and connection status.
|
displays each server's name, configuration details, and connection status. This
|
||||||
|
command has no flags.
|
||||||
|
|
||||||
**Command:**
|
**Command:**
|
||||||
|
|
||||||
@@ -996,6 +997,10 @@ server's name.
|
|||||||
gemini mcp remove <name>
|
gemini mcp remove <name>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Options (Flags):**
|
||||||
|
|
||||||
|
- `-s, --scope`: Configuration scope (user or project). [default: "project"]
|
||||||
|
|
||||||
**Example:**
|
**Example:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
Reference in New Issue
Block a user