Authenticate with Google Cloud
Authorizes the gcloud CLI to access Google Cloud Platform with your user credentials.
gcloud auth login
25 commands from the cloud runbook. Fill in a placeholder once and every command uses it.
Authorizes the gcloud CLI to access Google Cloud Platform with your user credentials.
gcloud auth login
Sets the default project ID for all subsequent gcloud commands.
gcloud config set project <project-id>
Fetches cluster credentials for Google Kubernetes Engine and updates your local kubeconfig.
gcloud container clusters get-credentials <cluster-name> --region <region>
Lists all Google Compute Engine instances in the active project.
gcloud compute instances list
Securely connects to a Compute Engine virtual machine via Identity-Aware Proxy (IAP).
gcloud compute ssh <instance-name> --zone <zone> --tunnel-through-iap
Fetches the complete IAM policy (roles and members) bound to the current project.
gcloud projects get-iam-policy <project-id>
Synchronizes the contents of a local directory to a Google Cloud Storage bucket.
gcloud storage rsync ./my-folder gs://<bucket> --recursive
gcloud storage replaces gsutil, which Google now treats as legacy.
Shows the total size of a Cloud Storage bucket.
gcloud storage du gs://<bucket> --summarize --readable-sizes
Executes a standard SQL query directly against BigQuery from the command line.
bq query --use_legacy_sql=false 'SELECT * FROM `project.dataset.table` LIMIT 10'
Deploys a container image to Cloud Run as a fully managed serverless service.
gcloud run deploy <service-name> --image <image> --region <region>
Add --allow-unauthenticated only if the service should be public on the internet.
Retrieves the decoded payload of a secret stored in GCP Secret Manager.
gcloud secrets versions access latest --secret="<secret-name>"
Prints the secret in plain text to your terminal.
Publishes a test message to a Cloud Pub/Sub topic.
gcloud pubsub topics publish <topic-name> --message="Hello World"
Lists all VPC networks and their subnet modes in the project.
gcloud compute networks list
Authenticates your local environment so code can use GCP APIs natively.
gcloud auth application-default login
Lists all deployed Cloud Run services in the active project.
gcloud run services list
Connects with the mysql or psql client, allowlisting your IP address for a few minutes.
gcloud sql connect <instance-name> --user=<user>
Shows all firewall rules in the project.
gcloud compute firewall-rules list
Fetches the last 20 log entries from Cloud Logging.
gcloud logging read "resource.type=gce_instance" --limit 20 --format json
Lists container image repositories in Artifact Registry.
gcloud artifacts repositories list --location=<region>
Deploys a Python Cloud Function triggered by HTTP.
gcloud functions deploy <function-name> --gen2 --region=<region> --runtime=python312 --source=. --entry-point=main --trigger-http
Add --allow-unauthenticated only if the function should be public on the internet.
Lists all service accounts in the project.
gcloud iam service-accounts list
Lists all persistent disks in the project.
gcloud compute disks list
Lists all managed DNS zones in the project.
gcloud dns managed-zones list
Lists node pools for a specific GKE cluster.
gcloud container node-pools list --cluster=<cluster-name> --region=<region>
Lists billing accounts you have access to.
gcloud billing accounts list