Skip to content

Conversation

joehan
Copy link
Contributor

@joehan joehan commented Sep 24, 2025

#9174 with fixes made:

ORGINAL DESCRIPTION:

  • Integration with orchestration API
  • Project/App/AiLogic provisioning
  • App config file writing
  • Local directory conflict handling

Conflict Handling

  • Project conflicts: Prevents overwriting existing .firebaserc projects unless overwrite_project: true
  • Config file conflicts: Prevents overwriting existing app config files unless overwrite_configs: true
  • Directory resolution: Automatically finds existing apps or creates unique directory names

Testing with Gemini CLI

Clone PR with GitHub CLI:

gh pr checkout 9174

Install and link:

npm install
npm link

Update ~/.gemini/settings.json with:

{
  "mcpServers": {
    "firebase": {
      "command": "npx",
      "args": [
        "-y",
        "firebase-tools",
        "experimental:mcp",
        "--dir",
        "."
      ]
    }
  }
}

Start Gemini CLI and try a prompt like:

Help me create a project and an app with ai_logic enable with firebase mcp init tool.

Limitations

  • Will follow up with prompt update to improve tool calling correctness. Gemini CLI takes several tries to get the input correct
  • A workflow involving project creation / app creation / AI Logic enablement take up to 2.5mins to complete. Our team is investigating why the orchestration API is taking that long

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 introduces a significant upgrade to the firebase init command, transforming it into a powerful provisioning tool. By integrating with an orchestration API, it streamlines the creation of Firebase projects and the setup of associated applications across iOS, Android, and Web platforms. The update also incorporates advanced conflict resolution to safeguard existing configurations and extends support to new features like Firebase AI Logic, making the initialization process more robust and versatile.

Highlights

  • Orchestration API Integration: The firebase init command has been revamped to integrate with a new orchestration API, enabling comprehensive provisioning of Firebase projects and applications (iOS, Android, Web) directly through the tool.
  • Project and App Provisioning: The tool now supports creating new Firebase projects and registering new iOS, Android, or Web applications, including writing their respective configuration files (e.g., GoogleService-Info.plist, google-services.json).
  • AI Logic Feature Support: The Firebase AI Logic feature can now be enabled and provisioned as part of the init process, with its setup handled via the orchestration API.
  • Robust Conflict Handling: New mechanisms are in place to prevent overwriting existing .firebaserc project configurations or app config files unless explicitly allowed via overwrite_project: true or overwrite_configs: true flags. It also automatically resolves directory conflicts for new apps.
  • New Utility Functions: A set of new utility functions has been introduced to handle platform-specific configuration file naming, path resolution, parsing of iOS plist and Android JSON files, generating unique app directory names, and extracting project IDs from API responses.
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 introduces a significant revamp of the firebase init command, integrating it with the orchestration API for project and app provisioning. It adds support for a new ailogic feature and includes comprehensive utility functions and tests for the new provisioning logic. The changes are well-structured, breaking down complex logic into smaller, manageable functions. My review focuses on improving documentation and error handling for better maintainability. I've suggested adding descriptions to empty JSDoc comments and enhancing error messages to provide more context for debugging.

Comment on lines +6 to +8
/**
*
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The JSDoc comment for this function is empty. Adding a brief description, even for a no-op function, improves code clarity and helps other developers understand its purpose without reading the implementation details.

Suggested change
/**
*
*/
/**
* Does nothing as AI Logic questions are handled by the MCP schema.
*/

Comment on lines +13 to +15
/**
*
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This JSDoc comment is empty. Please add a brief description to explain why this function is a no-op. This improves code documentation and maintainability.

Suggested change
/**
*
*/
/**
* Does nothing as AI Logic provisioning happens via API and requires no local config changes.
*/

Comment on lines +110 to +112
/**
*
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This JSDoc comment is empty. Adding a description for the init function will improve code documentation and make it easier for others to understand its role in the initialization process.

Suggested change
/**
*
*/
/**
* Kicks off the init flow for the specified features.
*/


return bundleIdMatch[1];
} catch (error) {
throw new Error(`Failed to parse iOS plist file: ${plistPath}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The current error message hides the original cause of the failure, which can make debugging difficult. It's a good practice to include the original error's message in the new error to provide more context.

Suggested change
throw new Error(`Failed to parse iOS plist file: ${plistPath}`);
throw new Error(`Failed to parse iOS plist file: ${plistPath}: ${error instanceof Error ? error.message : String(error)}`);

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