firebase-basics: Writing the Firebase CLI Getting Started Workflow into an Agent Skill

Introduction

When integrating Firebase on mobile or Web platforms, the common bottlenecks are rarely about “knowing how to write the SDK.” Instead, they lie in logging into the CLI, selecting the correct project, and placing google-services.json or GoogleService-Info.plist in the correct path. Manually navigating the console, memorizing firebase commands, and asking a coding Agent to perform the same steps often lead to miscommunication. The firebase-basics Skill, provided by Google in the google/skills repository, codifies the basic Firebase CLI operations and Agent-side constraints into SKILL.md, allowing the assistant to align the environment and permission boundaries before taking action.

The following section describes the positioning of this Skill, what it can and cannot do, and how to install and use it alongside other Firebase Skills in environments like Cursor.

What is this

firebase-basics is one of the entries in Google’s official Agent Skills collection, located at skills/cloud/firebase-basics and categorized under Serverless in the metadata.

The official description summarizes its responsibilities as providing basic Firebase CLI setup, including CLI installation and version checking, login (including scenarios without a browser), project creation and switching, and methods for obtaining app configuration files (google-services.json, GoogleService-Info.plist).

It is crucial to clarify the scope: it is strictly for CLI login, project creation/switching, and downloading app configuration files. It is not for implementation guidance on topics such as Firebase Hosting deployment, Firestore, Auth, App Hosting, Data Connect, Crashlytics, or Remote Config. Those capabilities should be delegated to specialized Firebase Skills (in the same repo or others) and used in conjunction with the Firebase MCP Server and official documentation search tools.

Core Functionality

Environment and CLI Conventions

The Skill requires the Agent to always pull the latest CLI via npx when executing Firebase-related commands, rather than using a bare global firebase command. Version check example:

npx -y firebase-tools@latest --version

Prerequisite steps also include: confirming the local machine environment is available, checking if the Firebase MCP Server is installed, and reading the references/local-env-setup.md included with the Skill before configuring extensions or the Agent environment. If only the firebase-basics Skill is currently present, the official requirement is to read the corresponding setup documentation (covering Cursor, Claude Code, Gemini CLI, GitHub Copilot, Android Studio, etc.) based on the Agent type being used, to install the complete Firebase Skill suite.

Authentication and Project Context

Log in to Firebase to ensure subsequent commands have the correct permissions:

npx -y firebase-tools@latest login

For environments where a browser cannot be opened, such as remote shells:

npx -y firebase-tools@latest login --no-localhost

Successful authentication should output the current user; if not logged in, follow the command prompts to complete interactive authentication.

Most tasks depend on the “current active project.” The Skill mandates that the Agent must pause and ask the developer before configuring the project: whether to use an existing Project ID or create a new project.

Check the current project:

npx -y firebase-tools@latest use

If the output is Active Project: <project-id>, confirm with the user if this is the expected project; otherwise, switch using the ID provided by the user:

npx -y firebase-tools@latest use <PROJECT_ID>

Create a new project:

npx -y firebase-tools@latest projects:create <project-id> --display-name "<display-name>"

Here, <project-id> must be 6–30 characters, lowercase, may contain numbers and hyphens, and must be globally unique.

App Configuration Files (CLI Fetch, Not Manual Console Export)

When setting up Android or iOS apps, the Skill requires not having the user manually download configuration files from the Firebase Console, but instead using the CLI:

Android:

npx -y firebase-tools@latest apps:sdkconfig ANDROID <APP_ID> --project <PROJECT_ID>

iOS:

npx -y firebase-tools@latest apps:sdkconfig IOS <APP_ID> --project <PROJECT_ID>

The output must be saved to the project’s convention path (e.g., app/google-services.json for Android, or the path indicated by Skills like xcode-project-setup for iOS).

Agent-side Working Principles (Specified in the Skill)

  1. For any Firebase-related knowledge, prioritize searching via the developerknowledge_search_documents MCP tool, including “Firebase” in the query to improve relevance, before considering general searches or built-in model knowledge.
  2. Follow the workflows and security rules within specific Firebase Agent Skills for functional implementation, rather than relying on generic knowledge.
  3. When interacting with remote Firebase APIs (e.g., Crashlytics logs, Data Connect queries), use the tools provided by the Firebase MCP Server to avoid hand-writing API calls.
  4. Regularly update Firebase plugins or Agent Skills; if a tool is outdated, read the corresponding documentation under references/refresh/ based on the environment (e.g., other-agents.md for Cursor).

The Skill also points to initialization services, CLI guides, and Web / Android / iOS SDK setup documentation paths via References, allowing for deeper exploration once the basic CLI is ready.

Installation and Activation

firebase-basics is distributed with the google/skills repository. To install the entire repository (or select specific Skills), use the skills CLI:

npx skills add google/skills

Follow the prompts to select specific Skills, target Agents, and installation scope (project-level or global). If npx is not available in the environment, Node.js (including npm/npx) must be installed first.

Update installed Skills:

npx skills update

Optionally clean up deprecated Skills. The repository README also provides a skills.sh installation entry.

In Cursor, the official Prerequisites section points to references/setup/cursor.md and the refresh instructions references/refresh/other-agents.md; specific click paths should be based on the files within the Skill repository. After installation, the Agent loads and executes the full text of SKILL.md when firebase-basics is triggered.

If using Genkit, the Common Issues section suggests additional installation:

npx skills add genkit-ai/skills

Typical Usage (Agent Perspective)

When a developer requests to “integrate Firebase” or “download google-services.json,” an Agent loaded with firebase-basics will generally proceed in the following order (consistent with the Skill text):

  1. Use npx -y firebase-tools@latest --version to confirm CLI availability and complete local-env-setup and (if necessary) the configuration of the full Firebase Skills suite.
  2. Execute login or login --no-localhost to confirm the authenticated user.
  3. Ask whether to continue with an existing project or create a new one; fix the active project using use or projects:create.
  4. When APP_ID and PROJECT_ID are known, use apps:sdkconfig to generate Android/iOS configuration files and write them to the project path.
  5. When specific Firebase products need to be enabled, refer to references/firebase-service-init.md and platform setup documentation, rather than expanding on implementation details for Hosting, Firestore, etc., within this Skill.

If login fails and the browser cannot be opened, the Skill explicitly defines the fallback as login --no-localhost.

Applicable Scenarios and Caveats

Who is it for

  • Independent developers or startup teams performing Firebase project initialization within Agents like Cursor, Claude Code, or Copilot.
  • Those who want the Agent to uniformly use npx -y firebase-tools@latest, avoiding outdated CLI commands and the repetitive labor of “going to the console to click download.”

Boundaries and Notes

  • This Skill is the foundation for “CLI and project context + config file acquisition,” not a comprehensive Firebase encyclopedia; product lines like Hosting, databases, and authentication require other Skills and MCP.
  • The Agent must confirm options with the user before proceeding to avoid accidental operations on the wrong GCP/Firebase project.
  • Firebase practices evolve rapidly; the Skill requires keeping plugins and Skills updated, and prioritizing official MCP and documentation search.

Firebase remains a common backend choice in mobile and Web scenarios; Google’s codification of the introductory CLI workflow into an Agent Skill helps fill the model’s blind spots regarding details like “npx prefix, non-localhost login, CLI config fetching,” and strings together reproducible workflows with other Firebase Skills in the same repository.

Official Skill Directory: https://github.com/google/skills/tree/main/skills/cloud/firebase-basics

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye