Provides foundational Firebase CLI setup, CLI installation, version checks (`firebase-tools@latest --version`), CLI login (including --no-localhost), project cr
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-firebase-basics-77ee9f4a0dd2 ,按照其中的说明把「firebase-basics」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Complete these setup steps before proceeding:
Local Environment Setup: Verify the environment is properly set up so we can use Firebase tools:
npx -y firebase-tools@latest --version to check if the Firebase
CLI is installed.Authentication: Ensure you are logged in to Firebase so that commands
have the correct permissions. Run npx -y firebase-tools@latest login. For
environments without a browser (e.g., remote shells), use npx -y firebase-tools@latest login --no-localhost.
Active Project: Most Firebase tasks require an active project context.
[!IMPORTANT] For Agents: Before proceeding with project configuration, you MUST pause and ask the developer if they prefer to:
- Provide an existing Firebase Project ID, or
- Create a new Firebase project.
If using an existing Project ID:
npx -y firebase-tools@latest use.Active Project: <project-id>, confirm with
the user if this is the intended project.npx -y firebase-tools@latest use <PROJECT_ID>
If creating a new project: Run the following command to create it:
npx -y firebase-tools@latest projects:create <project-id> --display-name "<display-name>"
Note: The <project-id> must be 6-30 characters, lowercase, and can
contain digits and hyphens. It must be globally unique.
Adhere to these principles:
npx -y firebase-tools@latest instead of just firebase. For example, use npx -y firebase-tools@latest --version. NEVER suggest the naked firebase command
as an alternative.developerknowledge_search_documents MCP tool before falling
back to Google Search or your internal knowledge base. Including "Firebase"
in your search query significantly improves relevance.Login Issues: If the browser fails to open during the login step, use
npx -y firebase-tools@latest login --no-localhost instead.
Genkit: If using Genkit, install the skills:
npx skills add genkit-ai/skills
google-services.json
or GoogleService-Info.plist. Instead, use the Firebase CLI to fetch the
config programmatically:
npx -y firebase-tools@latest apps:sdkconfig ANDROID <APP_ID> --project <PROJECT_ID>npx -y firebase-tools@latest apps:sdkconfig IOS <APP_ID> --project <PROJECT_ID> Save the output to the appropriate location
(e.g., app/google-services.json for Android, or a path to be linked by
xcode-project-setup for iOS).