firebase-cli▌
supercent-io/skills-template · updated Apr 8, 2026
MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.
Keyword: firebase · firebase deploy · firebase init · firebase emulators
firebase-cli — Firebase Command Line Interface
Keyword:
firebase·firebase deploy·firebase init·firebase emulatorsThe Firebase CLI (
firebase-tools) manages your Firebase project from the terminal: deploy, emulate, import/export data, manage users, configure services, and automate CI/CD.
When to use this skill
- Deploy Firebase Hosting, Cloud Functions, Firestore rules/indexes, Realtime Database rules, Cloud Storage rules, Remote Config, or Extensions
- Set up a new Firebase project with
firebase init - Run the Firebase Emulator Suite locally for development and testing
- Manage preview/staging channels for Hosting
- Import or export Firebase Authentication users in bulk
- Distribute app builds to testers via App Distribution
- Manage Firebase Extensions (install, configure, update, uninstall)
- Deploy Next.js / Angular apps via Firebase App Hosting
- Use Firebase CLI in CI/CD pipelines with service account credentials
Instructions
- Install the Firebase CLI:
npm install -g firebase-tools - Authenticate:
firebase login(browser OAuth) orGOOGLE_APPLICATION_CREDENTIALSfor CI - Initialize project:
firebase init(createsfirebase.jsonand.firebaserc) - Deploy:
firebase deployorfirebase deploy --only hosting,functions - Run emulators:
firebase emulators:start - For detailed command reference, see references/commands.md
- For installation and setup scripts, see scripts/install.sh
CI/CD: Use
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json firebase deployinstead of the deprecated--token/FIREBASE_TOKENmethod.
Examples
Deploy everything
firebase deploy
Deploy only Hosting and Functions
firebase deploy --only hosting,functions
Run all emulators with data persistence
firebase emulators:start --import ./emulator-data --export-on-exit
Create a preview channel and deploy
firebase hosting:channel:create staging --expires 7d
firebase hosting:channel:deploy staging
Import users from JSON
firebase auth:import users.json --hash-algo=BCRYPT
Distribute Android build to testers
firebase appdistribution:distribute app-release.apk \
--app "1:1234567890:android:abcd1234" \
--release-notes "Sprint 42 build" \
--groups "qa-team"
Quick Start
# Install
npm install -g firebase-tools
# Authenticate
firebase login
# Initialize project (interactive)
firebase init
# Deploy
firebase deploy
# Run emulators
firebase emulators:start
Installation
npm (recommended — all platforms)
npm install -g firebase-tools
firebase --version
Standalone binary (macOS/Linux — no Node.js required)
curl -sL firebase.tools | bash
CI/CD — service account authentication (recommended)
# Set environment variable pointing to service account JSON key
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account-key.json"
firebase deploy --non-interactive
Via skill script
bash scripts/install.sh
Core Usage
Authentication
firebase login # OAuth browser login
firebase login --no-localhost # Copy-paste code flow
firebase login:ci # Generate CI token (deprecated — use service account)
firebase login:list # List all authorized accounts
firebase login:use [email protected] # Set default account
firebase logout # Sign out
Project Management
firebase init # Set up Firebase features in current directory
firebase use <project_id> # Set active project
firebase use --add # Add a project alias
firebase projects:list # List all Firebase projects
firebase open hosting:site # Open Firebase console in browser
Deployment
# Deploy everything
firebase deploy
# Deploy specific targets
firebase deploy --only hosting
firebase deploy --only functions
firebase deploy --only firestore
firebase deploy --only hosting,functions
# Deploy sub-targets
firebase deploy --only functions:myFunction
firebase deploy --only hosting:my-site
firebase deploy --only firestore:rules
firebase deploy --only firestore:indexes
# Exclude targets
firebase deploy --except functions
# With message
firebase deploy --message "v2.3.1 release"
Firebase Emulator Suite
# Start all configured emulators
firebase emulators:start
# Start specific emulators
firebase emulators:start --only auth,firestore,functions
# With data import/export
firebase emulators:start --import ./emulator-data --export-on-exit
# Run tests against emulators then shut down
firebase emulators:exec "npm test" --only firestore,auth
# Enable Functions debugger (Node.js inspector on port 9229)
firebase emulators:start --inspect-functions
Local Development Server
firebase serve # Hosting + HTTPS Functions
firebase serve --only hosting
firebase serve --port 5000
Hosting Commands
# Preview channels
firebase hosting:channel:create staging --expires 7d
firebase hosting:channel:deploy staging
firebase hosting:channel:list
firebase hosting:channel:open staging
firebase hosting:channel:delete staging --force
firebase hosting:clone my-app:live my-app-staging:staging
# Multi-site management
firebase hosting:sites:list
firebase hosting:sites:create new-site-id
firebase hosting:disable --site my-old-site
Cloud Functions Commands
firebase functions:list # List deployed functions
firebase functions:log # View logs
firebase functions:log --only myFunction # Filter by function name
firebase functions:delete myFunction # Delete a function
firebase functions:shell # Local interactive shell
# Secrets (2nd gen — replaces functions:config)
firebase functions:secrets:set MY_SECRET
firebase functions:secrets:get MY_SECRET
firebase functions:secrets:prune
# Config (1st gen only)
firebase functions:config:set api.key="VALUE"
firebase functions:config:get
Firestore Commands
firebase firestore:delete /collection/doc --recursive
firebase firestore:indexes
firebase firestore:rules:get
Realtime Database Commands
firebase database:get /path --pretty
firebase database:set /path data.json
firebase database:push /messages --data '{"text":"Hello"}'
firebase database:update /users/uid --data '{"name":"New Name"}'
firebase database:remove /path --confirm
firebase database:profile --duration 30
Auth Import / Export
# Export all users
firebase auth:export users.json
# Import users (BCRYPT hashes)
firebase auth:import users.json --hash-algo=BCRYPT
# Import users (SCRYPT hashes — Firebase default)
firebase auth:import users.json \
--hash-algo=SCRYPT \
--hash-key=<base64-key> \
--salt-separator=<base64-separator> \
--rounds=8 \
--mem-cost=8
Remote Config
firebase remoteconfig:get
firebase remoteconfig:get --output config.json
firebase remoteconfig:versions:list --limit 20
firebase remoteconfig:rollback --version-number 5
App Distribution
# Distribute Android APK
firebase appdistribution:distribute app.apk \
--app APP_ID \
--release-notes "Bug fixes and improvements" \
--testers "[email protected]" \
--groups "qa-team,beta-users"
# Manage testers
firebase appdistribution:testers:add [email protected] --group-alias qa-team
firebase appdistribution:testers:remove [email protected]
firebase appdistribution:groups:list
Extensions
firebase ext:list
firebase ext:info firebase/delete-user-data
firebase ext:install firebase/delete-user-data
firebase ext:configure delete-user-data
firebase ext:update delete-user-data
firebase ext:uninstall delete-user-data
firebase ext:export
App Hosting (Next.js / Angular)
firebase init apphosting
firebase apphosting:backends:create --location us-central1
firebase apphosting:backends:list
firebase deploy --only apphosting
firebase apphosting:rollouts:create BACKEND_ID --git-branch main
Deploy Targets (multi-site / multi-instance)
# Apply target name to a resource
firebase target:apply hosting prod-site my-app-prod
firebase target:apply storage prod-bucket my-app-bucket
firebase target:apply database default my-app-db
# Use target in deploy
firebase deploy --only hosting:prod-site
# Clear targets
firebase target:clear hosting prod-site
Best practices
- Use service accounts for CI/CD: Set
GOOGLE_APPLICATION_CREDENTIALSinstead of--token(deprecated). - Use
--onlyin deploy: Never deploy everything blindly in production — always scope with--only. - Emulators for development: Always run
emulators:startlocally before deploying; use--import/--export-on-exitfor persistence. - Preview channels before production: Use
hosting:channel:deployfor staging reviews beforefirebase deploy --only hosting. - Secrets over functions:config: For Cloud Functions 2nd gen, use
functions:secrets:set(Secret Manager) instead of deprecatedfunctions:config:set. --non-interactivein scripts: Always add--non-interactivein automated scripts to avoid hanging on prompts..firebasercin VCS: Commit.firebaserc(project aliases) but add secrets and service account keys to.gitignore.--debugfor troubleshooting: Run any failing command with--debugfor verbose output.
Troubleshooting
| Issue | Solution |
|---|---|
command not found: firebase |
Run npm install -g firebase-tools; check npm bin -g is in PATH |
| Authentication error in CI | Set GOOGLE_APPLICATION_CREDENTIALS to serhow to use firebase-cli How to use firebase-cli on CursorAI-first code editor with Composer 1 PrerequisitesBefore installing skills in Cursor, ensure your development environment meets these requirements:
2 Execute installation commandExecute the skills CLI command in your project's root directory to begin installation: $npx skills add https://github.com/supercent-io/skills-template --skill firebase-cli The skills CLI fetches 3 Select Cursor when promptedThe CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor: ◆ Which agents do you want to install to? │ │ ── Universal (.agents/skills) ── always included ──── │ • Amp │ • Antigravity │ • Cline │ • Codex │ ●Cursor(selected) │ • Cursor │ • Windsurf 4 Verify installationConfirm successful installation by checking the skill directory location: .cursor/skills/firebase-cli Reload or restart Cursor to activate firebase-cli. Access the skill through slash commands (e.g., ⚠ Security & Verification NoticeWe perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use. Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment. List & Monetize Your SkillSubmit your Claude Code skill and start earning Use Cases▌User Story & Requirements GenerationCreate detailed user stories, acceptance criteria, and feature specs Example Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios ✓ Reduce spec writing time by 50%, ensure comprehensive coverage Competitive AnalysisResearch competitors, compare features, identify gaps Example Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities ✓ Complete competitive research in 2 hours instead of 2 days Roadmap PrioritizationEvaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs Example Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale ✓ Make data-driven prioritization decisions faster Stakeholder CommunicationDraft PRDs, status updates, and stakeholder presentations Example Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement ✓ Save 3-5 hours/week on communication overhead Implementation Guide▌Prerequisites
Time Estimate30-60 minutes to see productivity improvements Installation Steps
Common Pitfalls
Best Practices▌✓ Do
✗ Don't
💡 Pro Tips
When to Use This▌✓ Use WhenUse for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work. ✗ Avoid WhenAvoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed. Learning Path▌
DiscussionProduct Hunt–style comments (not star reviews)
general reviews Ratings4.8★★★★★33 reviews
showing 1-10 of 33 1 / 4 |