Repository navigation
Description
What would you like to be added?
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'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.
For example, I'd like to be able to do this:
gemini extensions install --source https://github.com/flutter/ai-guidance.git --ref beta --path gemini-cli/extensions/flutterOf course, --ref and --path are only valid for Git sourced extensions.
The .gemini-extension-install.json would then contain:
{
"source": "https://github.com/flutter/ai-guidance.git",
"ref": "beta",
"path": "gemini-cli/flutter",
"type": "git"
}Installing it would be a sparse fetch that only includes the path specified, moved to the root of the checkout, which could be the equivalent of:
git archive --remote=<repo_url> <ref> <path/to/dir> | tar -xUpdating the install would fetch the ref HEAD. If the ref is a branch, it would fetch the latest HEAD, if it is a tag, it will fetch the ref that the tag now points to, and if it's just a fixed ref, it would re-fetch the files at that ref and overwrite them. before fetching, any existing files in the extension would need to be removed, so that removes would also be supported.
We might have to save a manifest in the .gemini-extension-install.json or another file so we know what files to remove, because a user could add their own files, and we don't want to just nuke the directory, do we? If we're OK with just nuking the extension directory before re-install, then that works as well.
We can't make the extension directory be an actual Git repo because
- sparse checkout doesn't support checking out the files to a location other than their actual relative location, and
- even though the checkout is sparse, the whole git repo (at least the latest commit) would have to be synced to the .git, which could be larger than the user is expecting (imagine using a path inside of the Flutter repo for an extension).
(related to Ithis issue )
Why is this needed?
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. Also, even if I'm fine with making a whole repo for each extension, it can contain a lot of boilerplate that the extension doesn't need (README.md, any other rules files I have there for other agents, git actions, etc.), and can confuse things. And allowing specifying of a branch/ref/tag helps users manage the channel they are on.
Additional context
No response
Activity
gemini-cli commentedon Sep 5, 2025
This is a well-defined feature request to enhance the Git extension installation process by adding support for specifying a ref and a sub-path. This falls under area/extensibility and is classified as a kind/enhancement. The priority is set to P2 as it is a valuable improvement but not a critical bug.
jakemac53 commentedon Sep 18, 2025
Unassigned myself, we are not working on sub-path support at this time. The ref support is in though.
gemini-cli commentedon Dec 7, 2025
Hello! As part of our effort to keep our backlog manageable and focus on the most active issues, we are tidying up older reports.
It looks like this issue hasn't been active for a while, so we are closing it for now. However, if you are still experiencing this bug on the latest stable build, please feel free to comment on this issue or create a new one with updated details.
Thank you for your contribution!
gspencergoog commentedon Dec 8, 2025
This is a feature request that is still missing sub-path specification. I got around it by using Github releases that only contain the files I wanted.