Provides foundational setup, authentication, and project management workflows for Firebase using the Firebase CLI. Use when checking Firebase CLI version (must use 'npx -y firebase-tools@latest --version'), initializing a Firebase environment, authenticating, setting active projects, or setting up google-services.json or GoogleService-Info.plist files.
$npx -y skills add firebase/agent-skills --skill firebase-basicsInstalls into the current project.
Run `npx skills use "https://github.com/firebase/agent-skills" --skill "firebase/agent-skills/firebase-basics"` and follow the generated skill instructions now. Read its complete output, redirecting it to a temporary file first if necessary. Resolve relative paths from the supporting-files directory it provides.
Use the skills in "https://github.com/firebase/agent-skills" that are relevant to the current task. Run `npx skills add "https://github.com/firebase/agent-skills"` and select the relevant skills, then follow their instructions.
| 1 | # Prerequisites |
| 2 | |
| 3 | Complete these setup steps before proceeding: |
| 4 | |
| 5 | 1. **Local Environment Setup:** Verify the environment is properly set up so we |
| 6 | can use Firebase tools: |
| 7 | |
| 8 | - Run `npx -y firebase-tools@latest --version` to check if the Firebase CLI |
| 9 | is installed. |
| 10 | - Verify if the Firebase MCP server is installed using your existing tools. |
| 11 | - **CRITICAL**: Before configuring any extensions or agent environments |
| 12 | below, you MUST read |
| 13 | [references/local-env-setup.md](references/local-env-setup.md). |
| 14 | - **DO NOT SKIP** this step: if 'firebase-basics' is the only Firebase skill |
| 15 | available to you, you must follow the reference for your agent environment |
| 16 | to set up the full suite of Firebase skills: |
| 17 | - **Gemini CLI**: Review |
| 18 | [references/setup/gemini_cli.md](references/setup/gemini_cli.md) |
| 19 | - **Antigravity**: Review |
| 20 | [references/setup/antigravity.md](references/setup/antigravity.md) |
| 21 | - **Android Studio**: Review |
| 22 | [references/setup/android_studio.md](references/setup/android_studio.md) |
| 23 | - **Claude Code**: Review |
| 24 | [references/setup/claude_code.md](references/setup/claude_code.md) |
| 25 | - **Cursor**: Review |
| 26 | [references/setup/cursor.md](references/setup/cursor.md) |
| 27 | - **GitHub Copilot**: Review |
| 28 | [references/setup/github_copilot.md](references/setup/github_copilot.md) |
| 29 | - **Other Agents**: Review |
| 30 | [references/setup/other_agents.md](references/setup/other_agents.md) |
| 31 | |
| 32 | 1. **Authentication:** Ensure you are logged in to Firebase so that commands |
| 33 | have the correct permissions. Run `npx -y firebase-tools@latest login`. For |
| 34 | environments without a browser (e.g., remote shells), use |
| 35 | `npx -y firebase-tools@latest login --no-localhost`. |
| 36 | |
| 37 | - The command should output the current user. |
| 38 | - If you are not logged in, follow the interactive instructions from this |
| 39 | command to authenticate. |
| 40 | |
| 41 | 1. **Active Project:** Most Firebase tasks require an active project context. |
| 42 | |
| 43 | > [!IMPORTANT] **For Agents:** Before proceeding with project configuration, |
| 44 | > you MUST pause and ask the developer if they prefer to: |
| 45 | > |
| 46 | > 1. **Provide an existing Firebase Project ID**, or |
| 47 | > 1. **Create a new Firebase project**. |
| 48 | |
| 49 | - **If using an existing Project ID:** |
| 50 | |
| 51 | 1. Check the current project by running `npx -y firebase-tools@latest use`. |
| 52 | 1. If the command outputs `Active Project: <project-id>`, confirm with the |
| 53 | user if this is the intended project. |
| 54 | 1. If not, or if no project is active, set the project provided by the |
| 55 | user: |
| 56 | ```bash |
| 57 | npx -y firebase-tools@latest use <PROJECT_ID> |
| 58 | ``` |
| 59 | |
| 60 | - **If creating a new project:** Run the following command to create it: |
| 61 | |
| 62 | ```bash |
| 63 | npx -y firebase-tools@latest projects:create <project-id> --display-name "<display-name>" |
| 64 | ``` |
| 65 | |
| 66 | *Note: The `<project-id>` must be 6-30 characters, lowercase, and can |
| 67 | contain digits and hyphens. It must be globally unique.* |
| 68 | |
| 69 | # Firebase Usage Principles |
| 70 | |
| 71 | Adhere to these principles: |
| 72 | |
| 73 | 1. **Use npx for CLI commands:** To ensure you always use the latest version of |
| 74 | the Firebase CLI, always prepend commands with `npx -y firebase-tools@latest` |
| 75 | instead of just `firebase`. For example, use |
| 76 | `npx -y firebase-tools@latest --version`. NEVER suggest the naked `firebase` |
| 77 | command as an alternative. |
| 78 | 1. **Prioritize official knowledge:** For any Firebase-related knowledge, |
| 79 | consult the `developerknowledge_search_documents` MCP tool before falling |
| 80 | back to Google Search or your internal knowledge base. Including "Firebase" |
| 81 | in your search query significantly improves relevance. |
| 82 | 1. **Follow Agent Skills for implementation guidance:** Skills provide |
| 83 | opinionated workflows (CUJs), security rules, and best practices. Always |
| 84 | consult them to understand *how* to implement Firebase features correctly |
| 85 | instead of relying on general knowledge. |
| 86 | 1. **Use Firebase MCP Server tools instead of direct API calls:** Whenever you |
| 87 | need to interact with remote Firebase APIs (such as fetching Crashlytics logs |
| 88 | or executing Data Connect queries), use the tools provided by the Firebase |
| 89 | MCP Server instead of attempting manual API calls. |
| 90 | 1. **Keep Plugin / Agent Skills updated:** Since Firebase best practices evolve |
| 91 | quickly, regularly check for and install updates to their Firebase plugin or |
| 92 | Agent Skills. Similarly, if you encounter issues with outdated tools or |
| 93 | commands, follow the steps below based on your agent environment: |
| 94 | - **Antigravity**: Follow |
| 95 | [references/refresh/antigravity.md](references/refresh/antigravity.md) |
| 96 | - **Gemini CLI**: Follow |
| 97 | [references/refresh/gemini-cli.md](references/refresh/gemini-cli.md) |
| 98 | - **Claude Code**: Follow |
| 99 | [references/refresh/claude.md](references/refresh/claude.md) |
| 100 | - **Cursor**: Follow |
| 101 | [references/refresh/other-agents.md](references/refresh/other-agents.md) |
| 102 | - **Android Studio**: Follow |
| 103 | [references/refresh/android_studio.md](references/refresh/android_studio.md) |
| 104 | - **Others**: Follow |
| 105 | [references/refresh/other-agents.md](references/refresh/other-agents.md) |
| 106 | 1. **Automate Config File Retrieval:** When setting up iOS or Android apps, do |
| 107 | NOT direct users to the Firebase Console to download `google-services.json` |
| 108 | or `GoogleService-Info.plist`. Instead, use the Firebase CLI to fetch the |
| 109 | config programmatically: |
| 110 | - For Android: |
| 111 | `npx -y firebase-tools@latest apps:sdkconfig ANDROID <APP_ID> --project <PROJECT_ID>` |
| 112 | - For iOS: |
| 113 | `npx -y firebase-tools@latest apps:sdkconfig IOS <APP_ID> --project <PROJECT_ID>` |
| 114 | Save the output to the appropriate location (e.g., |
| 115 | `app/google-services.json` for Android, or a path to be linked by |
| 116 | `xcode-project-setup` for iOS). |
| 117 | |
| 118 | # References |
| 119 | |
| 120 | - **Initialize Firebase:** See |
| 121 | [references/firebase-service-init.md](references/firebase-service-init.md) |
| 122 | when you need to initialize new Firebase services using the CLI. |
| 123 | - **Exploring Commands:** See |
| 124 | [references/firebase-cli-guide.md](references/firebase-cli-guide.md) to |
| 125 | discover and understand CLI functionality. |
| 126 | - **SDK Setup:** For detailed guides on adding Firebase to your app: |
| 127 | - **Web**: See [references/web_setup.md](references/web_setup.md) |
| 128 | - **Android**: See [references/android_setup.md](references/android_setup.md) |
| 129 | - **iOS**: See [references/ios_setup.md](references/ios_setup.md) |
| 130 | |
| 131 | # Common Issues |
| 132 | |
| 133 | - **Login Issues:** If the browser fails to open during the login step, use |
| 134 | `npx -y firebase-tools@latest login --no-localhost` instead. |
| 135 | - **Genkit:** If using Genkit, install the skills: |
| 136 | ```bash |
| 137 | npx skills add genkit-ai/skills |
| 138 | ``` |