Skip to content

Conversation

joehan
Copy link
Contributor

@joehan joehan commented Oct 6, 2025

No description provided.

Copy link
Contributor

Summary of Changes

Hello @joehan, 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 FirebaseMcpServer's interaction with the Firebase CLI by implementing a dynamic command detection mechanism. Instead of always relying on npx firebase-tools@latest, the server now attempts to use a globally installed firebase command first, falling back to npx if a global installation is not found. This aims to optimize command execution and provide a more adaptable solution across different development environments.

Highlights

  • Dynamic Firebase CLI Command Detection: The server now intelligently determines whether to use a globally installed firebase command or npx firebase-tools@latest for executing Firebase CLI commands.
  • Improved Performance and Flexibility: This change allows the server to leverage a locally installed firebase CLI, potentially improving performance by avoiding npx overhead and offering more flexibility for users with global installations.
  • cross-spawn Integration: The cross-spawn library has been introduced to facilitate synchronous execution of external commands, specifically for detecting the available Firebase CLI.
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 attempts to improve the Firebase MCP server by detecting if the firebase CLI is installed and falling back to npx firebase-tools@latest if it's not. This is a useful enhancement to avoid unnecessary installations via npx when the CLI is already available. However, I've found a critical logic error in the implementation that prevents the fallback from working as intended. Please see my detailed comment for a fix.

src/mcp/index.ts Outdated
Comment on lines 306 to 309
if (testCommand.error) {
this.cliCommand = "npx firebase-tools@latest";
}
this.cliCommand = "firebase";
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

There's a logic error here. this.cliCommand is unconditionally set to "firebase" on line 309, which overwrites the value set inside the if (testCommand.error) block. This means that even if firebase is not installed and crossSpawn.sync returns an error, the command will still be set to "firebase" instead of "npx firebase-tools@latest".

You should use an else block to set this.cliCommand to "firebase" only when testCommand.error is falsy.

      if (testCommand.error) {
        this.cliCommand = "npx firebase-tools@latest";
      } else {
        this.cliCommand = "firebase";
      }

@joehan joehan merged commit 244f6b4 into samedson-npx-commands Oct 6, 2025
23 checks passed
@joehan joehan deleted the jh-maybe-firebase branch October 6, 2025 18:13
@github-project-automation github-project-automation bot moved this from Approved [PR] to Done in [Cloud] Extensions + Functions Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants