Firebase CLI
$ firebase Official High RiskOfficial CLI for managing Firebase projects, Hosting, Cloud Functions, Firestore indexes/rules, and the local Emulator Suite. Exposes --json and --non-interactive flags for CI and agent workflows, though firebase init remains interactive.
brew install firebase-cli Use firebase CLI (--json --non-interactive) for emulators, builds, and targeted deploys; firebase-tools also ships an experimental MCP server (firebase mcp) when native tool calls are preferred.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --json and --non-interactive across core commands, though firebase init is prompt-driven.
- Global
--jsonand--non-interactiveflags available firebase initlacks full non-interactive flag parity
Supports GOOGLE_APPLICATION_CREDENTIALS and Hosting preview channels, but production deploy and firestore:delete carry high billing and data-loss risk.
- Service account auth via
GOOGLE_APPLICATION_CREDENTIALS - Deploys security rules, functions, and deletions directly when invoked
Available via npm, Homebrew, and standalone binaries across macOS, Linux, and Windows.
- Multiple distribution channels including standalone binary
Full lifecycle management including local Emulator Suite for safe offline testing.
- Covers Hosting, Functions, Firestore, Auth, and local emulators
Official Google Firebase CLI maintained actively under MIT license.
- First-party
firebase/firebase-toolsrepository
Extensive Firebase CLI reference docs and subcommand --help.
- Official reference at firebase.google.com/docs/cli
Security, Auth & Guardrails
Stores OAuth tokens in ~/.config/configstore/firebase-tools.json; supports GOOGLE_APPLICATION_CREDENTIALS service-account JSON for headless automation.
MIT open-source CLI; deployed Firebase resources (Functions, Firestore, Hosting) incur Google Cloud usage charges.
# Firebase CLI (firebase) Agent Rules - Always pass `--non-interactive --json --project <project-id>` on read and deploy commands. - Never run `firebase deploy` without `--only hosting:channel` or explicit user approval for production functions/rules. - Never run `firebase firestore:delete` without explicit user confirmation.
Agent-Ready Command Recipes
Safe Read-Only Queries
firebase projects:list --json --non-interactive
Returns project IDs and metadata in JSON without prompting.
firebase apps:list --project <project-id> --json --non-interactive
Inspects Web, iOS, and Android apps in a project as structured JSON.
Controlled Writes & Previews
firebase hosting:channel:deploy preview-check --project <project-id> --non-interactive --json
Publishes static assets to an isolated preview URL instead of the live Hosting channel.
Strengths for Agents
- + Consistent
--jsonand--non-interactiveflags across project, app, and deploy commands. - + Local Emulator Suite allows offline verification of Firestore rules and Functions.
- +
hosting:channel:deployenables isolated preview deployments.
Caveats & Pitfalls
- !
firebase initrequires interactive prompts and cannot be scripted easily. - ! Production deploys and
firestore:deletecarry significant security-rule and billing risk.