← Back to tools

Firebase CLI

Deploy and manage Firebase projects from the terminal

Cloud & Services linuxmacoswindows TypeScript MIT

Description

The Firebase CLI provides tools for deploying and managing Firebase projects. It handles Hosting deployments, Cloud Functions, Firestore rules and indexes, Authentication emulators, and the full Firebase Emulator Suite for local development and testing.

Install

npmnpm i -g firebase-tools

AI Summary

Deploy and manage Firebase projects from the terminal. Deploy to Hosting, manage Cloud Functions, configure Firestore rules, and run the full Firebase Emulator Suite for local development.

Capabilities

  • + Deploy static sites and web apps to Firebase Hosting
  • + Deploy and manage Cloud Functions for Firebase
  • + Configure and deploy Firestore security rules and indexes
  • + Run the Firebase Emulator Suite for local development and testing
  • + Manage Firebase project settings and service accounts
  • + Initialize new Firebase projects with guided setup

Use When

  • Deploying web apps or static sites to Firebase Hosting
  • Developing and deploying Cloud Functions
  • Testing Firebase services locally with emulators
  • Managing Firestore security rules and indexes
  • Need a complete BaaS local development environment

Avoid When

  • x Not using Firebase or Google Cloud (use Supabase, AWS Amplify, etc.)
  • x Need custom server infrastructure (use flyctl, Heroku, or cloud provider CLIs)
  • x Managing non-Firebase GCP resources (use gcloud instead)

Usage Patterns

Initialize a Firebase project

firebase init hosting functions firestore

Sets up Hosting, Functions, and Firestore in the current directory

Deploy everything

firebase deploy

Deploys Hosting, Functions, Firestore rules, and all configured services

Start local emulators

firebase emulators:start

Starts local emulators for Auth, Firestore, Functions, and Hosting

Deploy only functions

firebase deploy --only functions:myFunction

Deploys a single Cloud Function without touching other services

Input / Output

stdin: Not typically used
stdout: Deployment URLs, emulator status, and project information
Exit codes:
0 Success
1 Error

Typical Pipelines

npm run build && firebase deploy --only hosting
firebase projects:list --json | jq '.[].projectId'
firebase functions:log --only myFunction | grep ERROR

Related Tools

View AGENTS.md for Firebase CLI