# Firebase Authentication and App Development Basics: A CLI-First Workflow

> Learn Firebase authentication and app development basics with a CLI-first workflow. Automate auth, project creation, and SDK initialization with the Google Skills repository.

- Repository: [Google/skills](https://github.com/google/skills)
- Tags: getting-started
- Published: 2026-08-09

---

**The Google Skills repository provides a `firebase-basics` skill that automates Firebase CLI authentication, project creation, and client SDK initialization through safe, reproducible command-line workflows.**

The `google/skills` repository hosts ready-to-use skill definitions for Google Cloud products, including comprehensive **Firebase authentication and app development basics**. The `firebase-basics` skill, defined in [`skills/cloud/firebase-basics/SKILL.md`](https://github.com/google/skills/blob/main/skills/cloud/firebase-basics/SKILL.md), delivers an opinionated, CLI-first approach to setting up Firebase projects without requiring manual interaction with the Firebase Console.

## Understanding the Skill Architecture

The `firebase-basics` skill is structured as a self-contained pipeline that guides agents through safe, deterministic operations. According to the source code, the architecture consists of four primary components:

- **Skill metadata** — Declares the skill name, category, and usage constraints in [`SKILL.md`](https://github.com/google/skills/blob/main/SKILL.md). It explicitly restricts operations to CLI login, project creation, and configuration download, warning against using the skill for hosting or Firestore management.
- **Prerequisite checks** — Verifies that `firebase-tools@latest` is installed and that the appropriate MCP server is configured for the current agent (Gemini CLI, Antigravity, Claude Code, etc.) via [`references/local-env-setup.md`](https://github.com/google/skills/blob/main/references/local-env-setup.md).
- **Authentication flow** — Wraps the Firebase CLI login command with `npx -y` to guarantee the latest version, as implemented in [`SKILL.md`](https://github.com/google/skills/blob/main/SKILL.md) lines 43-46.
- **Agent-specific integration** — Provides refresh instructions in `references/refresh/*.md` and setup guides in `references/setup/*` for each supported agent environment.

## Authenticating with the Firebase CLI

The skill enforces a **"CLI-first"** approach to Firebase authentication and app development basics, ensuring that all interactions begin with secure token acquisition. The standard authentication command uses `npx -y` to avoid global installation dependencies:

```bash
npx -y firebase-tools@latest login

```

For headless environments or remote servers where browser access is unavailable, the skill supports the `--no-localhost` flag (documented in [`SKILL.md`](https://github.com/google/skills/blob/main/SKILL.md) lines 46-48):

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

```

This generates a URL that you can open on a local machine to complete authentication, returning a token to the headless session.

## Managing Projects and Apps

Once authenticated, the skill provides structured commands for project lifecycle management. According to [`SKILL.md`](https://github.com/google/skills/blob/main/SKILL.md) lines 73-78, you can create a new Firebase project or select an existing one:

```bash

# Create a new project

npx -y firebase-tools@latest projects:create my-project-id --display-name "My Project"

# Select project for subsequent commands

npx -y firebase-tools@latest use my-project-id

```

To register a web application, the skill uses the `apps:create` command documented in [`references/web_setup.md`](https://github.com/google/skills/blob/main/references/web_setup.md) lines 7-16:

```bash
npx -y firebase-tools@latest apps:create web my-web-app

```

The CLI outputs a generated `APP_ID` that you must capture for configuration retrieval.

## Configuring Client SDKs

After creating the app, the skill retrieves the SDK configuration without requiring console access. As specified in [`SKILL.md`](https://github.com/google/skills/blob/main/SKILL.md) lines 23-28 and [`web_setup.md`](https://github.com/google/skills/blob/main/web_setup.md) lines 33-35, use the `apps:sdkconfig` command:

```bash
npx -y firebase-tools@latest apps:sdkconfig <APP_ID> > firebase-config.json

```

The `firebase-basics` skill provides a standard initialization pattern for web applications in [`references/web_setup.md`](https://github.com/google/skills/blob/main/references/web_setup.md) lines 39-58. This modular JavaScript setup initializes the app and exports the authentication instance:

```javascript
// firebase.js
import { initializeApp } from "firebase/app";
import { getAuth } from "firebase/auth";

const firebaseConfig = {
  apiKey: "API_KEY",
  authDomain: "PROJECT_ID.firebaseapp.com",
  projectId: "PROJECT_ID",
  storageBucket: "PROJECT_ID.firebasestorage.app",
  messagingSenderId: "SENDER_ID",
  appId: "APP_ID",
  measurementId: "G-MEASUREMENT_ID"
};

export const app = initializeApp(firebaseConfig);
export const auth = getAuth(app);

```

You can then import the initialized app into other modules to access Firebase services:

```javascript
import { getFirestore, collection, getDocs } from "firebase/firestore";
import { app } from "./firebase";

const db = getFirestore(app);

async function listUsers() {
  const snapshot = await getDocs(collection(db, "users"));
  snapshot.forEach(doc => console.log(`${doc.id} =>`, doc.data()));
}

listUsers();

```

## Handling Edge Cases and Agent Integration

The skill includes specific guidance for common integration issues. For login failures in containerized environments, [`SKILL.md`](https://github.com/google/skills/blob/main/SKILL.md) lines 46-48 recommend the `--no-localhost` workaround mentioned previously.

For extended Firebase functionality beyond basic setup, [`SKILL.md`](https://github.com/google/skills/blob/main/SKILL.md) lines 48-52 suggest installing the Genkit skill. Each supported agent (Gemini CLI, Antigravity, Claude Code) maintains specific refresh instructions in `references/refresh/*.md` to ensure the Firebase MCP server and skill files remain current.

## Summary

- The `firebase-basics` skill in `google/skills` provides a **CLI-first workflow** for Firebase authentication and app development basics.
- Authentication uses `npx -y firebase-tools@latest login` with support for headless environments via `--no-localhost`.
- Project management combines `projects:create`, `use`, and `apps:create` commands defined in [`SKILL.md`](https://github.com/google/skills/blob/main/SKILL.md).
- SDK configuration retrieval via `apps:sdkconfig` eliminates manual console configuration.
- Initialization patterns in [`references/web_setup.md`](https://github.com/google/skills/blob/main/references/web_setup.md) demonstrate proper modular Firebase SDK setup for web applications.

## Frequently Asked Questions

### How do I authenticate to Firebase in a headless environment?

Use the `--no-localhost` flag with the login command. As documented in [`SKILL.md`](https://github.com/google/skills/blob/main/SKILL.md) lines 46-48, run `npx -y firebase-tools@latest login --no-localhost` to generate a URL that you can open on a local machine, which then provides a token to complete authentication on the remote server.

### What is the difference between creating a Firebase project and registering an app?

Creating a project (`projects:create`) provisions the top-level Firebase container and underlying Google Cloud project. Registering an app (`apps:create web`) generates platform-specific credentials (web, Android, or iOS) within that project. The skill separates these steps in [`SKILL.md`](https://github.com/google/skills/blob/main/SKILL.md) lines 73-78 to ensure proper resource hierarchy.

### How do I update the Firebase MCP server for my agent?

Each agent environment (Gemini CLI, Antigravity, Claude Code) maintains specific refresh instructions in the `references/refresh/` directory. These files describe how to update the Firebase-related MCP server and skill files to match the latest `google/skills` repository versions.

### Can I use this skill to deploy Firebase Hosting or configure Firestore security rules?

No. The skill metadata in [`SKILL.md`](https://github.com/google/skills/blob/main/SKILL.md) explicitly restricts usage to safe operations: CLI authentication, project creation, app registration, and SDK configuration download. The skill warns against using it for hosting deployment, Firestore database management, or security rule configuration, directing users to specialized skills like Genkit for extended functionality.