[extensions] Add an initial set of extension variables (#7035)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
christine betts
2025-08-26 02:13:16 +00:00
committed by GitHub
parent 75b1e01bb0
commit b6cca01161
6 changed files with 166 additions and 5 deletions

View File

@@ -87,3 +87,14 @@ You can install extensions using the `install` command. This command allows you
- `source <url> positional argument`: The URL of a Git repository to install the extension from. The repository must contain a `gemini-extension.json` file in its root.
- `--path <path>`: The path to a local directory to install as an extension. The directory must contain a `gemini-extension.json` file.
# Variables
Gemini CLI extensions allow variable substitution in `gemini-extension.json`. This can be useful if e.g., you need the current directory to run an MCP server using `"cwd": "${extensionPath}${/}run.ts"`.
**Supported variables:**
| variable | description |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `${extensionPath}` | The fully-qualified path of the extension in the user's filesystem e.g., '/Users/username/.gemini/extensions/example-extension'. This will not unwrap symlinks. |
| `${/} or ${pathSeparator}` | The path separator (differs per OS). |