Chapter 03 · Firebase App Hosting Basics
Subchapter 3.1
references/cli_commands.mdMarkdown3 KBView on GitHub
The Firebase CLI provides a comprehensive suite of commands to manage App Hosting resources. These commands are often faster and more scriptable than using the Firebase Console.
Purpose: Interactive command that sets up App Hosting in your local
project. Use this command only if you are able to handle interactive CLI
inputs well. Alternatively, you can manually edit firebase.json and
apphosting.yml.
Effect:
apphosting.yaml.App Hosting uses Cloud Secret Manager to securely handle sensitive environment variables (like API keys).
secrets:set, but useful for
debugging permission issues or granting access to existing secrets.IMPORTANT Only use these commands if you are setting up automated
deployments via GitHub. If you are managing deployments using
npx -y firebase-tools@latest deploy, DO NOT use these commands.
--git-branch <branch>: Deploy the latest commit from a specific branch.--git-commit <commit-hash>: Deploy a specific commit.--app <webAppId>: The ID of an existing Firebase web app to associate with
the backend.--backend <backendId>: The ID of the new backend.--primary-region <location>: The primary region for the backend.--root-dir <rootDir>: The root directory for the backend. If omitted,
defaults to the root directory of the project.--service-account <service-account>: The service account used to run the
server. If omitted, defaults to the default service account.