Skip to content

feat(cli): support git submodules in extension installation#18387

Closed
thoreinstein wants to merge 1 commit intogoogle-gemini:mainfrom
thoreinstein:extension-git-submodules
Closed

feat(cli): support git submodules in extension installation#18387
thoreinstein wants to merge 1 commit intogoogle-gemini:mainfrom
thoreinstein:extension-git-submodules

Conversation

@thoreinstein
Copy link

@thoreinstein thoreinstein commented Feb 5, 2026

Summary

Supports recursive cloning and initialization of Git submodules when installing extensions. This ensures that extensions relying on submodules (e.g., for shared libraries or assets) are fully functional immediately after installation.

Details

  • Modified packages/cli/src/config/extensions/github.ts to initialize submodules after checkout.
  • Added verification test in packages/cli/src/config/extensions/github.test.ts.

Related Issues

Closes #18385

How to Validate

  1. Run npm run build
  2. Run npm test -w @google/gemini-cli -- src/config/extensions/github.test.ts
  3. Install an extension with submodules (e.g., creating a test repo with one) and verify contents.

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run

@thoreinstein thoreinstein requested a review from a team as a code owner February 5, 2026 18:23
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @thoreinstein, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the CLI's extension installation mechanism by integrating Git submodule support. This change addresses the common scenario where extensions depend on shared libraries or assets managed as submodules, ensuring a complete and functional installation experience for users.

Highlights

  • Git Submodule Support: The CLI now supports recursive cloning and initialization of Git submodules when installing extensions. This ensures that extensions relying on submodules (e.g., for shared libraries or assets) are fully functional immediately after installation.
  • Core Logic Update: The cloneFromGit function in packages/cli/src/config/extensions/github.ts has been updated to include a git.submoduleUpdate(['--init', '--recursive']) call after the initial checkout.
  • Test Coverage: A new verification test has been added to packages/cli/src/config/extensions/github.test.ts to ensure the submoduleUpdate function is correctly called during the extension installation process.
Changelog
  • packages/cli/src/config/extensions/github.test.ts
    • Added submoduleUpdate to the mockGit type definition.
    • Initialized submoduleUpdate as a vi.fn() in the beforeEach block.
    • Added an assertion to expect(mockGit.submoduleUpdate).toHaveBeenCalledWith(['--init', '--recursive']) within the test for successful cloning.
  • packages/cli/src/config/extensions/github.ts
    • Introduced a call to await git.submoduleUpdate(['--init', '--recursive']) after the git.checkout('FETCH_HEAD') operation in the cloneFromGit function.
Activity
  • The author has updated relevant documentation and READMEs.
  • Tests have been added/updated.
  • The changes have been validated on MacOS using npm run.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-cli gemini-cli bot added the status/need-issue Pull requests that need to have an associated issue. label Feb 5, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the functionality to initialize and update Git submodules recursively when cloning a repository. Specifically, a call to git.submoduleUpdate(['--init', '--recursive']) has been added to the cloneFromGit function in packages/cli/src/config/extensions/github.ts. Corresponding unit tests in packages/cli/src/config/extensions/github.test.ts were updated to mock and assert the invocation of this new submodule update command. There are no review comments provided for these changes.

@gemini-cli gemini-cli bot added area/extensions Issues related to Gemini CLI extensions capability and removed status/need-issue Pull requests that need to have an associated issue. labels Feb 5, 2026
@gemini-cli
Copy link
Contributor

gemini-cli bot commented Mar 8, 2026

Hi there! Thank you for your contribution to Gemini CLI. We really appreciate the time and effort you've put into this pull request.

To keep our backlog manageable and ensure we're focusing on current priorities, we are closing pull requests that haven't seen maintainer activity for 30 days. Currently, the team is prioritizing work associated with 🔒 maintainer only or help wanted issues.

If you believe this change is still critical, please feel free to comment with updated details. Otherwise, we encourage contributors to focus on open issues labeled as help wanted. Thank you for your understanding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/extensions Issues related to Gemini CLI extensions capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Git Submodules in Extensions

1 participant