Firebase CLI
4.4k stars
official open-source Cross-platform macOS Linux Actively maintained
The official Firebase CLI. Deploy Cloud Functions, manage Firestore indexes, serve hosting locally, and orchestrate your Firebase project with structured JSON output.
Part of the Firebase CLI tools for AI agents
What your agent can do
You deploy a Cloud Function through the Firebase Console. Click Functions, click Create, paste code, configure trigger, click Deploy, wait 90 seconds. It fails — missing dependency. Fix, redeploy, wait again. Your agent runs `firebase deploy --only functions:myFunction --json` and gets a deployment result in one command. If it fails, the JSON error output tells exactly which dependency is missing.The local emulator suite is Firebase's real power. `firebase emulators:start` runs Auth, Firestore, Functions, Storage, and Hosting on your machine. The exact same services as production, with the same APIs, running locally. Your agent develops and tests against local emulators without touching production data. No risk, no cost, instant feedback loops.Preview channels solve the "can I see it before it goes live" problem. `firebase hosting:channel:deploy staging` creates a temporary URL with your latest changes. Share it, test it, iterate. When it's ready, `firebase deploy --only hosting` pushes to production. Your agent manages the entire preview-to-production workflow without the Console.The `--json` flag on most commands returns structured `{status, result}` objects. Your agent parses deployment results, project metadata, and function logs as data. Combined with `--non-interactive` and `--force` flags, every operation is headless. Token-based auth via `FIREBASE_TOKEN` or service account credentials for CI/CD pipelines.The insider detail: Firebase CLI is Google Cloud under the hood. When you deploy Cloud Functions, `gcloud` orchestrates it. When you authenticate, you're getting a Google OAuth token. Understanding this relationship means your agent can use Firebase CLI for app-level operations and gcloud for infrastructure that Firebase doesn't expose directly.
Limitations
Firebase-specific with no support for other BaaS platforms. Some advanced GCP features (Cloud SQL, GKE, IAM policies) require gcloud CLI instead. The emulator suite requires Java Runtime Environment for Firestore and Realtime Database emulators. No official MCP server. Project creation is limited — some features still require the Console.
Key Commands
firebase deploy Deploy hosting, functions, Firestore rules, and storage rules to production
firebase emulators:start Start the local emulator suite for offline development
firebase hosting:channel:deploy Deploy to a preview channel for testing before production
firebase functions:log Read Cloud Functions execution logs
firebase firestore:indexes List all composite indexes and field overrides
firebase projects:list List all Firebase projects in your account
firebase init Initialize a new Firebase project with selected features
GitHub Stats
repo firebase/firebase-tools
stars 4.4k
language TypeScript
license MIT
last commit Mar 25, 2026
FAQ
- Is Firebase CLI free?
- Yes. The Firebase CLI is free and open-source under MIT. Install with `npm install -g firebase-tools`. You pay for Firebase platform usage (functions invocations, storage, bandwidth), not the CLI tool. The local emulator suite runs entirely free with no cloud costs.
- Can AI agents use Firebase CLI?
- Yes. Firebase CLI runs fully non-interactive with `--non-interactive` and `--force` flags. Most commands support `--json` for structured output. Authenticate headlessly with `FIREBASE_TOKEN` environment variable or service account credentials. Your agent deploys functions, manages hosting, reads logs, and configures Firestore indexes without any interactive prompts.
- What is the difference between Firebase CLI and gcloud?
- Firebase CLI manages Firebase-specific services: Hosting, Cloud Functions (Node.js/Python), Firestore, Auth, Storage, and the local emulator suite. gcloud manages the full Google Cloud Platform: Compute Engine, Cloud SQL, GKE, IAM, networking. Firebase runs on GCP infrastructure, and both CLIs share authentication. Your agent uses Firebase for app-level operations and gcloud for infrastructure.
- Can you run Firebase locally without an internet connection?
- Yes, with the emulator suite. `firebase emulators:start` runs Auth, Firestore, Cloud Functions, Storage, and Hosting locally. Your agent develops and tests against these emulators without touching production. The emulators replicate production behavior including security rules, triggers, and auth flows. Requires Java for Firestore/RTDB emulators.
- How do you deploy Firebase in CI/CD?
- Set `FIREBASE_TOKEN` (from `firebase login:ci`) or use a GCP service account key as a CI secret. In your pipeline: `firebase deploy --only functions --json --non-interactive --force`. The `--json` flag gives structured deployment results. Works with GitHub Actions, GitLab CI, Cloud Build, and any CI provider.
Related tools in Cloud & Infra
Terraform CLI official
brew install terraform
category Cloud & Infra
The infrastructure-as-code CLI. Plan, apply, and manage cloud resources across AWS, GCP, Azure, and 3,000+ providers with structured JSON output.
48.0k
AWS CLI official
curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg" && sudo installer -pkg AWSCLIV2.pkg -target /
category Cloud & Infra
Amazon's official command-line tool for managing AWS services. Control EC2, S3, Lambda, IAM, and 200+ services from the terminal.
16.8k
Vercel CLI official
npm i -g vercel
category Cloud & Infra
Vercel's official command-line interface. Deploy, preview, and manage web applications, serverless functions, and edge infrastructure from your terminal.
15.0k
Docker CLI official
brew install --cask docker
category Cloud & Infra
Docker's official command-line tool for building, running, and managing containers. Pull images, start services, inspect logs, and orchestrate multi-container apps from the terminal.
5.7k
Last verified: Mar 25, 2026