Skip to content

Conversation

TrCaM
Copy link
Contributor

@TrCaM TrCaM commented Sep 25, 2025

Simplify and temporary adaptation of #9174, limit to AI Logic enablement. As more products are supported via provisioning API, we will revert this back to #9174 later.

This PR introduces the AI Logic initialization feature, accessible via both the Firebase CLI command and the MCP Firebase init tool.

Key Features:

  • AI Logic resource provisioning: Use the new Firebase provisioning API to create
  • CLI Initialization: Users can now initialize AI Logic directly using the command: firebase init ailogic, or via firebase_init MCP tool
  • Project Handling: The tool will automatically create a new Firebase project if one doesn't exist, or pick up an existing project from the .firebaserc file.
  • App config file generation: a Firebase app (Android/iOS/Web) will be created and its config file is returned and written into a file.
  • Configuration Overwrite: If a configuration file already exists, users can force an overwrite by providing the overwrite_config input.

Limitations:

  • Extra App Creation: If the project folder is already integrated with Firebase, an additional app will always be created. However, the AI Logic feature will still be enabled and fully functional.

Testing with Gemini CLI

To test this feature using the Gemini CLI:

  1. Clone PR with GitHub CLI:

    gh pr checkout 9174
  2. Install and Link:

    npm install
    npm link
  3. Update ~/.gemini/settings.json:
    Add the following configuration:

    {
      "mcpServers": {
        "firebase": {
          "command": "npx",
          "args": [
            "-y",
            "firebase-tools",
            "experimental:mcp",
            "--dir",
            "."
          ]
        }
      }
    }
  4. Start Gemini CLI and try a prompt:

    Help me getting started with Firebase AI Logic in the current directory.
    

Copy link
Contributor

Summary of Changes

Hello @TrCaM, 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 enables the initialization of Firebase AI Logic through both the Firebase CLI and the MCP Firebase init tool. It streamlines the process of setting up AI Logic by automating project and app provisioning, including platform detection, configuration file generation, and integration with the new Firebase provisioning API. This change simplifies the developer experience for integrating AI capabilities into their Firebase projects.

Highlights

  • AI Logic Initialization: Introduces a new firebase init ailogic command and integrates AI Logic provisioning into the MCP Firebase init tool, allowing users to set up Firebase AI Logic with app provisioning.
  • Cross-Platform App Provisioning: The new AI Logic initialization supports provisioning for Android, iOS, and Web applications, automatically detecting the platform or allowing manual specification.
  • Firebase Provisioning API Integration: Implements a new Firebase provisioning API client (provisionFirebaseApp) to handle the creation of Firebase projects and apps, including specific inputs for different platforms and AI Logic features.
  • Configuration Management: The feature handles the creation and writing of Firebase app configuration files (e.g., google-services.json, GoogleService-Info.plist, firebase-config.json) and includes an option to overwrite existing files.
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 new ailogic initialization feature to the Firebase CLI, enabling users to provision AI Logic resources via firebase init ailogic and the MCP firebase_init tool. The changes are comprehensive, including the core provisioning logic, integration with the init command, a Zod schema for the MCP tool, and an extensive suite of unit tests.

My review focuses on improving consistency and code quality. I've suggested standardizing error handling to use FirebaseError across the new feature for better error reporting and consistency with the existing codebase. I also pointed out a couple of minor areas for code cleanup and simplification.

@TrCaM
Copy link
Contributor Author

TrCaM commented Sep 25, 2025

/gemini review

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 new 'AI Logic' initialization feature to the Firebase CLI, available through firebase init ailogic and the MCP firebase_init tool. The implementation includes a new provisioning API client to create Firebase apps and enable AI Logic, along with comprehensive unit tests for the new functionality. The changes are well-structured and integrate cleanly with the existing init flow. My review focuses on improving error handling consistency and correcting a minor type definition. Overall, this is a solid contribution.

@github-project-automation github-project-automation bot moved this to Changes Requested [PR] in [Cloud] Extensions + Functions Sep 25, 2025
@TrCaM TrCaM requested a review from joehan September 27, 2025 03:18
Copy link
Contributor

@joehan joehan left a comment

Choose a reason for hiding this comment

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

One more rounf of suggtions to simplify this code, but this looks very close

@TrCaM TrCaM requested a review from joehan September 30, 2025 04:32
Copy link
Contributor

@joehan joehan left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for all of the revisions

@github-project-automation github-project-automation bot moved this from Changes Requested [PR] to Approved [PR] in [Cloud] Extensions + Functions Oct 1, 2025
@joehan joehan merged commit e6bf8e4 into firebase:master Oct 1, 2025
12 checks passed
@github-project-automation github-project-automation bot moved this from Approved [PR] to Done in [Cloud] Extensions + Functions Oct 1, 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