You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Design and implement extension auto-updating #7009
Add gemini extensions link command for creating symlinks to local folders. This can be used in place of gemini extensions install --path to create auto-updating behavior.
Add update settings in to the extensions folder and allow those to be set both by the extension and by the user via commands
In gemini cli core, check for extension updates after the CLI has started up and make updates in the background. Inform the user of the updates and encourage them to re-start once completed.
We should also add a few UI updates in case the user disables auto-updates:
gemini extensions list
another-example-extension (0.0.1) [Update available → 0.0.2]
Path: /Users/chrstn/.gemini/extensions/another-example-extension
Source: /Users/chrstn/another-example-extension
example-extension (0.0.1)
Path: /Users/chrstn/.gemini/extensions/example-extension
Source: /Users/chrstn/example-extension
Run `gemini extensions update -a` to update all extensions.
Extensions will auto-update after starting the Gemini CLI if {whatever setttings file} has auto-updates are enabled.
gemini homepage
Updating state:
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
| New versions of extensions are available! |
├── [email protected] → 1.0.1 |
├── [email protected] → 1.0.1 |
├── ... |
| |
| Attempting to automatically update now... |
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Finished state:
Extensions update successful! The new versions will be used on your next run.
For extensions installed via git, it would be really helpful to be able to specify the ref/branch/tag and sub-path for where to install an extension from.
I'm authoring an extension for Gemini CLI, but I don't want to make a completely separate repo to hold it: I'd like to add it to an existing repo. Without the ability to specify a sub-path, I can't do that. And my users can't pin the extension at a particular version without being able to specify a ref, branch and/or tag.
I'd suggest having two arguments to gemini extensions install which allows providing the ref (which can also be a branch or tag), and/or path.
I will start looking at this, it looks like we already have gemini extensions link and also general updating is already implemented, so we just need the auto-updating for git extensions specifically.
I think from a UX perspective it might be nice to just check if updates are available, and then add support for actually updating them to the /extensions slash command which works identically to the top level extensions update command. So basically we would just log an info message saying Some extensions have available updates, run "/extensions update" to update them: (add in additional info about the available updates).
We could also add support for reloading extensions during a session, similar to how /mcp refresh works. We would automatically refresh after updating, but also allow a manual refresh any time which would make local development easier so you don't have to fully restart gemini-cli.
We could also add a setting for auto-updating without asking, but I think it should be a setting (and probably off by default but I could go either way on that).
We could also add a setting for auto-updating without asking, but I think it should be a setting (and probably off by default but I could go either way on that).
I'd say it should definitely be off by default. It's seems like a security risk to auto-update (e.g. someone puts out an innocuous extension, you review the prompts when you install, and then they update it later with malicious code).
Also, if you work with a command, you get to know what to expect from it. If it's on by default, then the command could keep changing behavior without you knowing why or expecting it.
@chrstnb in terms of the actual setting here, do we want this to be a file in the extension directory itself?
It could be a part of the .gemini-extension-install.json file for example, and we could add an --auto-update flag to gemini extensions install which would set that value - and then probably also a way to update it from the /extensions list view.
Alternatively, it could just be a top level object in the main config (map of extension names to booleans?) - but really we would only want to support it in the user level config since extensions are global afaik.
If we anticipate more per-extension settings we might want to make it an object in the user config for each extension and not just a boolean also, so something like "extensions": { "my extension": {"auto_update": true}}
But, if we just slot it into the .gemini-extension-install.json file then its a bit easier, just add a new top level setting to that, and it will work regardless of at what levels we allow extensions to be installed later on. But, it might be harder to discover for people if its separate from normal settings.
Thanks for getting this thread going. This is a really important part of the extension experience to get right.
I'd like to make the case that we should strongly consider following the VS Code model and make auto-updates the default, opt-out behavior for Gemini CLI extensions. I believe it would be a mistake to not follow that model from the outset.
Case for "On by Default"
The modern expectation for developer tooling ecosystems (browsers, IDEs like VS Code, etc.) is that they stay up-to-date automatically. Forcing users to manually pull updates introduces friction and leads to several problems:
Ecosystem Fragmentation: Many users will inevitably ignore the update notifications, leaving a large portion of the user base on older, buggier, and potentially less secure versions. This increases the support burden for extension developers who have to debug issues that have already been fixed.
Security: While Spencer's point about malicious updates is valid, the more common and immediate security risk is users running outdated extensions with known vulnerabilities. An auto-update system ensures security patches are deployed to the largest number of users as quickly as possible.
Seamless User Experience: Users get the benefit of new features and bug fixes without having to think about it. The system just gets better over time.
Addressing Security
I believe we can solve these at the ecosystem level, which is a more robust solution than placing the burden on the end-user. The long-term solution here isn't manual updates; it's a trusted extension registry. Similar to the VS Code Marketplace, we can introduce concepts like verified publishers and a reviewing system. This moves the trust decision from "do I trust this specific update?" (which few will ever code-review) to "do I trust this publisher?".
@chrstnb Also has other ideas here in an internal proposal for the short-term to ensure that extensions are safe and sandboxed.
Proposed model
Auto-update is enabled by default for all extensions.
The updater automatically applies updates in the background, respecting SemVer.
We provide a clear, global setting for users who want full manual control.
After a successful auto-update, we can show a subtle, one-time notification like: "The Security extension was updated to v1.2.1. View changelog."
Reacted by Jack Wotherspoon, Justin Mahood and Dmitry Lyalin
The updater automatically applies updates in the background, respecting SemVer.
In terms of semantic versioning, how does that apply to extensions? There is no version solving or direct interaction between extensions afaik, so I am not exactly sure what a breaking change would be for an extension. It could be just removing a command or changing the behavior of a command significantly?
If the goal is to eventually allow extensions to depend on other extensions (maybe even invoking them directly somehow), then semantic versioning would come into play more.
Note that for git repositories, unless we are very strict about how you install them (requiring GitHub releases with valid semantic versions?), I don't think we can actually detect the version without fully cloning the whole repo. My current PR just checks if the commit at HEAD for the specified ref is different than when it was last fetched, because that is cheap to do.
Hi, thanks for working on this. I'm interested in this approach as our team has an extension that we use to enable Gemini CLI users to leverage Genkit knowledge.
We currently have a dedicated CLI command that sets up/updates the gemini extension folder.
The way I see this is:
if using a remote repo to track the extension, then the repo is dedicated to gemini-cli only since this is a concept unique to gemini-cli. The dev is responsible for organizing their code/context to support other integrations. The advantage is gemini will auto-update by pulling from the repo. For us, this is less feasible since we need to juggle the context between this repo and other integrations.
if using a local source dir with symlinks, there is no repo to track or maintain, but the dev should update their local source to update the extension. This does not seem very different to what we do right now -- editing the .gemini/extensions content directly.
Is my understanding correct? Is there a way we can leverage the repo approach to work with multiple integrations?
Is there a way we can leverage the repo approach to work with multiple integrations?
By this do you mean you have multiple extensions in one repo? We're currently trying to encourage 1 repo: 1 extension
By this do you mean you have multiple extensions in one repo? We're currently trying to encourage 1 repo: 1 extension
Is that at the root of what you're asking?
Hmm, not exactly, we have multiple integrations (Gemini CLI, Firebase Studio, etc.) that all rely on the same GENKIT.md context file. We basically use file-references in the tool-specific context files (eg: "Use this for Genkit: @./GENKIT.MD", in GEMINI.md, and similar approach for others).
If we want to leverage the proposed-auto update mechanism, it sounds like we should have a dedicated repo for the Gemini CLI extension, and either,
a) keep a copy of our GENKIT.md file synced between this repo and other places to use with the rest of our integrators, or
b) Use some in-house mechanism to perform this sync automatically.
It sounds great from a gemini-cli perspective, but I'm wondering if there's a better way (for us, as extension maintainers) to support our other integrators too, without splitting our workflow in this manner.
Activity
evanotero commentedon Aug 25, 2025
We should also add a few UI updates in case the user disables auto-updates:
gemini extensions listgeminihomepageUpdating state:
Finished state:
Failed state:
gspencergoog commentedon Sep 3, 2025
For extensions installed via git, it would be really helpful to be able to specify the ref/branch/tag and sub-path for where to install an extension from.
I'm authoring an extension for Gemini CLI, but I don't want to make a completely separate repo to hold it: I'd like to add it to an existing repo. Without the ability to specify a sub-path, I can't do that. And my users can't pin the extension at a particular version without being able to specify a ref, branch and/or tag.
I'd suggest having two arguments to
gemini extensions installwhich allows providing the ref (which can also be a branch or tag), and/or path.jakemac53 commentedon Sep 5, 2025
@gspencergoog can you file a separate issue for those?
I am also curious if you have thoughts on the desired auto-updating behavior.
jakemac53 commentedon Sep 5, 2025
I will start looking at this, it looks like we already have
gemini extensions linkand also general updating is already implemented, so we just need the auto-updating for git extensions specifically.jakemac53 commentedon Sep 5, 2025
I think from a UX perspective it might be nice to just check if updates are available, and then add support for actually updating them to the
/extensionsslash command which works identically to the top levelextensions updatecommand. So basically we would just log an info message sayingSome extensions have available updates, run "/extensions update" to update them: (add in additional info about the available updates).We could also add support for reloading extensions during a session, similar to how
/mcp refreshworks. We would automatically refresh after updating, but also allow a manual refresh any time which would make local development easier so you don't have to fully restart gemini-cli.jakemac53 commentedon Sep 5, 2025
We could also add a setting for auto-updating without asking, but I think it should be a setting (and probably off by default but I could go either way on that).
gspencergoog commentedon Sep 5, 2025
Added #7808
gspencergoog commentedon Sep 5, 2025
I'd say it should definitely be off by default. It's seems like a security risk to auto-update (e.g. someone puts out an innocuous extension, you review the prompts when you install, and then they update it later with malicious code).
Also, if you work with a command, you get to know what to expect from it. If it's on by default, then the command could keep changing behavior without you knowing why or expecting it.
jakemac53 commentedon Sep 8, 2025
@chrstnb in terms of the actual setting here, do we want this to be a file in the extension directory itself?
It could be a part of the
.gemini-extension-install.jsonfile for example, and we could add an--auto-updateflag togemini extensions installwhich would set that value - and then probably also a way to update it from the/extensionslist view.Alternatively, it could just be a top level object in the main config (map of extension names to booleans?) - but really we would only want to support it in the user level config since extensions are global afaik.
If we anticipate more per-extension settings we might want to make it an object in the user config for each extension and not just a boolean also, so something like
"extensions": { "my extension": {"auto_update": true}}But, if we just slot it into the
.gemini-extension-install.jsonfile then its a bit easier, just add a new top level setting to that, and it will work regardless of at what levels we allow extensions to be installed later on. But, it might be harder to discover for people if its separate from normal settings.evanotero commentedon Sep 8, 2025
Thanks for getting this thread going. This is a really important part of the extension experience to get right.
I'd like to make the case that we should strongly consider following the VS Code model and make auto-updates the default, opt-out behavior for Gemini CLI extensions. I believe it would be a mistake to not follow that model from the outset.
Case for "On by Default"
The modern expectation for developer tooling ecosystems (browsers, IDEs like VS Code, etc.) is that they stay up-to-date automatically. Forcing users to manually pull updates introduces friction and leads to several problems:
Ecosystem Fragmentation: Many users will inevitably ignore the update notifications, leaving a large portion of the user base on older, buggier, and potentially less secure versions. This increases the support burden for extension developers who have to debug issues that have already been fixed.
Security: While Spencer's point about malicious updates is valid, the more common and immediate security risk is users running outdated extensions with known vulnerabilities. An auto-update system ensures security patches are deployed to the largest number of users as quickly as possible.
Seamless User Experience: Users get the benefit of new features and bug fixes without having to think about it. The system just gets better over time.
Addressing Security
I believe we can solve these at the ecosystem level, which is a more robust solution than placing the burden on the end-user. The long-term solution here isn't manual updates; it's a trusted extension registry. Similar to the VS Code Marketplace, we can introduce concepts like verified publishers and a reviewing system. This moves the trust decision from "do I trust this specific update?" (which few will ever code-review) to "do I trust this publisher?".
@chrstnb Also has other ideas here in an internal proposal for the short-term to ensure that extensions are safe and sandboxed.
Proposed model
Auto-update is enabled by default for all extensions.
The updater automatically applies updates in the background, respecting SemVer.
We provide a clear, global setting for users who want full manual control.
After a successful auto-update, we can show a subtle, one-time notification like: "The Security extension was updated to v1.2.1. View changelog."
jakemac53 commentedon Sep 8, 2025
In terms of semantic versioning, how does that apply to extensions? There is no version solving or direct interaction between extensions afaik, so I am not exactly sure what a breaking change would be for an extension. It could be just removing a command or changing the behavior of a command significantly?
If the goal is to eventually allow extensions to depend on other extensions (maybe even invoking them directly somehow), then semantic versioning would come into play more.
Note that for git repositories, unless we are very strict about how you install them (requiring GitHub releases with valid semantic versions?), I don't think we can actually detect the version without fully cloning the whole repo. My current PR just checks if the commit at HEAD for the specified ref is different than when it was last fetched, because that is cheap to do.
ssbushi commentedon Sep 10, 2025
Hi, thanks for working on this. I'm interested in this approach as our team has an extension that we use to enable Gemini CLI users to leverage Genkit knowledge.
We currently have a dedicated CLI command that sets up/updates the gemini extension folder.
The way I see this is:
if using a remote repo to track the extension, then the repo is dedicated to gemini-cli only since this is a concept unique to gemini-cli. The dev is responsible for organizing their code/context to support other integrations. The advantage is gemini will auto-update by pulling from the repo. For us, this is less feasible since we need to juggle the context between this repo and other integrations.
if using a local source dir with symlinks, there is no repo to track or maintain, but the dev should update their local source to update the extension. This does not seem very different to what we do right now -- editing the
.gemini/extensionscontent directly.Is my understanding correct? Is there a way we can leverage the repo approach to work with multiple integrations?
Thanks,
Sam.
chrstnb commentedon Sep 10, 2025
Is that at the root of what you're asking?
ssbushi commentedon Sep 10, 2025
Hmm, not exactly, we have multiple integrations (Gemini CLI, Firebase Studio, etc.) that all rely on the same
GENKIT.mdcontext file. We basically use file-references in the tool-specific context files (eg:"Use this for Genkit: @./GENKIT.MD", inGEMINI.md, and similar approach for others).If we want to leverage the proposed-auto update mechanism, it sounds like we should have a dedicated repo for the Gemini CLI extension, and either,
a) keep a copy of our GENKIT.md file synced between this repo and other places to use with the rest of our integrators, or
b) Use some in-house mechanism to perform this sync automatically.
It sounds great from a
gemini-cliperspective, but I'm wondering if there's a better way (for us, as extension maintainers) to support our other integrators too, without splitting our workflow in this manner.Hope this makes sense.