Skip to content

fix: detect pnpm/pnpx in ~/.local#15254

Merged
bdmorgan merged 2 commits intogoogle-gemini:mainfrom
rwakulszowa:fix/pnpm-install-detection
Jan 25, 2026
Merged

fix: detect pnpm/pnpx in ~/.local#15254
bdmorgan merged 2 commits intogoogle-gemini:mainfrom
rwakulszowa:fix/pnpm-install-detection

Conversation

@rwakulszowa
Copy link
Contributor

@rwakulszowa rwakulszowa commented Dec 18, 2025

Summary

Fixes a failure to detect pnpm installations on Ubuntu.

Details

Current behaviour: On Ubuntu, gemini installed globally with pnpm (pnpm add -g @google-gemini/gemini-cli) thinks it was installed with npm. Auto-updates always fail.
New behaviour: On Ubuntu, global gemini installed with pnpm auto-updates successfully.

Related Issues

Related to #14298

How to Validate

Validation is tricky. I manually tested it with a hack, where:

  1. I installed an old version globally (pnpm add @google/gemini-cli@0.18)
  2. Manually replaced the src/utils/installationInfo.js file to an updated version
  3. Ran gemini - it auto-updated to a new version using pnpm.

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
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@rwakulszowa rwakulszowa requested a review from a team as a code owner December 18, 2025 17:18
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @rwakulszowa, 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 resolves a critical issue affecting the "gemini" CLI's auto-update mechanism on Ubuntu when installed globally via pnpm. Previously, such installations were misidentified as "npm" installations, preventing successful updates. The changes introduce more robust path detection for pnpm and pnpx, specifically targeting common installation directories like "/.cache/pnpm/dlx" and "/.local/share/pnpm", thereby ensuring that the CLI correctly recognizes its installation method and can auto-update as expected.

Highlights

  • Improved pnpm/pnpx detection: Enhanced the "getInstallationInfo" utility to correctly identify "pnpx" installations in "/.cache/pnpm/dlx" and global "pnpm" installations in "/.local/share/pnpm".
  • Resolved auto-update failures: Fixed an issue where the "gemini" CLI, when installed globally with pnpm on Ubuntu, failed to auto-update due to incorrect package manager detection.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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.

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 extends the detection logic for pnpm and pnpx to support installations on Ubuntu by adding checks for /.cache/pnpm/dlx and /.local/share/pnpm. No vulnerabilities or critical issues were found in the provided code changes. My review suggests making these path checks more robust to prevent potential false positives, specifically by using regular expressions for precise matching to improve correctness and reliability.

@rwakulszowa rwakulszowa force-pushed the fix/pnpm-install-detection branch from c6384d4 to 8d8b031 Compare December 20, 2025 13:26
@gemini-cli gemini-cli bot added status/need-issue Pull requests that need to have an associated issue. priority/p1 Important and should be addressed in the near term. area/core Issues related to User Interface, OS Support, Core Functionality and removed status/need-issue Pull requests that need to have an associated issue. labels Jan 7, 2026
@bdmorgan
Copy link
Collaborator

Hi @rwakulszowa, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this.

We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines.

Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed.

Thank you for your understanding and for being a part of our community!

@jacob314 jacob314 added the help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! label Jan 22, 2026
@gemini-cli
Copy link
Contributor

gemini-cli bot commented Jan 24, 2026

Hi there! Thank you for your contribution to Gemini CLI.

To improve our contribution process and better track changes, we now require all pull requests to be associated with an existing issue, as announced in our recent discussion and as detailed in our CONTRIBUTING.md.

This pull request is being closed because it is not currently linked to an issue. You can easily reopen this PR once you have linked it to an issue.

How to link an issue:
Add a keyword followed by the issue number (e.g., Fixes #123) in the description of your pull request. For more details, see the GitHub Documentation.

Thank you for your understanding and for being a part of our community!

@gemini-cli gemini-cli bot closed this Jan 24, 2026
@rwakulszowa
Copy link
Contributor Author

rwakulszowa commented Jan 24, 2026

Wait what?

It is linked to an issue. It's been linked since the very beginning:

Related Issues
Related to #14298

The Related to "keyword" comes directly from your documentation / default PR description (the stuff you guys put in the PR description whenever someone clicks Open a Pull Request):

Use keywords to auto-close issues (Closes #123, Fixes #456). If this PR is
only related to an issue or is a partial fix, simply reference the issue number
without a keyword (Related to #123).

Sundar please. Moderate impact.


@bdmorgan wanna reopen this? Ftr., this "fixes" only a part of the issue (ubuntu + pnpm, potentially also Fedora). A proper fix is unlikely to ever happen - a JS tool auto updating itself was just a bad idea to begin with, imo.

Or at least please update your default PR description, because this is misleading.

@bdmorgan bdmorgan reopened this Jan 24, 2026
@bdmorgan
Copy link
Collaborator

"Relating" is not sufficient - it needs to be linked (i.e. shows up in the right-hand panel on the pull request page under "Development").

I reopened. I also modified the initial comment so that that issue is now properly linked.

@bdmorgan
Copy link
Collaborator

Actually I see what you're saying. you don't want to close the issue on close of this PR - you just want the link between them. Let me tweak the workflow so we can handle scenarios like this properly in the future.

@bdmorgan
Copy link
Collaborator

Related to #14298

The workflow should now check any pull request update. If the update results in a "soft link" (i.e. Related to #14298) or a hard link (i.e. Closes #14298) then the pull request should get automatically reopened.

@bdmorgan bdmorgan enabled auto-merge January 25, 2026 19:05
@bdmorgan bdmorgan added this pull request to the merge queue Jan 25, 2026
Merged via the queue into google-gemini:main with commit c0b8c4a Jan 25, 2026
25 checks passed
sidwan02 pushed a commit to sidwan02/gemini-cli-gemma that referenced this pull request Feb 6, 2026
Co-authored-by: Bryan Morgan <bryanmorgan@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! priority/p1 Important and should be addressed in the near term.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants