Google Cloud • DevOps • SRE
Google Cloud CLI Commands Cheat Sheet
Practical gcloud commands for Compute Engine, Cloud Storage, GKE, Artifact Registry, Cloud Run, Cloud SQL, IAM, networking, logging, monitoring and CI/CD automation.
Google Cloud CLI Setup and Version
5 commandsgcloud versionDisplay the installed Google Cloud CLI version and components.
gcloud helpSearch Google Cloud CLI help documentation.
gcloud topic configurationsLearn about gcloud configurations and configuration management.
gcloud components listList installed and available Google Cloud CLI components.
gcloud components updateUpdate installed Google Cloud CLI components.
Google Cloud Authentication
5 commandsgcloud initInitialize gcloud, authenticate and configure a Google Cloud project.
gcloud auth loginAuthenticate the Google Cloud CLI with a Google account.
gcloud auth listList authenticated Google Cloud accounts.
gcloud auth revoke <ACCOUNT>Revoke credentials for a Google Cloud account.
gcloud auth application-default loginConfigure Application Default Credentials for local development.
Google Cloud Projects
5 commandsgcloud projects listList accessible Google Cloud projects.
gcloud config get-value projectDisplay the currently configured Google Cloud project.
gcloud config set project <PROJECT_ID>Set the active Google Cloud project.
gcloud projects describe <PROJECT_ID>Display project metadata.
gcloud projects create <PROJECT_ID>Create a new Google Cloud project.
Google Cloud Configurations
6 commandsgcloud config listDisplay active gcloud configuration properties.
gcloud config configurations listList available gcloud configurations.
gcloud config configurations create <NAME>Create a separate gcloud configuration.
gcloud config configurations activate <NAME>Activate a gcloud configuration.
gcloud config set compute/region <REGION>Set the default Compute Engine region.
gcloud config set compute/zone <ZONE>Set the default Compute Engine zone.
Compute Engine Virtual Machines
10 commandsgcloud compute instances listList Compute Engine VM instances.
gcloud compute instances describe <INSTANCE> --zone=<ZONE>Display details about a Compute Engine instance.
gcloud compute instances create <INSTANCE> --zone=<ZONE>Create a Compute Engine VM.
gcloud compute instances create <INSTANCE> --zone=<ZONE> --machine-type=<MACHINE_TYPE>Create a VM using a specific machine type.
gcloud compute instances start <INSTANCE> --zone=<ZONE>Start a stopped VM.
gcloud compute instances stop <INSTANCE> --zone=<ZONE>Stop a running VM.
gcloud compute instances restart <INSTANCE> --zone=<ZONE>Restart a VM instance.
gcloud compute instances delete <INSTANCE> --zone=<ZONE>Delete a Compute Engine VM.
gcloud compute ssh <INSTANCE> --zone=<ZONE>Connect to a Compute Engine VM over SSH.
gcloud compute scp <LOCAL_FILE> <INSTANCE>:<REMOTE_PATH> --zone=<ZONE>Copy files to a Compute Engine VM.
Compute Engine Disks and Images
8 commandsgcloud compute disks listList persistent disks.
gcloud compute disks describe <DISK> --zone=<ZONE>Display persistent disk details.
gcloud compute disks create <DISK> --size=<SIZE>Create a persistent disk.
gcloud compute disks delete <DISK> --zone=<ZONE>Delete a persistent disk.
gcloud compute images listList available Compute Engine images.
gcloud compute images describe <IMAGE>Display image metadata.
gcloud compute snapshots listList disk snapshots.
gcloud compute snapshots create <SNAPSHOT> --source-disk=<DISK>Create a snapshot from a persistent disk.
Google Cloud Storage
9 commandsgcloud storage buckets listList Cloud Storage buckets.
gcloud storage buckets create gs://<BUCKET>Create a Cloud Storage bucket.
gcloud storage buckets describe gs://<BUCKET>Display Cloud Storage bucket metadata.
gcloud storage buckets delete gs://<BUCKET>Delete a Cloud Storage bucket.
gcloud storage lsList Cloud Storage buckets and objects.
gcloud storage cp <FILE> gs://<BUCKET>/Upload a file to Cloud Storage.
gcloud storage cp gs://<BUCKET>/<OBJECT> .Download an object from Cloud Storage.
gcloud storage rsync <LOCAL_DIR> gs://<BUCKET>/<PATH>Synchronize a local directory with Cloud Storage.
gcloud storage rm gs://<BUCKET>/<OBJECT>Delete a Cloud Storage object.
VPC Networks
6 commandsgcloud compute networks listList VPC networks.
gcloud compute networks describe <NETWORK>Display VPC network details.
gcloud compute networks create <NETWORK>Create a custom VPC network.
gcloud compute networks delete <NETWORK>Delete a VPC network.
gcloud compute networks subnets listList VPC subnets.
gcloud compute networks subnets create <SUBNET> --network=<NETWORK> --region=<REGION> --range=<CIDR>Create a subnet in a VPC network.
Firewall Rules
4 commandsgcloud compute firewall-rules listList VPC firewall rules.
gcloud compute firewall-rules describe <RULE>Display firewall rule details.
gcloud compute firewall-rules create <RULE> --network=<NETWORK> --allow=tcp:80Create a firewall rule allowing HTTP traffic.
gcloud compute firewall-rules delete <RULE>Delete a firewall rule.
Google Kubernetes Engine
7 commandsgcloud container clusters listList GKE clusters.
gcloud container clusters create <CLUSTER> --zone=<ZONE>Create a GKE cluster.
gcloud container clusters create-auto <CLUSTER> --region=<REGION>Create an Autopilot GKE cluster.
gcloud container clusters describe <CLUSTER> --zone=<ZONE>Display GKE cluster details.
gcloud container clusters get-credentials <CLUSTER> --zone=<ZONE>Configure kubectl credentials for a GKE cluster.
gcloud container clusters resize <CLUSTER> --num-nodes=<COUNT> --zone=<ZONE>Resize a GKE cluster.
gcloud container clusters delete <CLUSTER> --zone=<ZONE>Delete a GKE cluster.
Google Artifact Registry
5 commandsgcloud artifacts repositories listList Artifact Registry repositories.
gcloud artifacts repositories create <REPOSITORY> --repository-format=docker --location=<REGION>Create a Docker Artifact Registry repository.
gcloud artifacts repositories describe <REPOSITORY> --location=<REGION>Display repository details.
gcloud artifacts repositories delete <REPOSITORY> --location=<REGION>Delete an Artifact Registry repository.
gcloud auth configure-docker <REGION>-docker.pkg.devConfigure Docker authentication for Artifact Registry.
Cloud Run
5 commandsgcloud run services listList Cloud Run services.
gcloud run deploy <SERVICE> --image=<IMAGE>Deploy a container image to Cloud Run.
gcloud run services describe <SERVICE> --region=<REGION>Display Cloud Run service details.
gcloud run services update <SERVICE> --region=<REGION>Update Cloud Run service configuration.
gcloud run services delete <SERVICE> --region=<REGION>Delete a Cloud Run service.
Cloud Functions
5 commandsgcloud functions listList Cloud Functions.
gcloud functions deploy <FUNCTION> --runtime=<RUNTIME> --trigger-httpDeploy an HTTP-triggered Cloud Function.
gcloud functions describe <FUNCTION>Display Cloud Function details.
gcloud functions logs read <FUNCTION>Read Cloud Function logs.
gcloud functions delete <FUNCTION>Delete a Cloud Function.
Cloud SQL
7 commandsgcloud sql instances listList Cloud SQL instances.
gcloud sql instances describe <INSTANCE>Display Cloud SQL instance details.
gcloud sql instances create <INSTANCE> --database-version=POSTGRES_16 --tier=<TIER>Create a Cloud SQL PostgreSQL instance.
gcloud sql databases list --instance=<INSTANCE>List databases in a Cloud SQL instance.
gcloud sql databases create <DATABASE> --instance=<INSTANCE>Create a Cloud SQL database.
gcloud sql instances restart <INSTANCE>Restart a Cloud SQL instance.
gcloud sql instances delete <INSTANCE>Delete a Cloud SQL instance.
IAM and Service Accounts
7 commandsgcloud iam service-accounts listList service accounts.
gcloud iam service-accounts create <ACCOUNT> --display-name=<DISPLAY_NAME>Create a service account.
gcloud iam service-accounts keys create <FILE> --iam-account=<EMAIL>Create a service account key file.
gcloud iam service-accounts delete <EMAIL>Delete a service account.
gcloud projects get-iam-policy <PROJECT_ID>Display IAM policy for a project.
gcloud projects add-iam-policy-binding <PROJECT_ID> --member=<MEMBER> --role=<ROLE>Grant an IAM role to a principal at project level.
gcloud projects remove-iam-policy-binding <PROJECT_ID> --member=<MEMBER> --role=<ROLE>Remove an IAM role binding.
Cloud DNS
4 commandsgcloud dns managed-zones listList Cloud DNS managed zones.
gcloud dns managed-zones create <ZONE> --dns-name=<DOMAIN> --description=<DESCRIPTION>Create a managed DNS zone.
gcloud dns record-sets list --zone=<ZONE>List DNS records in a managed zone.
gcloud dns managed-zones delete <ZONE>Delete a DNS managed zone.
Cloud Monitoring
2 commandsgcloud monitoring policies listList Cloud Monitoring alert policies.
gcloud monitoring policies describe <POLICY>Display an alert policy.
Cloud Logging
4 commandsgcloud logging logs listList available logs.
gcloud logging read '<FILTER>'Read log entries matching a filter.
gcloud logging read '<FILTER>' --limit=50Read a limited number of matching log entries.
gcloud logging sinks listList configured logging sinks.
Secret Manager
5 commandsgcloud secrets listList Secret Manager secrets.
gcloud secrets create <SECRET> --replication-policy=automaticCreate a Secret Manager secret.
gcloud secrets versions add <SECRET> --data-file=<FILE>Add a new secret version from a file.
gcloud secrets versions access latest --secret=<SECRET>Read the latest secret version.
gcloud secrets delete <SECRET>Delete a secret.
BigQuery
4 commandsbq lsList BigQuery datasets.
bq ls <PROJECT_ID>:<DATASET>List tables in a BigQuery dataset.
bq show <PROJECT_ID>:<DATASET>Display BigQuery dataset information.
bq query --use_legacy_sql=false '<SQL>'Run a standard SQL query using the bq CLI.
Google Cloud APIs
4 commandsgcloud services list --enabledList enabled Google Cloud APIs and services.
gcloud services list --availableList APIs and services available to enable.
gcloud services enable <SERVICE>.googleapis.comEnable a Google Cloud API.
gcloud services disable <SERVICE>.googleapis.comDisable a Google Cloud API.
Google Cloud Output and Filtering
6 commandsgcloud compute instances list --format=jsonReturn command output as JSON.
gcloud compute instances list --format='table(name,zone)'Display selected fields in table format.
gcloud compute instances list --filter='status=RUNNING'Filter resources by status.
gcloud compute instances list --sort-by=nameSort command results by resource name.
gcloud compute instances list --limit=10Limit the number of returned resources.
gcloud <COMMAND> --quietDisable interactive prompts for automation.
Google Cloud CLI Troubleshooting
6 commandsgcloud infoDisplay gcloud environment and installation information.
gcloud auth listVerify authenticated accounts.
gcloud config listCheck active configuration and project settings.
gcloud config get-value projectVerify the active Google Cloud project.
gcloud services list --enabledCheck which APIs are enabled.
gcloud <COMMAND> --verbosity=debugEnable detailed debugging output.
CI/CD Google Cloud Workflow
8 commandsgcloud auth activate-service-account --key-file=<KEY_FILE>Authenticate CI/CD automation with a service account key.
gcloud config set project <PROJECT_ID>Set the target Google Cloud project for CI/CD.
gcloud auth configure-docker <REGION>-docker.pkg.devConfigure Docker authentication for Artifact Registry.
docker build -t <REGION>-docker.pkg.dev/<PROJECT_ID>/<REPOSITORY>/myapp:$BUILD_NUMBER .Build a versioned Docker image for Artifact Registry.
docker push <REGION>-docker.pkg.dev/<PROJECT_ID>/<REPOSITORY>/myapp:$BUILD_NUMBERPush the image to Artifact Registry.
gcloud run deploy <SERVICE> --image=<IMAGE> --region=<REGION>Deploy the image to Cloud Run.
gcloud container clusters get-credentials <CLUSTER> --zone=<ZONE>Load GKE credentials for Kubernetes deployment.
kubectl apply -f deployment.yamlDeploy Kubernetes resources to GKE.
Useful Google Cloud DevOps Commands
5 commandsgcloud cheat-sheetDisplay the built-in gcloud cheat sheet.
gcloud topic filtersLearn how gcloud filtering works.
gcloud topic formatsLearn about gcloud output formatting.
gcloud topic command-conventionsLearn standard gcloud command conventions.
gcloud <COMMAND> --helpDisplay detailed help for a specific gcloud command.
Google Cloud CLI Setup and Version
gcloud versionDisplay the installed Google Cloud CLI version and components.
gcloud helpSearch Google Cloud CLI help documentation.
gcloud topic configurationsLearn about gcloud configurations and configuration management.
gcloud components listList installed and available Google Cloud CLI components.
gcloud components updateUpdate installed Google Cloud CLI components.
Google Cloud Authentication
gcloud initInitialize gcloud, authenticate and configure a Google Cloud project.
gcloud auth loginAuthenticate the Google Cloud CLI with a Google account.
gcloud auth listList authenticated Google Cloud accounts.
gcloud auth revoke <ACCOUNT>Revoke credentials for a Google Cloud account.
gcloud auth application-default loginConfigure Application Default Credentials for local development.
Google Cloud Projects
gcloud projects listList accessible Google Cloud projects.
gcloud config get-value projectDisplay the currently configured Google Cloud project.
gcloud config set project <PROJECT_ID>Set the active Google Cloud project.
gcloud projects describe <PROJECT_ID>Display project metadata.
gcloud projects create <PROJECT_ID>Create a new Google Cloud project.
Google Cloud Configurations
gcloud config listDisplay active gcloud configuration properties.
gcloud config configurations listList available gcloud configurations.
gcloud config configurations create <NAME>Create a separate gcloud configuration.
gcloud config configurations activate <NAME>Activate a gcloud configuration.
gcloud config set compute/region <REGION>Set the default Compute Engine region.
gcloud config set compute/zone <ZONE>Set the default Compute Engine zone.
Compute Engine Virtual Machines
gcloud compute instances listList Compute Engine VM instances.
gcloud compute instances describe <INSTANCE> --zone=<ZONE>Display details about a Compute Engine instance.
gcloud compute instances create <INSTANCE> --zone=<ZONE>Create a Compute Engine VM.
gcloud compute instances create <INSTANCE> --zone=<ZONE> --machine-type=<MACHINE_TYPE>Create a VM using a specific machine type.
gcloud compute instances start <INSTANCE> --zone=<ZONE>Start a stopped VM.
gcloud compute instances stop <INSTANCE> --zone=<ZONE>Stop a running VM.
gcloud compute instances restart <INSTANCE> --zone=<ZONE>Restart a VM instance.
gcloud compute instances delete <INSTANCE> --zone=<ZONE>Delete a Compute Engine VM.
gcloud compute ssh <INSTANCE> --zone=<ZONE>Connect to a Compute Engine VM over SSH.
gcloud compute scp <LOCAL_FILE> <INSTANCE>:<REMOTE_PATH> --zone=<ZONE>Copy files to a Compute Engine VM.
Compute Engine Disks and Images
gcloud compute disks listList persistent disks.
gcloud compute disks describe <DISK> --zone=<ZONE>Display persistent disk details.
gcloud compute disks create <DISK> --size=<SIZE>Create a persistent disk.
gcloud compute disks delete <DISK> --zone=<ZONE>Delete a persistent disk.
gcloud compute images listList available Compute Engine images.
gcloud compute images describe <IMAGE>Display image metadata.
gcloud compute snapshots listList disk snapshots.
gcloud compute snapshots create <SNAPSHOT> --source-disk=<DISK>Create a snapshot from a persistent disk.
Google Cloud Storage
gcloud storage buckets listList Cloud Storage buckets.
gcloud storage buckets create gs://<BUCKET>Create a Cloud Storage bucket.
gcloud storage buckets describe gs://<BUCKET>Display Cloud Storage bucket metadata.
gcloud storage buckets delete gs://<BUCKET>Delete a Cloud Storage bucket.
gcloud storage lsList Cloud Storage buckets and objects.
gcloud storage cp <FILE> gs://<BUCKET>/Upload a file to Cloud Storage.
gcloud storage cp gs://<BUCKET>/<OBJECT> .Download an object from Cloud Storage.
gcloud storage rsync <LOCAL_DIR> gs://<BUCKET>/<PATH>Synchronize a local directory with Cloud Storage.
gcloud storage rm gs://<BUCKET>/<OBJECT>Delete a Cloud Storage object.
VPC Networks
gcloud compute networks listList VPC networks.
gcloud compute networks describe <NETWORK>Display VPC network details.
gcloud compute networks create <NETWORK>Create a custom VPC network.
gcloud compute networks delete <NETWORK>Delete a VPC network.
gcloud compute networks subnets listList VPC subnets.
gcloud compute networks subnets create <SUBNET> --network=<NETWORK> --region=<REGION> --range=<CIDR>Create a subnet in a VPC network.
Firewall Rules
gcloud compute firewall-rules listList VPC firewall rules.
gcloud compute firewall-rules describe <RULE>Display firewall rule details.
gcloud compute firewall-rules create <RULE> --network=<NETWORK> --allow=tcp:80Create a firewall rule allowing HTTP traffic.
gcloud compute firewall-rules delete <RULE>Delete a firewall rule.
Google Kubernetes Engine
gcloud container clusters listList GKE clusters.
gcloud container clusters create <CLUSTER> --zone=<ZONE>Create a GKE cluster.
gcloud container clusters create-auto <CLUSTER> --region=<REGION>Create an Autopilot GKE cluster.
gcloud container clusters describe <CLUSTER> --zone=<ZONE>Display GKE cluster details.
gcloud container clusters get-credentials <CLUSTER> --zone=<ZONE>Configure kubectl credentials for a GKE cluster.
gcloud container clusters resize <CLUSTER> --num-nodes=<COUNT> --zone=<ZONE>Resize a GKE cluster.
gcloud container clusters delete <CLUSTER> --zone=<ZONE>Delete a GKE cluster.
Google Artifact Registry
gcloud artifacts repositories listList Artifact Registry repositories.
gcloud artifacts repositories create <REPOSITORY> --repository-format=docker --location=<REGION>Create a Docker Artifact Registry repository.
gcloud artifacts repositories describe <REPOSITORY> --location=<REGION>Display repository details.
gcloud artifacts repositories delete <REPOSITORY> --location=<REGION>Delete an Artifact Registry repository.
gcloud auth configure-docker <REGION>-docker.pkg.devConfigure Docker authentication for Artifact Registry.
Cloud Run
gcloud run services listList Cloud Run services.
gcloud run deploy <SERVICE> --image=<IMAGE>Deploy a container image to Cloud Run.
gcloud run services describe <SERVICE> --region=<REGION>Display Cloud Run service details.
gcloud run services update <SERVICE> --region=<REGION>Update Cloud Run service configuration.
gcloud run services delete <SERVICE> --region=<REGION>Delete a Cloud Run service.
Cloud Functions
gcloud functions listList Cloud Functions.
gcloud functions deploy <FUNCTION> --runtime=<RUNTIME> --trigger-httpDeploy an HTTP-triggered Cloud Function.
gcloud functions describe <FUNCTION>Display Cloud Function details.
gcloud functions logs read <FUNCTION>Read Cloud Function logs.
gcloud functions delete <FUNCTION>Delete a Cloud Function.
Cloud SQL
gcloud sql instances listList Cloud SQL instances.
gcloud sql instances describe <INSTANCE>Display Cloud SQL instance details.
gcloud sql instances create <INSTANCE> --database-version=POSTGRES_16 --tier=<TIER>Create a Cloud SQL PostgreSQL instance.
gcloud sql databases list --instance=<INSTANCE>List databases in a Cloud SQL instance.
gcloud sql databases create <DATABASE> --instance=<INSTANCE>Create a Cloud SQL database.
gcloud sql instances restart <INSTANCE>Restart a Cloud SQL instance.
gcloud sql instances delete <INSTANCE>Delete a Cloud SQL instance.
IAM and Service Accounts
gcloud iam service-accounts listList service accounts.
gcloud iam service-accounts create <ACCOUNT> --display-name=<DISPLAY_NAME>Create a service account.
gcloud iam service-accounts keys create <FILE> --iam-account=<EMAIL>Create a service account key file.
gcloud iam service-accounts delete <EMAIL>Delete a service account.
gcloud projects get-iam-policy <PROJECT_ID>Display IAM policy for a project.
gcloud projects add-iam-policy-binding <PROJECT_ID> --member=<MEMBER> --role=<ROLE>Grant an IAM role to a principal at project level.
gcloud projects remove-iam-policy-binding <PROJECT_ID> --member=<MEMBER> --role=<ROLE>Remove an IAM role binding.
Cloud DNS
gcloud dns managed-zones listList Cloud DNS managed zones.
gcloud dns managed-zones create <ZONE> --dns-name=<DOMAIN> --description=<DESCRIPTION>Create a managed DNS zone.
gcloud dns record-sets list --zone=<ZONE>List DNS records in a managed zone.
gcloud dns managed-zones delete <ZONE>Delete a DNS managed zone.
Cloud Monitoring
gcloud monitoring policies listList Cloud Monitoring alert policies.
gcloud monitoring policies describe <POLICY>Display an alert policy.
Cloud Logging
gcloud logging logs listList available logs.
gcloud logging read '<FILTER>'Read log entries matching a filter.
gcloud logging read '<FILTER>' --limit=50Read a limited number of matching log entries.
gcloud logging sinks listList configured logging sinks.
Secret Manager
gcloud secrets listList Secret Manager secrets.
gcloud secrets create <SECRET> --replication-policy=automaticCreate a Secret Manager secret.
gcloud secrets versions add <SECRET> --data-file=<FILE>Add a new secret version from a file.
gcloud secrets versions access latest --secret=<SECRET>Read the latest secret version.
gcloud secrets delete <SECRET>Delete a secret.
BigQuery
bq lsList BigQuery datasets.
bq ls <PROJECT_ID>:<DATASET>List tables in a BigQuery dataset.
bq show <PROJECT_ID>:<DATASET>Display BigQuery dataset information.
bq query --use_legacy_sql=false '<SQL>'Run a standard SQL query using the bq CLI.
Google Cloud APIs
gcloud services list --enabledList enabled Google Cloud APIs and services.
gcloud services list --availableList APIs and services available to enable.
gcloud services enable <SERVICE>.googleapis.comEnable a Google Cloud API.
gcloud services disable <SERVICE>.googleapis.comDisable a Google Cloud API.
Google Cloud Output and Filtering
gcloud compute instances list --format=jsonReturn command output as JSON.
gcloud compute instances list --format='table(name,zone)'Display selected fields in table format.
gcloud compute instances list --filter='status=RUNNING'Filter resources by status.
gcloud compute instances list --sort-by=nameSort command results by resource name.
gcloud compute instances list --limit=10Limit the number of returned resources.
gcloud <COMMAND> --quietDisable interactive prompts for automation.
Google Cloud CLI Troubleshooting
gcloud infoDisplay gcloud environment and installation information.
gcloud auth listVerify authenticated accounts.
gcloud config listCheck active configuration and project settings.
gcloud config get-value projectVerify the active Google Cloud project.
gcloud services list --enabledCheck which APIs are enabled.
gcloud <COMMAND> --verbosity=debugEnable detailed debugging output.
CI/CD Google Cloud Workflow
gcloud auth activate-service-account --key-file=<KEY_FILE>Authenticate CI/CD automation with a service account key.
gcloud config set project <PROJECT_ID>Set the target Google Cloud project for CI/CD.
gcloud auth configure-docker <REGION>-docker.pkg.devConfigure Docker authentication for Artifact Registry.
docker build -t <REGION>-docker.pkg.dev/<PROJECT_ID>/<REPOSITORY>/myapp:$BUILD_NUMBER .Build a versioned Docker image for Artifact Registry.
docker push <REGION>-docker.pkg.dev/<PROJECT_ID>/<REPOSITORY>/myapp:$BUILD_NUMBERPush the image to Artifact Registry.
gcloud run deploy <SERVICE> --image=<IMAGE> --region=<REGION>Deploy the image to Cloud Run.
gcloud container clusters get-credentials <CLUSTER> --zone=<ZONE>Load GKE credentials for Kubernetes deployment.
kubectl apply -f deployment.yamlDeploy Kubernetes resources to GKE.
Useful Google Cloud DevOps Commands
gcloud cheat-sheetDisplay the built-in gcloud cheat sheet.
gcloud topic filtersLearn how gcloud filtering works.
gcloud topic formatsLearn about gcloud output formatting.
gcloud topic command-conventionsLearn standard gcloud command conventions.
gcloud <COMMAND> --helpDisplay detailed help for a specific gcloud command.
Recommended Google Cloud DevOps Workflow
gcloud auth logingcloud config set project <PROJECT_ID>gcloud auth configure-docker <REGION>-docker.pkg.devdocker build -t <REGION>-docker.pkg.dev/<PROJECT_ID>/<REPOSITORY>/myapp:$BUILD_NUMBER .docker push <REGION>-docker.pkg.dev/<PROJECT_ID>/<REPOSITORY>/myapp:$BUILD_NUMBERgcloud run deploy <SERVICE> --image=<IMAGE> --region=<REGION>gcloud container clusters get-credentials <CLUSTER> --zone=<ZONE>kubectl apply -f deployment.yamlQuick Troubleshooting Workflow
- Check the authenticated account with gcloud auth list.
- Check the active project with gcloud config get-value project.
- Verify enabled APIs with gcloud services list --enabled.
- Inspect the target resource with the appropriate describe command.
- Check logs using gcloud logging read.
- Use --verbosity=debug when detailed CLI diagnostics are required.