npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

firebase-tools-cli

v0.5.9

Published

CLI tool for Firebase to manage Firestore, Remote Config, and Realtime Database

Readme

Firebase Tools CLI

NPM version License Node Version NPM version

The Firebase Tools CLI is a command-line interface for managing Firebase services including Firestore, Realtime Database, and Remote Config. It provides powerful tools to export, import, query, and manage your Firebase data from the command line.

  • Export/Import data from Firestore and Realtime Database
  • Query collections and documents with advanced filtering
  • Convert JSON files to Firebase Remote Config format
  • Manage authentication and project settings
  • Batch operations with customizable batch sizes

To get started with Firebase Tools CLI, read the full list of commands below or check out the documentation.

Installation

Node Package

You can install Firebase Tools CLI using npm (the Node Package Manager). Note that you will need to install Node.js and npm. Installing Node.js should install npm as well.

To download and install Firebase Tools CLI run the following command:

npm install -g firebase-tools-cli

This will provide you with the globally accessible firebase-tools-cli command.

Commands

The command firebase-tools-cli --help lists the available commands and firebase-tools-cli <command> --help shows more details for an individual command.

If a command is project-specific, you must have either a valid Firebase service account key file

Below is a brief list of the available commands and their function:

Authentication Commands

| Command | Description | | ------------ | ------------------------------------------------------------------------------------------ | | login | Authenticate with service account key file. | | projects | List available projects and manage default project settings. | | reset | Reset all configuration and credentials. Options to reset config-only or credentials-only. |

Firestore Commands

| Command | Description | | -------------------- | ------------------------------------------------------------------------------------------------------------------- | | firestore:export | Export all collections from Firestore. Supports detailed and importable formats with subcollection handling. | | firestore:import | Import data to Firestore from JSON file. Supports batch operations and merge functionality. | | firestore:list | List all collections and their basic information from the current project's Firestore database. | | firestore:query | Query a collection or fetch a specific document. Supports advanced filtering, ordering, and field-specific queries. |

Realtime Database Commands

| Command | Description | | --------------- | ----------------------------------------------------------------------------------------------------------- | | rtdb:export | Export all data from Realtime Database. Supports detailed and importable formats with exclusion options. | | rtdb:import | Import data to Realtime Database from JSON file. Supports batch operations and merge functionality. | | rtdb:list | List all top-level nodes and their basic information from the current project's Realtime Database. | | rtdb:query | Query a specific path in Realtime Database. Supports filtering, ordering, and JSON output with file saving. |

Remote Config Commands

| Command | Description | | ------------------------- | ------------------------------------------------------------------------------------------------ | | remote-config:convert | Convert JSON file to Firebase Remote Config format. Supports templates and condition generation. |

Authentication

General

The Firebase Tools CLI currently only supports one authentication method:

  • Service Account - set the GOOGLE_APPLICATION_CREDENTIALS environment variable to point to the path of a JSON service account key file. For more details, see Google Cloud's Getting started with authentication guide.

Multiple Projects

By default the CLI can work with multiple Firebase projects. Use firebase-tools-cli projects to list available projects and set a default project for easier command execution.

To set the default project for a specific directory, run firebase-tools-cli projects --set-default <project-id> from within the directory.

To clear the default project setting, run firebase-tools-cli projects --clear-default.

Examples

Export and Import Workflow

# Export Firestore data
firebase-tools-cli firestore:export --output ./backup-$(date +%Y%m%d)/

# Import data to another project
firebase-tools-cli firestore:import ./backup-20231201/firestore-export.json

# Export Realtime Database
firebase-tools-cli rtdb:export --database-url https://source-project-rtdb.firebaseio.com/ --output ./rtdb-backup/

# Import to target database
firebase-tools-cli rtdb:import ./rtdb-backup/rtdb-export.json --database-url https://target-project-rtdb.firebaseio.com/

Advanced Querying

# Query Firestore collections with conditions
firebase-tools-cli firestore:query users --where "age,>=,18" --limit 10
firebase-tools-cli firestore:query users --order-by "name,asc"

# Query specific document fields
firebase-tools-cli firestore:query users user1 --field profile.settings

# Query Realtime Database with filtering
firebase-tools-cli rtdb:query users --where "age,>=,18" --limit 10 --database-url https://my-project-rtdb.firebaseio.com/
firebase-tools-cli rtdb:query posts --order-by "timestamp,desc" --json --output results.json

Remote Config Management

# Convert app config to Remote Config format
firebase-tools-cli remote-config:convert app-config.json --template mobile --add-conditions

# Convert with custom settings
firebase-tools-cli remote-config:convert config.json --version-number 2 --user-email [email protected] --description "Production config"

Requirements

  • Node.js >= 18.0.0
  • Valid Firebase project with appropriate permissions
  • Service account key

Contributing

We welcome contributions to Firebase Tools CLI! Please see CONTRIBUTING.md for guidelines on how to contribute.

License

Firebase Tools CLI is licensed under the MIT License.

Support

Contributors