Skip to content

Conversation

@igor-makarov
Copy link

@igor-makarov igor-makarov commented Jan 1, 2026

Description

Add 8 new Crashlytics CLI commands that expose the same functionality available via MCP tools to CLI users:

Issue Management

  • crashlytics:issues:get - Get details for a Crashlytics issue
  • crashlytics:issues:update - Update the state of an issue (OPEN/CLOSED)

Notes

  • crashlytics:notes:create - Add a note to an issue
  • crashlytics:notes:list - List notes for an issue
  • crashlytics:notes:delete - Delete a note from an issue

Reports

  • crashlytics:reports:get - Get aggregated reports (TOP_ISSUES, TOP_VARIANTS, TOP_VERSIONS, TOP_OPERATING_SYSTEMS, TOP_ANDROID_DEVICES, TOP_APPLE_DEVICES)

Events

  • crashlytics:events:list - List recent events for an issue
  • crashlytics:events:batchget - Get specific events by resource name

All commands reuse existing service functions from src/crashlytics/.

Scenarios Tested

  • npm run lint:changed-files passes (0 errors)
  • npm run build passes
  • All 8 commands were run and are working
  • All 8 commands appear in firebase help
  • All commands have correct --help output

Sample Commands

# Get issue details
firebase crashlytics:issues:get --app <appId> <issueId>

# Update issue state
firebase crashlytics:issues:update --app <appId> --state CLOSED <issueId>

# Create a note on an issue
firebase crashlytics:notes:create --app <appId> --note "Investigating this issue" <issueId>

# List notes for an issue
firebase crashlytics:notes:list --app <appId> <issueId>

# Delete a note
firebase crashlytics:notes:delete --app <appId> <issueId> <noteId>

# Get top issues report
firebase crashlytics:reports:get --app <appId> TOP_ISSUES

# Get top issues filtered by error type and time range
firebase crashlytics:reports:get --app <appId> --error-type FATAL --start-time 2024-01-01T00:00:00Z TOP_ISSUES

# List events for an issue
firebase crashlytics:events:list --app <appId> --issue-id <issueId>

# Batch get events by resource name
firebase crashlytics:events:batchget --app <appId> <eventName1> <eventName2>

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @igor-makarov, 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 significantly expands the Firebase CLI's capabilities for Crashlytics by introducing a suite of new commands. These additions empower users to manage Crashlytics issues, notes, reports, and events directly from the command line, mirroring functionality previously available only through the Firebase console. The goal is to provide a more streamlined and scriptable workflow for developers interacting with Crashlytics data.

Highlights

  • New Crashlytics Issue Management Commands: Introduced two new commands for managing Crashlytics issues: crashlytics:issues:get to retrieve details for a specific issue and crashlytics:issues:update to change an issue's state to OPEN or CLOSED.
  • New Crashlytics Notes Commands: Added three commands for interacting with notes on Crashlytics issues: crashlytics:notes:create to add a new note, crashlytics:notes:list to view all notes for an issue, and crashlytics:notes:delete to remove an existing note.
  • New Crashlytics Reports Command: Implemented crashlytics:reports:get to fetch various aggregated Crashlytics reports, such as top issues, variants, versions, operating systems, and devices, with filtering options.
  • New Crashlytics Events Commands: Provided two commands for Crashlytics events: crashlytics:events:list to list recent events for an issue and crashlytics:events:batchget to retrieve specific events by their resource names.
  • Integration with Firebase CLI: All eight new commands are integrated into the Firebase CLI, making them accessible under the firebase crashlytics namespace and reusing existing service functions from src/crashlytics/.

🧠 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 introduces a comprehensive set of CLI commands for interacting with Firebase Crashlytics, covering issues, notes, reports, and events. The implementation is straightforward and leverages existing service functions effectively.

My review focuses on improving maintainability by reducing code duplication and enhancing robustness through better input validation. Specifically, I've identified opportunities for refactoring:

  • The validation for the --app option is duplicated across all new command files.
  • The table rendering logic for events is duplicated in two commands.
  • The report generation in crashlytics-reports-get.ts uses a large if/else if structure that could be simplified.

Additionally, I've pointed out a missing input validation for the --error-type option that could lead to runtime errors.

Addressing these points will make the new commands more robust and easier to maintain in the future.

Add runtime validation for the --error-type option values to prevent
invalid error types from being passed to the API. The validation:
- Checks that each provided error type is one of: FATAL, NON_FATAL, ANR
- Throws a descriptive FirebaseError if an invalid type is provided
- Normalizes input to uppercase for case-insensitive matching
Consolidate duplicated --app validation logic into a reusable helper
function in src/crashlytics/utils.ts. This reduces code duplication
across 8 command files and provides a single source of truth for the
validation error message.
Move duplicated event table rendering logic from crashlytics-events-list
and crashlytics-events-batchget commands into a shared helper function.
This reduces code duplication and ensures consistent table formatting
across event display commands.
Replace large if/else if structure with a configuration object that
maps report types to their table headers and row extraction functions.
This improves maintainability by consolidating report-specific logic
into a declarative structure, making it easier to add new report types
or modify existing ones.
Rename the CLI option and related variable names:
- --error-type -> --issue-type
- VALID_ERROR_TYPES -> VALID_ISSUE_TYPES
- errorType -> issueType in CommandOptions interface
Commander.js returns a string for single values and an array for
multiple values with variadic options. Normalize to array before
iterating to prevent iterating over characters of a string.
@igor-makarov igor-makarov marked this pull request as ready for review January 1, 2026 10:37
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.

1 participant