Skip to content

Design and implement extension auto-updating #7009

Closed

Description

@chrstnb

Preliminary proposal:

  • 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.

Activity

  1. added this to the Q3 '2025 milestone on Aug 25, 2025
  2. added theissue type on Aug 25, 2025
  3. evanotero commented on Aug 25, 2025

    @evanotero
    Contributor

    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.
    

    Failed state:

    Automatic update failed. Please try updating manually using `gemini extensions update -a`.
    
  4. added
    priority/p2
    on Aug 29, 2025
  5. gspencergoog commented on Sep 3, 2025

    @gspencergoog

    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.

  6. jakemac53 commented on Sep 5, 2025

    @jakemac53
    Contributor

    @gspencergoog can you file a separate issue for those?

    I am also curious if you have thoughts on the desired auto-updating behavior.

  7. self-assigned this
    on Sep 5, 2025
  8. jakemac53 commented on Sep 5, 2025

    @jakemac53
    Contributor

    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.

  9. jakemac53 commented on Sep 5, 2025

    @jakemac53
    Contributor

    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.

  10. jakemac53 commented on Sep 5, 2025

    @jakemac53
    Contributor

    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).

  11. gspencergoog commented on Sep 5, 2025

    @gspencergoog

    Added #7808

  12. gspencergoog commented on Sep 5, 2025

    @gspencergoog

    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.

  13. jakemac53 commented on Sep 8, 2025

    @jakemac53
    Contributor

    @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.

  14. evanotero commented on Sep 8, 2025

    @evanotero
    Contributor

    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:

    1. 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.

    2. 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.

    3. 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

    1. Auto-update is enabled by default for all extensions.

    2. The updater automatically applies updates in the background, respecting SemVer.

    3. We provide a clear, global setting for users who want full manual control.

    4. 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."

  15. jakemac53 commented on Sep 8, 2025

    @jakemac53
    Contributor
    • 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.

  16. ssbushi commented on Sep 10, 2025

    @ssbushi

    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?

    Thanks,
    Sam.

  17. chrstnb commented on Sep 10, 2025

    @chrstnb
    ContributorAuthor

    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

    Is that at the root of what you're asking?

  18. ssbushi commented on Sep 10, 2025

    @ssbushi

    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.

    Hope this makes sense.

  19. removed
    priority/p2
    on Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions