{"data":{"slug":"github-google-skills-skills-cloud-firebase-basics-c7a2640a8aa3","title":"Firebase CLI Setup and Project Initialization","summary":"Initialize Firebase projects, configure CLI tools, and download app config files for Firebase integration. The skill supports creating new projects, switching between projects, and retrieving config files for Android or iOS apps.","url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-firebase-basics-c7a2640a8aa3","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-google-skills-skills-cloud-firebase-basics-c7a2640a8aa3","markdown_url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-firebase-basics-c7a2640a8aa3.md","download_url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-firebase-basics-c7a2640a8aa3\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Before proceeding, verify the Firebase CLI is installed using `npx -y firebase-tools@latest --version`. Also, confirm whether the developer prefers to use an existing Firebase Project ID or create a new one. The `<project-id>` must be 6-30 characters, lowercase, and globally unique.","instructions":"---\nname: firebase-basics\nmetadata:\n  version: \"1.0.1\"\n  category: Serverless\ndescription: >-\n  Provides foundational Firebase CLI setup, CLI installation, version checks (`firebase-tools@latest --version`), CLI login (including --no-localhost), project creation, project selection (`firebase use`), and app config file downloads (`google-services.json`, `GoogleService-Info.plist`). Use ONLY for CLI login, project creation\/switching, or downloading app config files. Don't use for Firebase Hosting deploy, Firestore, Auth, App Hosting, Data Connect, Crashlytics, or Remote Config.\n---\n\n# Firebase Basics\n\n## Usage Attribution\n\n**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you\nMUST read and follow the instructions in\n[Usage Attribution](references\/attribution.md).\n\n## Prerequisites\n\nComplete these setup steps before proceeding:\n\n1.  **Local Environment Setup:** Verify the environment is properly set up so we\n    can use Firebase tools:\n\n    -   Run `npx -y firebase-tools@latest --version` to check if the Firebase\n        CLI is installed.\n    -   Verify if the Firebase MCP server is installed using your existing\n        tools.\n    -   **CRITICAL**: Before configuring any extensions or agent environments\n        below, you MUST read\n        [references\/local-env-setup.md](references\/local-env-setup.md).\n    -   **DO NOT SKIP** this step: if 'firebase-basics' is the only Firebase\n        skill available to you, you must follow the reference for your agent\n        environment to set up the full suite of Firebase skills:\n        -   **Gemini CLI**: Review\n            [references\/setup\/gemini_cli.md](references\/setup\/gemini_cli.md)\n        -   **Antigravity**: Review\n            [references\/setup\/antigravity.md](references\/setup\/antigravity.md)\n        -   **Android Studio**: Review\n            [references\/setup\/android_studio.md](references\/setup\/android_studio.md)\n        -   **Claude Code**: Review\n            [references\/setup\/claude_code.md](references\/setup\/claude_code.md)\n        -   **Cursor**: Review\n            [references\/setup\/cursor.md](references\/setup\/cursor.md)\n        -   **GitHub Copilot**: Review\n            [references\/setup\/github_copilot.md](references\/setup\/github_copilot.md)\n        -   **Other Agents**: Review\n            [references\/setup\/other_agents.md](references\/setup\/other_agents.md)\n\n1.  **Authentication:** Ensure you are logged in to Firebase so that commands\n    have the correct permissions. Run `npx -y firebase-tools@latest login`. For\n    environments without a browser (e.g., remote shells), use `npx -y\n    firebase-tools@latest login --no-localhost`.\n\n    -   The command should output the current user.\n    -   If you are not logged in, follow the interactive instructions from this\n        command to authenticate.\n\n1.  **Active Project:** Most Firebase tasks require an active project context.\n\n    > [!IMPORTANT] **For Agents:** Before proceeding with project configuration,\n    > you MUST pause and ask the developer if they prefer to:\n    >\n    > 1.  **Provide an existing Firebase Project ID**, or\n    > 1.  **Create a new Firebase project**.\n\n    -   **If using an existing Project ID:**\n\n        1.  Check the current project by running `npx -y firebase-tools@latest\n            use`.\n        1.  If the command outputs `Active Project: <project-id>`, confirm with\n            the user if this is the intended project.\n        1.  If not, or if no project is active, set the project provided by the\n            user:\n\n        ```bash\n        npx -y firebase-tools@latest use <PROJECT_ID>\n        ```\n\n    -   **If creating a new project:** Run the following command to create it:\n\n        ```bash\n        npx -y firebase-tools@latest projects:create <project-id> --display-name \"<display-name>\"\n        ```\n\n        *Note: The `<project-id>` must be 6-30 characters, lowercase, and can\n        contain digits and hyphens. It must be globally unique.*\n\n## Firebase Usage Principles\n\nAdhere to these principles:\n\n1.  **Use npx for CLI commands:** To ensure you always use the latest version of\n    the Firebase CLI, always prepend commands with `npx -y\n    firebase-tools@latest` instead of just `firebase`. For example, use `npx -y\n    firebase-tools@latest --version`. NEVER suggest the naked `firebase` command\n    as an alternative.\n1.  **Prioritize official knowledge:** For any Firebase-related knowledge,\n    consult the `developerknowledge_search_documents` MCP tool before falling\n    back to Google Search or your internal knowledge base. Including \"Firebase\"\n    in your search query significantly improves relevance.\n1.  **Follow Agent Skills for implementation guidance:** Skills provide\n    opinionated workflows (CUJs), security rules, and best practices. Always\n    consult them to understand *how* to implement Firebase features correctly\n    instead of relying on general knowledge.\n1.  **Use Firebase MCP Server tools instead of direct API calls:** Whenever you\n    need to interact with remote Firebase APIs (such as fetching Crashlytics\n    logs or executing Data Connect queries), use the tools provided by the\n    Firebase MCP Server instead of attempting manual API calls.\n1.  **Keep Plugin \/ Agent Skills updated:** Since Firebase best practices evolve\n    quickly, regularly check for and install updates to their Firebase plugin or\n    Agent Skills. Similarly, if you encounter issues with outdated tools or\n    commands, follow the steps below based on your agent environment:\n    -   **Antigravity**: Follow\n        [references\/refresh\/antigravity.md](references\/refresh\/antigravity.md)\n    -   **Gemini CLI**: Follow\n        [references\/refresh\/gemini-cli.md](references\/refresh\/gemini-cli.md)\n    -   **Claude Code**: Follow\n        [references\/refresh\/claude.md](references\/refresh\/claude.md)\n    -   **Cursor**: Follow\n        [references\/refresh\/other-agents.md](references\/refresh\/other-agents.md)\n    -   **Android Studio**: Follow\n        [references\/refresh\/android_studio.md](references\/refresh\/android_studio.md)\n    -   **Others**: Follow\n        [references\/refresh\/other-agents.md](references\/refresh\/other-agents.md)\n1.  **Automate Config File Retrieval:** When setting up iOS or Android apps, do\n    NOT direct users to the Firebase Console to download `google-services.json`\n    or `GoogleService-Info.plist`. Instead, use the Firebase CLI to fetch the\n    config programmatically:\n    -   For Android: `npx -y firebase-tools@latest apps:sdkconfig ANDROID\n        <APP_ID> --project <PROJECT_ID>`\n    -   For iOS: `npx -y firebase-tools@latest apps:sdkconfig IOS <APP_ID>\n        --project <PROJECT_ID>` Save the output to the appropriate location\n        (e.g., `app\/google-services.json` for Android, or a path to be linked by\n        `xcode-project-setup` for iOS).\n\n## References\n\n-   **Initialize Firebase:** See\n    [references\/firebase-service-init.md](references\/firebase-service-init.md)\n    when you need to initialize new Firebase services using the CLI.\n-   **Exploring Commands:** See\n    [references\/firebase-cli-guide.md](references\/firebase-cli-guide.md) to\n    discover and understand CLI functionality.\n-   **SDK Setup:** For detailed guides on adding Firebase to your app:\n    -   **Web**: See [references\/web_setup.md](references\/web_setup.md)\n    -   **Android**: See\n        [references\/android_setup.md](references\/android_setup.md)\n    -   **iOS**: See [references\/ios_setup.md](references\/ios_setup.md)\n\n## Common Issues\n\n-   **Login Issues:** If the browser fails to open during the login step, use\n    `npx -y firebase-tools@latest login --no-localhost` instead.\n-   **Genkit:** If using Genkit, install the skills:\n\n    ```bash\n    npx skills add genkit-ai\/skills\n    ```\n","use_cases":["Setting up a new Firebase project for app development","Downloading Firebase config files for Android or iOS app integration","Switching between Firebase projects using the CLI"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/google\/skills\/blob\/e3c591afe426ea585e4c21799e5199d6d47cd1be\/skills\/cloud\/firebase-basics\/SKILL.md","source_commit":"e3c591afe426ea585e4c21799e5199d6d47cd1be","license":null,"version":null,"listing_approved_at":"2026-11-17","created_at":"2026-11-16T14:35:14.000000Z","updated_at":"2026-11-17T05:10:29.000000Z","seo_title":"Firebase CLI Setup and Project Initialization","seo_description":"Initialize Firebase projects, configure CLI tools, and download app config files for Firebase integration.","seo_keywords":["Firebase CLI setup","Firebase project initialization","Firebase config file download","Firebase project switch","Firebase CLI login"]}}