From 37ab317e0cfe508e29abcdb6dd342678cb6e9ca4 Mon Sep 17 00:00:00 2001 From: Joe Hanley Date: Tue, 25 Mar 2025 16:40:39 -0700 Subject: [PATCH 1/2] Cleaning up help texts (and remove experiemntal:functions:shell) --- CHANGELOG.md | 1 + src/commands/appdistribution-groups-create.ts | 2 +- src/commands/appdistribution-groups-delete.ts | 2 +- src/commands/appdistribution-groups-list.ts | 2 +- src/commands/appdistribution-testers-add.ts | 2 +- src/commands/appdistribution-testers-remove.ts | 2 +- src/commands/apphosting-config-export.ts | 2 +- src/commands/apphosting-secrets-access.ts | 2 +- src/commands/apphosting-secrets-describe.ts | 2 +- src/commands/apps-android-sha-create.ts | 2 +- src/commands/apps-android-sha-delete.ts | 2 +- src/commands/apps-android-sha-list.ts | 2 +- src/commands/apps-create.ts | 2 +- src/commands/apps-init.ts | 2 +- src/commands/auth-export.ts | 2 +- src/commands/auth-import.ts | 2 +- src/commands/database-instances-create.ts | 2 +- src/commands/database-profile.ts | 4 +--- src/commands/database-settings-set.ts | 2 +- src/commands/database-update.ts | 2 +- src/commands/dataconnect-sdk-generate.ts | 2 +- src/commands/dataconnect-services-list.ts | 2 +- src/commands/dataconnect-sql-diff.ts | 2 +- src/commands/dataconnect-sql-grant.ts | 2 +- src/commands/dataconnect-sql-migrate.ts | 4 ++-- src/commands/dataconnect-sql-setup.ts | 2 +- src/commands/dataconnect-sql-shell.ts | 4 +++- src/commands/deploy.ts | 6 +++--- src/commands/emulators-exec.ts | 2 +- src/commands/experimental-functions-shell.ts | 13 ------------- src/commands/ext-dev-register.ts | 2 +- src/commands/ext-dev-usage.ts | 4 ++-- src/commands/ext-install.ts | 7 ++----- src/commands/firestore-backups-delete.ts | 4 ++-- src/commands/firestore-backups-get.ts | 2 +- src/commands/firestore-backups-list.ts | 4 ++-- .../firestore-backups-schedules-create.ts | 8 ++++---- .../firestore-backups-schedules-delete.ts | 4 ++-- .../firestore-backups-schedules-list.ts | 4 ++-- .../firestore-backups-schedules-update.ts | 2 +- src/commands/firestore-databases-create.ts | 12 ++++++------ src/commands/firestore-databases-delete.ts | 6 ++---- src/commands/firestore-databases-get.ts | 2 +- src/commands/firestore-databases-list.ts | 2 +- src/commands/firestore-databases-restore.ts | 10 +++++----- src/commands/firestore-databases-update.ts | 8 ++++---- src/commands/firestore-delete.ts | 18 +++++++----------- src/commands/firestore-indexes-list.ts | 8 ++++---- src/commands/firestore-locations.ts | 2 +- src/commands/functions-artifacts-setpolicy.ts | 14 +++++++------- src/commands/functions-config-export.ts | 2 +- src/commands/functions-deletegcfartifacts.ts | 2 +- src/commands/functions-secrets-access.ts | 2 +- src/commands/functions-secrets-describe.ts | 2 +- src/commands/functions-secrets-destroy.ts | 4 ++-- src/commands/functions-secrets-get.ts | 2 +- src/commands/functions-secrets-prune.ts | 4 ++-- src/commands/functions-secrets-set.ts | 6 +++--- src/commands/index.ts | 3 --- src/commands/init.ts | 5 +++-- .../internaltesting-frameworks-compose.ts | 2 +- src/commands/remoteconfig-versions-list.ts | 2 +- src/commands/setup-emulators-database.ts | 2 +- src/commands/setup-emulators-dataconnect.ts | 2 +- src/commands/setup-emulators-firestore.ts | 2 +- src/commands/setup-emulators-pubsub.ts | 2 +- src/commands/setup-emulators-storage.ts | 2 +- src/commands/setup-emulators-ui.ts | 2 +- 68 files changed, 114 insertions(+), 137 deletions(-) delete mode 100644 src/commands/experimental-functions-shell.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index e6a8be27bac..31e474dbe94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,3 +2,4 @@ - firebase apphosting:secrets:grantAccess can now grant access to emails and can grant multiple secrets at once (#8357) - firebase apphosting:secrets:set now has flows to help with test secrets (#8359) - Fixed an issue where `sql:setup` would incorrectly remove the `cloudsqlsuperuser` role from `firebasesuperuser` (#8363) +- Removed the `experimental:functions:shell` command. Use `functions:shell` instead. diff --git a/src/commands/appdistribution-groups-create.ts b/src/commands/appdistribution-groups-create.ts index a12c809dd3c..4a5efb0d0f8 100644 --- a/src/commands/appdistribution-groups-create.ts +++ b/src/commands/appdistribution-groups-create.ts @@ -5,7 +5,7 @@ import { AppDistributionClient } from "../appdistribution/client"; import { getProjectName } from "../appdistribution/options-parser-util"; export const command = new Command("appdistribution:groups:create [alias]") - .description("create group in project") + .description("create an App Distribution group") .alias("appdistribution:group:create") .before(requireAuth) .action(async (displayName: string, alias?: string, options?: any) => { diff --git a/src/commands/appdistribution-groups-delete.ts b/src/commands/appdistribution-groups-delete.ts index 62319e5c830..9ee71bad793 100644 --- a/src/commands/appdistribution-groups-delete.ts +++ b/src/commands/appdistribution-groups-delete.ts @@ -6,7 +6,7 @@ import { AppDistributionClient } from "../appdistribution/client"; import { getProjectName } from "../appdistribution/options-parser-util"; export const command = new Command("appdistribution:groups:delete ") - .description("delete group from a project") + .description("delete an App Distribution group") .alias("appdistribution:group:delete") .before(requireAuth) .action(async (alias: string, options: any) => { diff --git a/src/commands/appdistribution-groups-list.ts b/src/commands/appdistribution-groups-list.ts index 68014e3860c..5b7fa7ae6b2 100644 --- a/src/commands/appdistribution-groups-list.ts +++ b/src/commands/appdistribution-groups-list.ts @@ -11,7 +11,7 @@ import * as utils from "../utils"; import * as Table from "cli-table3"; export const command = new Command("appdistribution:groups:list") - .description("list groups in project") + .description("list App Distribution groups") .alias("appdistribution:group:list") .before(requireAuth) .action(async (options?: Options): Promise => { diff --git a/src/commands/appdistribution-testers-add.ts b/src/commands/appdistribution-testers-add.ts index 81c63381606..b6bb4bdb213 100644 --- a/src/commands/appdistribution-testers-add.ts +++ b/src/commands/appdistribution-testers-add.ts @@ -5,7 +5,7 @@ import { AppDistributionClient } from "../appdistribution/client"; import { getEmails, getProjectName } from "../appdistribution/options-parser-util"; export const command = new Command("appdistribution:testers:add [emails...]") - .description("add testers to project (and possibly group)") + .description("add testers to project (and group, if specified via flag)") .option("--file ", "a path to a file containing a list of tester emails to be added") .option( "--group-alias ", diff --git a/src/commands/appdistribution-testers-remove.ts b/src/commands/appdistribution-testers-remove.ts index fbe6bbc8cf8..18c71180866 100644 --- a/src/commands/appdistribution-testers-remove.ts +++ b/src/commands/appdistribution-testers-remove.ts @@ -7,7 +7,7 @@ import { getEmails, getProjectName } from "../appdistribution/options-parser-uti import { logger } from "../logger"; export const command = new Command("appdistribution:testers:remove [emails...]") - .description("remove testers from a project (or group)") + .description("remove testers from a project (or group, if specified via flag)") .option("--file ", "a path to a file containing a list of tester emails to be removed") .option( "--group-alias ", diff --git a/src/commands/apphosting-config-export.ts b/src/commands/apphosting-config-export.ts index 7cb3351c5d4..01906abe56e 100644 --- a/src/commands/apphosting-config-export.ts +++ b/src/commands/apphosting-config-export.ts @@ -10,7 +10,7 @@ import { detectProjectRoot } from "../detectProjectRoot"; export const command = new Command("apphosting:config:export") .description( - "Export App Hosting configurations such as secrets into an apphosting.local.yaml file", + "export App Hosting configurations such as secrets into an apphosting.local.yaml file", ) .option( "-s, --secrets .yaml file to export secrets from>", diff --git a/src/commands/apphosting-secrets-access.ts b/src/commands/apphosting-secrets-access.ts index ecd5d539e7e..ffbc4024234 100644 --- a/src/commands/apphosting-secrets-access.ts +++ b/src/commands/apphosting-secrets-access.ts @@ -9,7 +9,7 @@ import { requirePermissions } from "../requirePermissions"; export const command = new Command("apphosting:secrets:access ") .description( - "Access secret value given secret and its version. Defaults to accessing the latest version.", + "access secret value given secret and its version. Defaults to accessing the latest version", ) .before(requireAuth) .before(secretManager.ensureApi) diff --git a/src/commands/apphosting-secrets-describe.ts b/src/commands/apphosting-secrets-describe.ts index 6de8aef6311..5f6b6076359 100644 --- a/src/commands/apphosting-secrets-describe.ts +++ b/src/commands/apphosting-secrets-describe.ts @@ -9,7 +9,7 @@ import { requirePermissions } from "../requirePermissions"; import * as Table from "cli-table3"; export const command = new Command("apphosting:secrets:describe ") - .description("Get metadata for secret and its versions.") + .description("get metadata for secret and its versions") .before(requireAuth) .before(secretManager.ensureApi) .before(requirePermissions, ["secretmanager.secrets.get"]) diff --git a/src/commands/apps-android-sha-create.ts b/src/commands/apps-android-sha-create.ts index 5103374f4f3..7a7609ea9ee 100644 --- a/src/commands/apps-android-sha-create.ts +++ b/src/commands/apps-android-sha-create.ts @@ -15,7 +15,7 @@ function getCertHashType(shaHash: string): string { } export const command = new Command("apps:android:sha:create ") - .description("add a SHA certificate hash for a given app id.") + .description("add a SHA certificate hash for a given app id") .before(requireAuth) .action( async (appId: string = "", shaHash: string = "", options: any): Promise => { diff --git a/src/commands/apps-android-sha-delete.ts b/src/commands/apps-android-sha-delete.ts index 209d0376651..02cac18d3b1 100644 --- a/src/commands/apps-android-sha-delete.ts +++ b/src/commands/apps-android-sha-delete.ts @@ -7,7 +7,7 @@ import { requireAuth } from "../requireAuth"; import { promiseWithSpinner } from "../utils"; export const command = new Command("apps:android:sha:delete ") - .description("delete a SHA certificate hash for a given app id.") + .description("delete a SHA certificate hash for a given app id") .before(requireAuth) .action(async (appId: string = "", shaId: string = "", options: any): Promise => { const projectId = needProjectId(options); diff --git a/src/commands/apps-android-sha-list.ts b/src/commands/apps-android-sha-list.ts index 3ed01047d7e..65e0f260f1c 100644 --- a/src/commands/apps-android-sha-list.ts +++ b/src/commands/apps-android-sha-list.ts @@ -36,7 +36,7 @@ function logCertificatesCount(count: number = 0): void { } export const command = new Command("apps:android:sha:list ") - .description("list the SHA certificate hashes for a given app id. ") + .description("list the SHA certificate hashes for a given app id") .before(requireAuth) .action(async (appId: string = "", options: any): Promise => { const projectId = needProjectId(options); diff --git a/src/commands/apps-create.ts b/src/commands/apps-create.ts index aa8e0601d02..a95c075909c 100644 --- a/src/commands/apps-create.ts +++ b/src/commands/apps-create.ts @@ -53,7 +53,7 @@ interface AppsCreateOptions extends Options { export const command = new Command("apps:create [platform] [displayName]") .description( - "create a new Firebase app. [platform] can be IOS, ANDROID or WEB (case insensitive).", + "create a new Firebase app. [platform] can be IOS, ANDROID or WEB (case insensitive)", ) .option("-a, --package-name ", "required package name for the Android app") .option("-b, --bundle-id ", "required bundle id for the iOS app") diff --git a/src/commands/apps-init.ts b/src/commands/apps-init.ts index 3527126a1eb..053b74c7d0f 100644 --- a/src/commands/apps-init.ts +++ b/src/commands/apps-init.ts @@ -72,7 +72,7 @@ function toAppPlatform(str: string) { } export const command = new Command("apps:init [platform] [appId]") - .description("Automatically download and create config of a Firebase app. ") + .description("automatically download and create config of a Firebase app") .before(requireAuth) .option("-o, --out [file]", "(optional) write config output to a file") .action(async (platform = "", appId = "", options: AppsInitOptions): Promise => { diff --git a/src/commands/auth-export.ts b/src/commands/auth-export.ts index 1de847d6b05..bb45e32fc64 100644 --- a/src/commands/auth-export.ts +++ b/src/commands/auth-export.ts @@ -17,7 +17,7 @@ interface exportOptions { } export const command = new Command("auth:export [dataFile]") - .description("Export accounts from your Firebase project into a data file") + .description("export accounts from your Firebase project into a data file") .option( "--format ", "Format of exported data (csv, json). Ignored if has format extension.", diff --git a/src/commands/auth-import.ts b/src/commands/auth-import.ts index 99011af78be..cbefe8191e2 100644 --- a/src/commands/auth-import.ts +++ b/src/commands/auth-import.ts @@ -21,7 +21,7 @@ import { const MAX_BATCH_SIZE = 1000; export const command = new Command("auth:import [dataFile]") - .description("import users into your Firebase project from a data file(.csv or .json)") + .description("import users into your Firebase project from a data file (.csv or .json)") .option( "--hash-algo ", "specify the hash algorithm used in password for these accounts", diff --git a/src/commands/database-instances-create.ts b/src/commands/database-instances-create.ts index f860a232d0b..1cfcb2f8136 100644 --- a/src/commands/database-instances-create.ts +++ b/src/commands/database-instances-create.ts @@ -15,7 +15,7 @@ import { FirebaseError } from "../error"; import { MISSING_DEFAULT_INSTANCE_ERROR_MESSAGE } from "../requireDatabaseInstance"; export const command = new Command("database:instances:create ") - .description("create a realtime database instance") + .description("create a Realtime Database instance") .option( "-l, --location ", "(optional) location for the database instance, defaults to us-central1", diff --git a/src/commands/database-profile.ts b/src/commands/database-profile.ts index 68fa9fb662f..f6be4bd209e 100644 --- a/src/commands/database-profile.ts +++ b/src/commands/database-profile.ts @@ -7,10 +7,8 @@ import { profiler } from "../profiler"; import { Emulators } from "../emulator/types"; import { warnEmulatorNotSupported } from "../emulator/commandUtils"; -const description = "profile the Realtime Database and generate a usage report"; - export const command = new Command("database:profile") - .description(description) + .description("profile the Realtime Database and generate a usage report") .option("-o, --output ", "save the output to the specified file") .option( "-d, --duration ", diff --git a/src/commands/database-settings-set.ts b/src/commands/database-settings-set.ts index 2b3ac73b956..08a3add8333 100644 --- a/src/commands/database-settings-set.ts +++ b/src/commands/database-settings-set.ts @@ -13,7 +13,7 @@ import { requireDatabaseInstance } from "../requireDatabaseInstance"; import * as utils from "../utils"; export const command = new Command("database:settings:set ") - .description("set the realtime database setting at path.") + .description("set the realtime database setting at path") .option( "--instance ", "use the database .firebaseio.com (if omitted, use default database instance)", diff --git a/src/commands/database-update.ts b/src/commands/database-update.ts index 37e32039f8b..97889baa530 100644 --- a/src/commands/database-update.ts +++ b/src/commands/database-update.ts @@ -16,7 +16,7 @@ import { requireDatabaseInstance } from "../requireDatabaseInstance"; import * as utils from "../utils"; export const command = new Command("database:update [infile]") - .description("update some of the keys for the defined path in your Firebase") + .description("update some of the keys for the defined path in your Realtime Database") .option("-d, --data ", "specify escaped JSON directly") .option("-f, --force", "pass this option to bypass confirmation prompt") .option( diff --git a/src/commands/dataconnect-sdk-generate.ts b/src/commands/dataconnect-sdk-generate.ts index d522af7d4fa..967c2cfd6f8 100644 --- a/src/commands/dataconnect-sdk-generate.ts +++ b/src/commands/dataconnect-sdk-generate.ts @@ -12,7 +12,7 @@ import { getProjectDefaultAccount } from "../auth"; type GenerateOptions = Options & { watch?: boolean }; export const command = new Command("dataconnect:sdk:generate") - .description("generates typed SDKs for your Data Connect connectors") + .description("generate typed SDKs for your Data Connect connectors") .option( "--watch", "watch for changes to your connector GQL files and regenerate your SDKs when updates occur", diff --git a/src/commands/dataconnect-services-list.ts b/src/commands/dataconnect-services-list.ts index ecada7c5d04..cef86e087bf 100644 --- a/src/commands/dataconnect-services-list.ts +++ b/src/commands/dataconnect-services-list.ts @@ -9,7 +9,7 @@ import { ensureApis } from "../dataconnect/ensureApis"; import * as Table from "cli-table3"; export const command = new Command("dataconnect:services:list") - .description("list all deployed services in your Firebase project") + .description("list all deployed Data connect services") .before(requirePermissions, [ "dataconnect.services.list", "dataconnect.schemas.list", diff --git a/src/commands/dataconnect-sql-diff.ts b/src/commands/dataconnect-sql-diff.ts index 1ea50b92416..9b51d82d2d4 100644 --- a/src/commands/dataconnect-sql-diff.ts +++ b/src/commands/dataconnect-sql-diff.ts @@ -9,7 +9,7 @@ import { requireAuth } from "../requireAuth"; export const command = new Command("dataconnect:sql:diff [serviceId]") .description( - "displays the differences between a local DataConnect schema and your CloudSQL database's current schema", + "display the differences between a local Data Connect schema and your CloudSQL database's current schema", ) .before(requirePermissions, [ "firebasedataconnect.services.list", diff --git a/src/commands/dataconnect-sql-grant.ts b/src/commands/dataconnect-sql-grant.ts index 4fb77014086..ff491a39525 100644 --- a/src/commands/dataconnect-sql-grant.ts +++ b/src/commands/dataconnect-sql-grant.ts @@ -12,7 +12,7 @@ import { fdcSqlRoleMap } from "../gcp/cloudsql/permissions_setup"; const allowedRoles = Object.keys(fdcSqlRoleMap); export const command = new Command("dataconnect:sql:grant [serviceId]") - .description("Grants the SQL role to the provided user or service account .") + .description("grants the SQL role to the provided user or service account ") .option("-R, --role ", "The SQL role to grant. One of: owner, writer, or reader.") .option( "-E, --email ", diff --git a/src/commands/dataconnect-sql-migrate.ts b/src/commands/dataconnect-sql-migrate.ts index 5aa1f23558c..349a10160ce 100644 --- a/src/commands/dataconnect-sql-migrate.ts +++ b/src/commands/dataconnect-sql-migrate.ts @@ -10,7 +10,7 @@ import { ensureApis } from "../dataconnect/ensureApis"; import { logLabeledSuccess } from "../utils"; export const command = new Command("dataconnect:sql:migrate [serviceId]") - .description("migrates your CloudSQL database's schema to match your local DataConnect schema") + .description("migrate your CloudSQL database's schema to match your local DataConnect schema") .before(requirePermissions, [ "firebasedataconnect.services.list", "firebasedataconnect.schemas.list", @@ -18,7 +18,7 @@ export const command = new Command("dataconnect:sql:migrate [serviceId]") "cloudsql.instances.connect", ]) .before(requireAuth) - .withForce("Execute any required database changes without prompting") + .withForce("execute any required database changes without prompting") .action(async (serviceId: string, options: Options) => { const projectId = needProjectId(options); await ensureApis(projectId); diff --git a/src/commands/dataconnect-sql-setup.ts b/src/commands/dataconnect-sql-setup.ts index 8fa1a2dc0ea..5986ec33806 100644 --- a/src/commands/dataconnect-sql-setup.ts +++ b/src/commands/dataconnect-sql-setup.ts @@ -13,7 +13,7 @@ import { getIAMUser } from "../gcp/cloudsql/connect"; import * as cloudSqlAdminClient from "../gcp/cloudsql/cloudsqladmin"; export const command = new Command("dataconnect:sql:setup [serviceId]") - .description("Setup your CloudSQL database") + .description("set up your CloudSQL database") .before(requirePermissions, [ "firebasedataconnect.services.list", "firebasedataconnect.schemas.list", diff --git a/src/commands/dataconnect-sql-shell.ts b/src/commands/dataconnect-sql-shell.ts index 9055267d6a5..dac772f9317 100644 --- a/src/commands/dataconnect-sql-shell.ts +++ b/src/commands/dataconnect-sql-shell.ts @@ -85,7 +85,9 @@ async function mainShellLoop(conn: pg.PoolClient) { } export const command = new Command("dataconnect:sql:shell [serviceId]") - .description("Starts a shell connected directly to your dataconnect cloudsql instance.") + .description( + "start a shell connected directly to your Data Connect service's linked CloudSQL instance", + ) .before(requirePermissions, ["firebasedataconnect.services.list", "cloudsql.instances.connect"]) .before(requireAuth) .action(async (serviceId: string, options: Options) => { diff --git a/src/commands/deploy.ts b/src/commands/deploy.ts index 2d750c9a470..322d18cadd8 100644 --- a/src/commands/deploy.ts +++ b/src/commands/deploy.ts @@ -88,13 +88,13 @@ export const command = new Command("deploy") "When filtering based on codebases, use colons to specify codebase names " + '(e.g. "--only functions:codebase1:func1,functions:codebase2:group1.subgroup1"). ' + "For data connect, can specify filters with colons to deploy only a service, connector, or schema" + - '(e.g. "--only dataconnect:serviceId,dataconnect:serviceId:connectorId,dataconnect:serviceId:schema"). ', + '(e.g. "--only dataconnect:serviceId,dataconnect:serviceId:connectorId,dataconnect:serviceId:schema")', ) .option("--except ", 'deploy to all targets except specified (e.g. "database")') .option( "--dry-run", - "Perform a dry run of your deployment. Validates your changes and builds your code without deploying any changes to your project. " + - "In order to provide better validation, this may still enable APIs on the target project.", + "perform a dry run of your deployment. Validates your changes and builds your code without deploying any changes to your project. " + + "In order to provide better validation, this may still enable APIs on the target project", ) .before(requireConfig) .before((options) => { diff --git a/src/commands/emulators-exec.ts b/src/commands/emulators-exec.ts index 6c023cbe098..dadd455bd3a 100644 --- a/src/commands/emulators-exec.ts +++ b/src/commands/emulators-exec.ts @@ -6,7 +6,7 @@ export const command = new Command("emulators:exec