@thacio/auditaria 0.30.11 → 0.30.13
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/README.md +14 -10
- package/bundle/docs/admin/enterprise-controls.md +115 -0
- package/bundle/docs/changelogs/index.md +20 -1
- package/bundle/docs/changelogs/latest.md +359 -293
- package/bundle/docs/changelogs/preview.md +296 -349
- package/bundle/docs/cli/checkpointing.md +2 -3
- package/bundle/docs/cli/cli-reference.md +4 -5
- package/bundle/docs/cli/commands.md +376 -650
- package/bundle/docs/cli/custom-commands.md +3 -0
- package/bundle/docs/cli/enterprise.md +1 -1
- package/bundle/docs/cli/gemini-md.md +20 -12
- package/bundle/docs/cli/headless.md +34 -372
- package/bundle/docs/cli/keyboard-shortcuts.md +36 -35
- package/bundle/docs/cli/plan-mode.md +5 -1
- package/bundle/docs/cli/rewind.md +11 -11
- package/bundle/docs/cli/session-management.md +61 -44
- package/bundle/docs/cli/settings.md +10 -5
- package/bundle/docs/cli/skills.md +15 -8
- package/bundle/docs/cli/themes.md +85 -51
- package/bundle/docs/cli/tutorials/automation.md +187 -0
- package/bundle/docs/cli/tutorials/file-management.md +142 -0
- package/bundle/docs/cli/tutorials/mcp-setup.md +105 -0
- package/bundle/docs/cli/tutorials/memory-management.md +126 -0
- package/bundle/docs/cli/tutorials/session-management.md +105 -0
- package/bundle/docs/cli/tutorials/shell-commands.md +107 -0
- package/bundle/docs/cli/tutorials/skills-getting-started.md +36 -31
- package/bundle/docs/cli/tutorials/task-planning.md +93 -0
- package/bundle/docs/cli/tutorials/web-tools.md +78 -0
- package/bundle/docs/core/policy-engine.md +4 -2
- package/bundle/docs/core/subagents.md +38 -38
- package/bundle/docs/extensions/best-practices.md +102 -53
- package/bundle/docs/extensions/index.md +37 -21
- package/bundle/docs/extensions/reference.md +148 -216
- package/bundle/docs/extensions/releasing.md +93 -122
- package/bundle/docs/extensions/writing-extensions.md +87 -76
- package/bundle/docs/get-started/configuration.md +103 -61
- package/bundle/docs/get-started/examples.md +39 -119
- package/bundle/docs/get-started/index.md +5 -4
- package/bundle/docs/get-started/installation.md +110 -77
- package/bundle/docs/index.md +156 -108
- package/bundle/docs/releases.md +2 -2
- package/bundle/docs/sidebar.json +101 -61
- package/bundle/docs/tools/activate-skill.md +43 -0
- package/bundle/docs/tools/ask-user.md +1 -1
- package/bundle/docs/tools/file-system.md +43 -133
- package/bundle/docs/tools/index.md +92 -91
- package/bundle/docs/tools/internal-docs.md +46 -0
- package/bundle/docs/tools/mcp-server.md +2 -2
- package/bundle/docs/tools/memory.md +21 -40
- package/bundle/docs/tools/shell.md +43 -88
- package/bundle/docs/tools/todos.md +22 -44
- package/bundle/docs/tools/web-fetch.md +22 -46
- package/bundle/docs/tools/web-search.md +19 -29
- package/bundle/gemini.js +138556 -136594
- package/bundle/mcp-bridge.js +154 -143
- package/bundle/node_modules/@browserbasehq/stagehand/dist/index.js +165438 -0
- package/bundle/node_modules/@browserbasehq/stagehand/package.json +102 -0
- package/bundle/node_modules/@thacio/auditaria-search/dist/tsconfig.tsbuildinfo +1 -1
- package/bundle/web-client/components/EditorPanel.js +57 -36
- package/bundle/web-client/components/FileTreePanel.js +240 -59
- package/bundle/web-client/index.html +5 -1
- package/bundle/web-client/managers/EditorManager.js +190 -24
- package/bundle/web-client/managers/FileTreeManager.js +301 -69
- package/bundle/web-client/styles/file-browser.css +42 -0
- package/bundle/web-client/styles/themes.css +376 -0
- package/bundle/web-client/utils/theme-manager.js +33 -1
- package/package.json +7 -6
- package/bundle/docs/architecture.md +0 -80
- package/bundle/docs/cli/index.md +0 -67
- package/bundle/docs/cli/tutorials.md +0 -87
- package/bundle/docs/get-started/configuration-v1.md +0 -882
|
@@ -1,146 +1,117 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
There are two primary ways of releasing extensions to users:
|
|
4
|
-
|
|
5
|
-
- [Git repository](#releasing-through-a-git-repository)
|
|
6
|
-
- [Github Releases](#releasing-through-github-releases)
|
|
7
|
-
|
|
8
|
-
Git repository releases tend to be the simplest and most flexible approach,
|
|
9
|
-
while GitHub releases can be more efficient on initial install as they are
|
|
10
|
-
shipped as single archives instead of requiring a git clone which downloads each
|
|
11
|
-
file individually. Github releases may also contain platform specific archives
|
|
12
|
-
if you need to ship platform specific binary files.
|
|
13
|
-
|
|
14
|
-
## Releasing through a git repository
|
|
15
|
-
|
|
16
|
-
This is the most flexible and simple option. All you need to do is create a
|
|
17
|
-
publicly accessible git repo (such as a public github repository) and then users
|
|
18
|
-
can install your extension using `auditaria extensions install <your-repo-uri>`.
|
|
19
|
-
They can optionally depend on a specific ref (branch/tag/commit) using the
|
|
20
|
-
`--ref=<some-ref>` argument, this defaults to the default branch.
|
|
21
|
-
|
|
22
|
-
Whenever commits are pushed to the ref that a user depends on, they will be
|
|
23
|
-
prompted to update the extension. Note that this also allows for easy rollbacks,
|
|
24
|
-
the HEAD commit is always treated as the latest version regardless of the actual
|
|
25
|
-
version in the `gemini-extension.json` file.
|
|
26
|
-
|
|
27
|
-
### Managing release channels using a git repository
|
|
28
|
-
|
|
29
|
-
Users can depend on any ref from your git repo, such as a branch or tag, which
|
|
30
|
-
allows you to manage multiple release channels.
|
|
31
|
-
|
|
32
|
-
For instance, you can maintain a `stable` branch, which users can install this
|
|
33
|
-
way `auditaria extensions install <your-repo-uri> --ref=stable`. Or, you could
|
|
34
|
-
make this the default by treating your default branch as your stable release
|
|
35
|
-
branch, and doing development in a different branch (for instance called `dev`).
|
|
36
|
-
You can maintain as many branches or tags as you like, providing maximum
|
|
37
|
-
flexibility for you and your users.
|
|
38
|
-
|
|
39
|
-
Note that these `ref` arguments can be tags, branches, or even specific commits,
|
|
40
|
-
which allows users to depend on a specific version of your extension. It is up
|
|
41
|
-
to you how you want to manage your tags and branches.
|
|
42
|
-
|
|
43
|
-
### Example releasing flow using a git repo
|
|
44
|
-
|
|
45
|
-
While there are many options for how you want to manage releases using a git
|
|
46
|
-
flow, we recommend treating your default branch as your "stable" release branch.
|
|
47
|
-
This means that the default behavior for
|
|
48
|
-
`auditaria extensions install <your-repo-uri>` is to be on the stable release
|
|
49
|
-
branch.
|
|
50
|
-
|
|
51
|
-
Lets say you want to maintain three standard release channels, `stable`,
|
|
52
|
-
`preview`, and `dev`. You would do all your standard development in the `dev`
|
|
53
|
-
branch. When you are ready to do a preview release, you merge that branch into
|
|
54
|
-
your `preview` branch. When you are ready to promote your preview branch to
|
|
55
|
-
stable, you merge `preview` into your stable branch (which might be your default
|
|
56
|
-
branch or a different branch).
|
|
57
|
-
|
|
58
|
-
You can also cherry pick changes from one branch into another using
|
|
59
|
-
`git cherry-pick`, but do note that this will result in your branches having a
|
|
60
|
-
slightly divergent history from each other, unless you force push changes to
|
|
61
|
-
your branches on each release to restore the history to a clean slate (which may
|
|
62
|
-
not be possible for the default branch depending on your repository settings).
|
|
63
|
-
If you plan on doing cherry picks, you may want to avoid having your default
|
|
64
|
-
branch be the stable branch to avoid force-pushing to the default branch which
|
|
65
|
-
should generally be avoided.
|
|
66
|
-
|
|
67
|
-
## Releasing through GitHub releases
|
|
68
|
-
|
|
69
|
-
Auditaria extensions can be distributed through
|
|
70
|
-
[GitHub Releases](https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases).
|
|
71
|
-
This provides a faster and more reliable initial installation experience for
|
|
72
|
-
users, as it avoids the need to clone the repository.
|
|
73
|
-
|
|
74
|
-
Each release includes at least one archive file, which contains the full
|
|
75
|
-
contents of the repo at the tag that it was linked to. Releases may also include
|
|
76
|
-
[pre-built archives](#custom-pre-built-archives) if your extension requires some
|
|
77
|
-
build step or has platform specific binaries attached to it.
|
|
78
|
-
|
|
79
|
-
When checking for updates, auditaria will just look for the "latest" release on
|
|
80
|
-
github (you must mark it as such when creating the release), unless the user
|
|
81
|
-
installed a specific release by passing `--ref=<some-release-tag>`.
|
|
82
|
-
|
|
83
|
-
You may also install extensions with the `--pre-release` flag in order to get
|
|
84
|
-
the latest release regardless of whether it has been marked as "latest". This
|
|
85
|
-
allows you to test that your release works before actually pushing it to all
|
|
86
|
-
users.
|
|
1
|
+
# Release extensions
|
|
87
2
|
|
|
88
|
-
|
|
3
|
+
Release Auditaria CLI extensions to your users through a Git repository or
|
|
4
|
+
GitHub Releases.
|
|
5
|
+
|
|
6
|
+
Git repository releases are the simplest approach and offer the most flexibility
|
|
7
|
+
for managing development branches. GitHub Releases are more efficient for
|
|
8
|
+
initial installations because they ship as single archives rather than requiring
|
|
9
|
+
a full `git clone`. Use GitHub Releases if you need to include platform-specific
|
|
10
|
+
binary files.
|
|
11
|
+
|
|
12
|
+
## List your extension in the gallery
|
|
13
|
+
|
|
14
|
+
The [Gemini CLI extension gallery](https://geminicli.com/extensions/browse/)
|
|
15
|
+
automatically indexes public extensions to help users discover your work. You
|
|
16
|
+
don't need to submit an issue or email us to list your extension.
|
|
17
|
+
|
|
18
|
+
To have your extension automatically discovered and listed:
|
|
19
|
+
|
|
20
|
+
1. **Use a public repository:** Ensure your extension is hosted in a public
|
|
21
|
+
GitHub repository.
|
|
22
|
+
2. **Add the GitHub topic:** Add the `gemini-cli-extension` topic to your
|
|
23
|
+
repository's **About** section. Our crawler uses this topic to find new
|
|
24
|
+
extensions.
|
|
25
|
+
3. **Place the manifest at the root:** Ensure your `gemini-extension.json` file
|
|
26
|
+
is in the absolute root of the repository or the release archive.
|
|
27
|
+
|
|
28
|
+
Our system crawls tagged repositories daily. Once you tag your repository, your
|
|
29
|
+
extension will appear in the gallery if it passes validation.
|
|
30
|
+
|
|
31
|
+
## Release through a Git repository
|
|
32
|
+
|
|
33
|
+
Releasing through Git is the most flexible option. Create a public Git
|
|
34
|
+
repository and provide the URL to your users. They can then install your
|
|
35
|
+
extension using `auditaria extensions install <your-repo-uri>`.
|
|
36
|
+
|
|
37
|
+
Users can optionally depend on a specific branch, tag, or commit using the
|
|
38
|
+
`--ref` argument. For example:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
auditaria extensions install <your-repo-uri> --ref=stable
|
|
42
|
+
```
|
|
89
43
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
44
|
+
Whenever you push commits to the referenced branch, the CLI prompts users to
|
|
45
|
+
update their installation. The `HEAD` commit is always treated as the latest
|
|
46
|
+
version.
|
|
93
47
|
|
|
94
|
-
|
|
95
|
-
asset. In this case, there should be only one asset attached to the release.
|
|
48
|
+
### Manage release channels
|
|
96
49
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
the repo itself (for instance it might just be an archive of a subdirectory
|
|
100
|
-
containing the extension).
|
|
50
|
+
You can use branches or tags to manage different release channels, such as
|
|
51
|
+
`stable`, `preview`, or `dev`.
|
|
101
52
|
|
|
102
|
-
|
|
53
|
+
We recommend using your default branch as the stable release channel. This
|
|
54
|
+
ensures that the default installation command always provides the most reliable
|
|
55
|
+
version of your extension. You can then use a `dev` branch for active
|
|
56
|
+
development and merge it into the default branch when you are ready for a
|
|
57
|
+
release.
|
|
103
58
|
|
|
104
|
-
|
|
105
|
-
each platform, you must follow this naming convention. The CLI will search for
|
|
106
|
-
assets in the following order:
|
|
59
|
+
## Release through GitHub Releases
|
|
107
60
|
|
|
108
|
-
|
|
61
|
+
Distributing extensions through
|
|
62
|
+
[GitHub Releases](https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases)
|
|
63
|
+
provides a faster installation experience by avoiding a repository clone.
|
|
64
|
+
|
|
65
|
+
Auditaria CLI checks for updates by looking for the **Latest** release on
|
|
66
|
+
GitHub. Users can also install specific versions using the `--ref` argument with
|
|
67
|
+
a release tag. Use the `--pre-release` flag to install the latest version even
|
|
68
|
+
if it isn't marked as **Latest**.
|
|
69
|
+
|
|
70
|
+
### Custom pre-built archives
|
|
71
|
+
|
|
72
|
+
You can attach custom archives directly to your GitHub Release as assets. This
|
|
73
|
+
is useful if your extension requires a build step or includes platform-specific
|
|
74
|
+
binaries.
|
|
75
|
+
|
|
76
|
+
Custom archives must be fully self-contained and follow the required
|
|
77
|
+
[archive structure](#archive-structure). If your extension is
|
|
78
|
+
platform-independent, provide a single generic asset.
|
|
79
|
+
|
|
80
|
+
#### Platform-specific archives
|
|
81
|
+
|
|
82
|
+
To let Auditaria CLI find the correct asset for a user's platform, use the
|
|
83
|
+
following naming convention:
|
|
84
|
+
|
|
85
|
+
1. **Platform and architecture-specific:**
|
|
109
86
|
`{platform}.{arch}.{name}.{extension}`
|
|
110
87
|
2. **Platform-specific:** `{platform}.{name}.{extension}`
|
|
111
|
-
3. **Generic:**
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
- `{
|
|
120
|
-
- `x64`
|
|
121
|
-
- `arm64`
|
|
122
|
-
- `{extension}`: The file extension of the archive (e.g., `.tar.gz` or `.zip`).
|
|
88
|
+
3. **Generic:** A single asset will be used as a fallback if no specific match
|
|
89
|
+
is found.
|
|
90
|
+
|
|
91
|
+
Use these values for the placeholders:
|
|
92
|
+
|
|
93
|
+
- `{name}`: Your extension name.
|
|
94
|
+
- `{platform}`: Use `darwin` (macOS), `linux`, or `win32` (Windows).
|
|
95
|
+
- `{arch}`: Use `x64` or `arm64`.
|
|
96
|
+
- `{extension}`: Use `.tar.gz` or `.zip`.
|
|
123
97
|
|
|
124
98
|
**Examples:**
|
|
125
99
|
|
|
126
100
|
- `darwin.arm64.my-tool.tar.gz` (specific to Apple Silicon Macs)
|
|
127
|
-
- `darwin.my-tool.tar.gz` (for all Macs)
|
|
101
|
+
- `darwin.my-tool.tar.gz` (fallback for all Macs, e.g. Intel)
|
|
128
102
|
- `linux.x64.my-tool.tar.gz`
|
|
129
103
|
- `win32.my-tool.zip`
|
|
130
104
|
|
|
131
105
|
#### Archive structure
|
|
132
106
|
|
|
133
|
-
Archives must be fully contained extensions
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
The rest of the layout should look exactly the same as a typical extension, see
|
|
138
|
-
[extensions.md](extension.md).
|
|
107
|
+
Archives must be fully contained extensions. The `gemini-extension.json` file
|
|
108
|
+
must be at the root of the archive. The rest of the layout should match a
|
|
109
|
+
standard extension structure.
|
|
139
110
|
|
|
140
111
|
#### Example GitHub Actions workflow
|
|
141
112
|
|
|
142
|
-
|
|
143
|
-
|
|
113
|
+
Use this example workflow to build and release your extension for multiple
|
|
114
|
+
platforms:
|
|
144
115
|
|
|
145
116
|
```yaml
|
|
146
117
|
name: Release Extension
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Build Gemini CLI extensions
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
Gemini CLI extensions let you expand the capabilities of Gemini CLI by adding
|
|
4
|
+
custom tools, commands, and context. This guide walks you through creating your
|
|
5
|
+
first extension, from setting up a template to adding custom functionality and
|
|
6
|
+
linking it for local development.
|
|
7
7
|
|
|
8
8
|
## Prerequisites
|
|
9
9
|
|
|
10
|
-
Before you start,
|
|
10
|
+
Before you start, ensure you have the Gemini CLI installed and a basic
|
|
11
11
|
understanding of Node.js.
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Extension features
|
|
14
14
|
|
|
15
|
-
Extensions offer
|
|
15
|
+
Extensions offer several ways to customize Gemini CLI. Use this table to decide
|
|
16
|
+
which features your extension needs.
|
|
16
17
|
|
|
17
18
|
| Feature | What it is | When to use it | Invoked by |
|
|
18
19
|
| :------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- |
|
|
@@ -21,11 +22,12 @@ Extensions offer a variety of ways to customize Gemini CLI.
|
|
|
21
22
|
| **[Context file (`GEMINI.md`)](reference.md#contextfilename)** | A markdown file containing instructions that are loaded into the model's context at the start of every session. | Use this to define the "personality" of your extension, set coding standards, or provide essential knowledge that the model should always have. | CLI provides to model |
|
|
22
23
|
| **[Agent skills](../cli/skills.md)** | A specialized set of instructions and workflows that the model activates only when needed. | Use this for complex, occasional tasks (like "create a PR" or "audit security") to avoid cluttering the main context window when the skill isn't being used. | Model |
|
|
23
24
|
| **[Hooks](../hooks/index.md)** | A way to intercept and customize the CLI's behavior at specific lifecycle events (e.g., before/after a tool call). | Use this when you want to automate actions based on what the model is doing, like validating tool arguments, logging activity, or modifying the model's input/output. | CLI |
|
|
25
|
+
| **[Custom themes](reference.md#themes)** | A set of color definitions to personalize the CLI UI. | Use this to provide a unique visual identity for your extension or to offer specialized high-contrast or thematic color schemes. | User (via /theme) |
|
|
24
26
|
|
|
25
27
|
## Step 1: Create a new extension
|
|
26
28
|
|
|
27
|
-
The easiest way to start is by using
|
|
28
|
-
|
|
29
|
+
The easiest way to start is by using a built-in template. We'll use the
|
|
30
|
+
`mcp-server` example as our foundation.
|
|
29
31
|
|
|
30
32
|
Run the following command to create a new directory called `my-first-extension`
|
|
31
33
|
with the template files:
|
|
@@ -34,7 +36,7 @@ with the template files:
|
|
|
34
36
|
gemini extensions new my-first-extension mcp-server
|
|
35
37
|
```
|
|
36
38
|
|
|
37
|
-
This
|
|
39
|
+
This creates a directory with the following structure:
|
|
38
40
|
|
|
39
41
|
```
|
|
40
42
|
my-first-extension/
|
|
@@ -45,12 +47,11 @@ my-first-extension/
|
|
|
45
47
|
|
|
46
48
|
## Step 2: Understand the extension files
|
|
47
49
|
|
|
48
|
-
|
|
50
|
+
Your new extension contains several key files that define its behavior.
|
|
49
51
|
|
|
50
52
|
### `gemini-extension.json`
|
|
51
53
|
|
|
52
|
-
|
|
53
|
-
and use your extension.
|
|
54
|
+
The manifest file tells Gemini CLI how to load and use your extension.
|
|
54
55
|
|
|
55
56
|
```json
|
|
56
57
|
{
|
|
@@ -68,17 +69,15 @@ and use your extension.
|
|
|
68
69
|
|
|
69
70
|
- `name`: The unique name for your extension.
|
|
70
71
|
- `version`: The version of your extension.
|
|
71
|
-
- `mcpServers`:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
with the absolute path to your extension's installation directory. This
|
|
76
|
-
allows your extension to work regardless of where it's installed.
|
|
72
|
+
- `mcpServers`: Defines Model Context Protocol (MCP) servers to add new tools.
|
|
73
|
+
- `command`, `args`, `cwd`: Specify how to start your server. The
|
|
74
|
+
`${extensionPath}` variable is replaced with the absolute path to your
|
|
75
|
+
extension's directory.
|
|
77
76
|
|
|
78
77
|
### `example.js`
|
|
79
78
|
|
|
80
|
-
This file contains the source code for your MCP server. It
|
|
81
|
-
|
|
79
|
+
This file contains the source code for your MCP server. It uses the
|
|
80
|
+
`@modelcontextprotocol/sdk` to define tools.
|
|
82
81
|
|
|
83
82
|
```javascript
|
|
84
83
|
/**
|
|
@@ -120,24 +119,49 @@ server.registerTool(
|
|
|
120
119
|
},
|
|
121
120
|
);
|
|
122
121
|
|
|
123
|
-
// ... (prompt registration omitted for brevity)
|
|
124
|
-
|
|
125
122
|
const transport = new StdioServerTransport();
|
|
126
123
|
await server.connect(transport);
|
|
127
124
|
```
|
|
128
125
|
|
|
129
|
-
This server defines a single tool called `fetch_posts` that fetches data from a
|
|
130
|
-
public API.
|
|
131
|
-
|
|
132
126
|
### `package.json`
|
|
133
127
|
|
|
134
|
-
|
|
135
|
-
|
|
128
|
+
The standard configuration file for a Node.js project. It defines dependencies
|
|
129
|
+
and scripts for your extension.
|
|
130
|
+
|
|
131
|
+
## Step 3: Add extension settings
|
|
132
|
+
|
|
133
|
+
Some extensions need configuration, such as API keys or user preferences. Let's
|
|
134
|
+
add a setting for an API key.
|
|
135
|
+
|
|
136
|
+
1. Open `gemini-extension.json`.
|
|
137
|
+
2. Add a `settings` array to the configuration:
|
|
138
|
+
|
|
139
|
+
```json
|
|
140
|
+
{
|
|
141
|
+
"name": "mcp-server-example",
|
|
142
|
+
"version": "1.0.0",
|
|
143
|
+
"settings": [
|
|
144
|
+
{
|
|
145
|
+
"name": "API Key",
|
|
146
|
+
"description": "The API key for the service.",
|
|
147
|
+
"envVar": "MY_SERVICE_API_KEY",
|
|
148
|
+
"sensitive": true
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
"mcpServers": {
|
|
152
|
+
// ...
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
When a user installs this extension, Gemini CLI will prompt them to enter the
|
|
158
|
+
"API Key". The value will be stored securely in the system keychain (because
|
|
159
|
+
`sensitive` is true) and injected into the MCP server's process as the
|
|
160
|
+
`MY_SERVICE_API_KEY` environment variable.
|
|
136
161
|
|
|
137
|
-
## Step
|
|
162
|
+
## Step 4: Link your extension
|
|
138
163
|
|
|
139
|
-
|
|
140
|
-
installation for local development.
|
|
164
|
+
Link your extension to your Gemini CLI installation for local development.
|
|
141
165
|
|
|
142
166
|
1. **Install dependencies:**
|
|
143
167
|
|
|
@@ -149,20 +173,19 @@ installation for local development.
|
|
|
149
173
|
2. **Link the extension:**
|
|
150
174
|
|
|
151
175
|
The `link` command creates a symbolic link from the Gemini CLI extensions
|
|
152
|
-
directory to your development directory.
|
|
153
|
-
|
|
176
|
+
directory to your development directory. Changes you make are reflected
|
|
177
|
+
immediately.
|
|
154
178
|
|
|
155
179
|
```bash
|
|
156
180
|
gemini extensions link .
|
|
157
181
|
```
|
|
158
182
|
|
|
159
|
-
|
|
160
|
-
|
|
183
|
+
Restart your Gemini CLI session to use the new `fetch_posts` tool. Test it by
|
|
184
|
+
asking: "fetch posts".
|
|
161
185
|
|
|
162
|
-
## Step
|
|
186
|
+
## Step 5: Add a custom command
|
|
163
187
|
|
|
164
|
-
Custom commands
|
|
165
|
-
a command that searches for a pattern in your code.
|
|
188
|
+
Custom commands create shortcuts for complex prompts.
|
|
166
189
|
|
|
167
190
|
1. Create a `commands` directory and a subdirectory for your command group:
|
|
168
191
|
|
|
@@ -181,18 +204,17 @@ a command that searches for a pattern in your code.
|
|
|
181
204
|
"""
|
|
182
205
|
```
|
|
183
206
|
|
|
184
|
-
This command, `/fs:grep-code`,
|
|
185
|
-
command
|
|
207
|
+
This command, `/fs:grep-code`, takes an argument, runs the `grep` shell
|
|
208
|
+
command, and pipes the results into a prompt for summarization.
|
|
186
209
|
|
|
187
|
-
After saving the file, restart
|
|
188
|
-
|
|
210
|
+
After saving the file, restart Gemini CLI. Run `/fs:grep-code "some pattern"` to
|
|
211
|
+
use your new command.
|
|
189
212
|
|
|
190
|
-
## Step
|
|
213
|
+
## Step 6: Add a custom `GEMINI.md`
|
|
191
214
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
need this for extensions built to expose commands and prompts.
|
|
215
|
+
Provide persistent context to the model by adding a `GEMINI.md` file to your
|
|
216
|
+
extension. This is useful for setting behavior or providing essential tool
|
|
217
|
+
information.
|
|
196
218
|
|
|
197
219
|
1. Create a file named `GEMINI.md` in the root of your extension directory:
|
|
198
220
|
|
|
@@ -203,7 +225,7 @@ need this for extensions built to expose commands and prompts.
|
|
|
203
225
|
posts, use the `fetch_posts` tool. Be concise in your responses.
|
|
204
226
|
```
|
|
205
227
|
|
|
206
|
-
2. Update your `gemini-extension.json` to
|
|
228
|
+
2. Update your `gemini-extension.json` to load this file:
|
|
207
229
|
|
|
208
230
|
```json
|
|
209
231
|
{
|
|
@@ -220,14 +242,13 @@ need this for extensions built to expose commands and prompts.
|
|
|
220
242
|
}
|
|
221
243
|
```
|
|
222
244
|
|
|
223
|
-
Restart
|
|
224
|
-
|
|
245
|
+
Restart Gemini CLI. The model now has the context from your `GEMINI.md` file in
|
|
246
|
+
every session where the extension is active.
|
|
225
247
|
|
|
226
|
-
## (Optional) Step
|
|
248
|
+
## (Optional) Step 7: Add an Agent Skill
|
|
227
249
|
|
|
228
|
-
[Agent Skills](../cli/skills.md)
|
|
229
|
-
|
|
230
|
-
skills are activated only when needed, saving context tokens.
|
|
250
|
+
[Agent Skills](../cli/skills.md) bundle specialized expertise and workflows.
|
|
251
|
+
Skills are activated only when needed, which saves context tokens.
|
|
231
252
|
|
|
232
253
|
1. Create a `skills` directory and a subdirectory for your skill:
|
|
233
254
|
|
|
@@ -254,28 +275,18 @@ skills are activated only when needed, saving context tokens.
|
|
|
254
275
|
3. Suggest remediation steps for any findings.
|
|
255
276
|
```
|
|
256
277
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
## Step 7: Release your extension
|
|
261
|
-
|
|
262
|
-
Once you're happy with your extension, you can share it with others. The two
|
|
263
|
-
primary ways of releasing extensions are via a Git repository or through GitHub
|
|
264
|
-
Releases. Using a public Git repository is the simplest method.
|
|
265
|
-
|
|
266
|
-
For detailed instructions on both methods, please refer to the
|
|
267
|
-
[Extension Releasing Guide](./releasing.md).
|
|
278
|
+
Gemini CLI automatically discovers skills bundled with your extension. The model
|
|
279
|
+
activates them when it identifies a relevant task.
|
|
268
280
|
|
|
269
|
-
##
|
|
281
|
+
## Step 8: Release your extension
|
|
270
282
|
|
|
271
|
-
|
|
283
|
+
When your extension is ready, share it with others via a Git repository or
|
|
284
|
+
GitHub Releases. Refer to the [Extension Releasing Guide](./releasing.md) for
|
|
285
|
+
detailed instructions and learn how to list your extension in the gallery.
|
|
272
286
|
|
|
273
|
-
|
|
274
|
-
- Add custom tools with an MCP server.
|
|
275
|
-
- Create convenient custom commands.
|
|
276
|
-
- Provide persistent context to the model.
|
|
277
|
-
- Bundle specialized Agent Skills.
|
|
278
|
-
- Link your extension for local development.
|
|
287
|
+
## Next steps
|
|
279
288
|
|
|
280
|
-
|
|
281
|
-
|
|
289
|
+
- [Extension reference](reference.md): Deeply understand the extension format,
|
|
290
|
+
commands, and configuration.
|
|
291
|
+
- [Best practices](best-practices.md): Learn strategies for building great
|
|
292
|
+
extensions.
|