From d67fcfdd20e6a63b6068436b4764e7b1d7c71a64 Mon Sep 17 00:00:00 2001 From: Joe Hanley Date: Fri, 6 Feb 2026 09:59:48 -0800 Subject: [PATCH 1/2] Improve the CLI commands ref --- .../references/cli_commands.md | 48 ++++++++++++------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/skills/firebase-app-hosting-basics/references/cli_commands.md b/skills/firebase-app-hosting-basics/references/cli_commands.md index e4c0a2c34e9..fbe6394c52e 100644 --- a/skills/firebase-app-hosting-basics/references/cli_commands.md +++ b/skills/firebase-app-hosting-basics/references/cli_commands.md @@ -3,7 +3,9 @@ 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. ## Initialization + ### `firebase init apphosting` + - **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`. @@ -14,42 +16,56 @@ Alternatively, you can manually edit `firebase.json` and `apphosting.yml`. - Can optionally create a backend if one doesn't exist. ## Backend Management -### `firebase apphosting:backends:create` -- **Purpose**: Creates a new App Hosting backend. Use this when setting up automated deployments via GitHub. -- **Options**: - - `--app `: The ID of an existing Firebase web app to associate with the backend. - - `--backend `: The ID of the new backend. - - `--primary-region `: The primary region for the backend. - - `--root-dir `: The root directory for the backend. If omitted, defaults to the root directory of the project. - - `--service-account `: The service account used to run the server. If omitted, defaults to the default service account. ### `firebase apphosting:backends:list` + - **Purpose**: Lists all backends in the current project. ### `firebase apphosting:backends:get ` + - **Purpose**: Shows details for a specific backend. ### `firebase apphosting:backends:delete ` -- **Purpose**: Deletes a backend and its associated resources. -## Rollouts (Deployment) -### `firebase apphosting:rollouts:create ` -- **Purpose**: Manually triggers a new rollout (deployment). -- **Options**: - - `--git-branch `: Deploy the latest commit from a specific branch. - - `--git-commit `: Deploy a specific commit. -- **Use Case**: Useful for redeploying without code changes, or rolling back to a specific commit. +- **Purpose**: Deletes a backend and its associated resources. ### `firebase apphosting:rollouts:list ` + - **Purpose**: Lists the history of rollouts for a backend. ## Secrets Management + App Hosting uses Cloud Secret Manager to securely handle sensitive environment variables (like API keys). ### `firebase apphosting:secrets:set ` + - **Purpose**: Creates or updates a secret in Cloud Secret Manager and makes it available to App Hosting. - **Behavior**: Prompts for the secret value (hidden input). ### `firebase apphosting:secrets:grantaccess ` + - **Purpose**: Grants the App Hosting service account permission to access the secret. - **Note**: Often handled automatically by `secrets:set`, but useful for debugging permission issues or granting access to existing secrets. + +### Automated deployment via GitHub (CI/CD) + +**IMPORTANT** Only use these commands if you are setting up automated deployments via GitHub. If you are managing deployments using `firebase deploy`, DO NOT use these commands. + +### `firebase apphosting:rollouts:create ` + +- **Purpose**: Manually triggers a new rollout (deployment). +- **Options**: + - `--git-branch `: Deploy the latest commit from a specific branch. + - `--git-commit `: Deploy a specific commit. +- **Use Case**: Useful for redeploying without code changes, or rolling back to a specific commit. + +### `firebase apphosting:backends:create` + +- **Purpose**: Creates a new App Hosting backend. Use this when setting up automated deployments via GitHub. +- **Options**: + - `--app `: The ID of an existing Firebase web app to associate with the backend. + - `--backend `: The ID of the new backend. + - `--primary-region `: The primary region for the backend. + - `--root-dir `: The root directory for the backend. If omitted, defaults to the root directory of the project. + - `--service-account `: The service account used to run the server. If omitted, defaults to the default service account. + \ No newline at end of file From c1c715bc180631bf45ca8205f54c615d2015a91c Mon Sep 17 00:00:00 2001 From: Joe Hanley Date: Fri, 6 Feb 2026 11:35:22 -0800 Subject: [PATCH 2/2] Update skills/firebase-app-hosting-basics/references/cli_commands.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- skills/firebase-app-hosting-basics/references/cli_commands.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skills/firebase-app-hosting-basics/references/cli_commands.md b/skills/firebase-app-hosting-basics/references/cli_commands.md index fbe6394c52e..e1baf5b5725 100644 --- a/skills/firebase-app-hosting-basics/references/cli_commands.md +++ b/skills/firebase-app-hosting-basics/references/cli_commands.md @@ -47,7 +47,7 @@ App Hosting uses Cloud Secret Manager to securely handle sensitive environment v - **Purpose**: Grants the App Hosting service account permission to access the secret. - **Note**: Often handled automatically by `secrets:set`, but useful for debugging permission issues or granting access to existing secrets. -### Automated deployment via GitHub (CI/CD) +## Automated deployment via GitHub (CI/CD) **IMPORTANT** Only use these commands if you are setting up automated deployments via GitHub. If you are managing deployments using `firebase deploy`, DO NOT use these commands.