Firebase cli

From akillness/jeo-skills · View interactive version

Firebase cli is an AI agent skill from the GitHub repository akillness/jeo-skills. Operate Firebase from the terminal with `firebase-tools`: install/auth the CLI, bootstrap `firebase.json` / `.firebaserc`, run the Emulator Suite, deploy Hosting / Functions / rules / App Hosting, manage preview channels, and handle Firebase admin tasks like auth import/export, Remote Config, App Di

How to use this skill

Skill file

firebase-cli — Firebase platform operator

Keyword: firebase · firebase deploy · firebase init · firebase emulators

Use this skill when the center of gravity is Firebase platform/project operation through the CLI.

When to use this skill

When not to use this skill

Instructions

Step 1: Pick the operating mode

Start by routing the request into one of these modes:

| Mode | Use when | Primary support |

|------|----------|-----------------|

| Install / auth | CLI missing, outdated, or blocked on credentials | scripts/install.sh, references/install-auth-and-bootstrap.md |

| Bootstrap / config | Need firebase init, aliases, targets, or repo config layout | references/install-auth-and-bootstrap.md |

| Local emulators | Need local Firebase runtime, persistence, or test harness | scripts/emulators.sh, references/emulator-and-release-workflows.md |

| Deploy / release | Need scoped deploys, preview channels, App Hosting rollout, or CI execution | scripts/deploy.sh, references/emulator-and-release-workflows.md |

| Admin / data ops | Need auth import/export, Remote Config, App Distribution, Extensions, or Data Connect commands | references/admin-and-data-operations.md |

| Unsure / mixed job | Need help deciding whether this is Firebase CLI vs adjacent lane work | references/modes-and-routing.md |

Step 2: Verify prerequisites before changing anything

  1. Confirm the CLI exists and capture the version: firebase --version
  2. Confirm the runtime is new enough for current firebase-tools releases:
  1. Check authentication path:
  1. Inspect project config before deploys or emulator work:

Step 3: Run the smallest workflow that answers the request

Mode A — Install / auth
Mode B — Bootstrap / config
Mode C — Local emulators
Mode D — Deploy / release
Mode E — Admin / data ops

Step 4: Route out aggressively when the job changed shape

Use firebase-cli as the operator anchor, but hand off when the work is really about:

Step 5: Verify the outcome

For every mode, verify the smallest truthful artifact:

Examples

Example 1: Bootstrap a Firebase repo cleanly

Prompt: "Set up Firebase in this repo for Hosting + Functions + preview channels"

Mode:
- Bootstrap / config

Likely actions:
- bash scripts/install.sh
- firebase login
- firebase init hosting functions
- firebase use --add
- firebase target:apply ...   # if multi-site is needed

Example 2: Local emulator workflow with persistence

Prompt: "Run auth + firestore emulators locally and keep the data between runs"

Mode:
- Local emulators

Likely actions:
- bash scripts/emulators.sh --only auth,firestore --persistent
- or firebase emulators:start --only auth,firestore --import ./emulator-data --export-on-exit

Example 3: Firebase release / preview flow

Prompt: "Deploy Hosting to a reviewable staging channel, then ship production after approval"

Mode:
- Deploy / release

Likely actions:
- bash scripts/deploy.sh --channel staging --expires 7d
- firebase hosting:channel:open staging
- firebase deploy --only hosting

Example 4: Route AI workflow work away from this skill

Prompt: "Build a Firebase RAG flow with tools, evals, and observability"

Decision:
- Route to `genkit`
- Keep `firebase-cli` only for operator tasks like local setup or deploy wiring if needed

Best practices

  1. Prefer workflow selection over command dumping — choose the mode first, then the commands
  2. Use service accounts in CI — treat --token / FIREBASE_TOKEN as deprecated escape hatches, not the default path
  3. Scope deploys tightly — --only and preview channels reduce accidental blast radius
  4. Keep repo config explicit — firebase.json, .firebaserc, and target mappings should match the repo’s real deploy surfaces
  5. Use persistence intentionally in emulator work — import/export directories make local debugging and tests repeatable
  6. Separate Firebase operator work from app/AI logic work — route to genkit (client-ai-logic mode) or genkit when the CLI is no longer the main job
  7. Treat destructive admin commands as high-risk — confirm paths, versions, and resource IDs before delete/rollback/import operations

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.