xutil.dev
Login

Google Cloud (gcloud) Cheatsheet

Quick reference for gcloud CLI commands covering Compute Engine, Cloud Storage, IAM, Cloud Functions, GKE, networking, configuration, and Cloud SQL

57 commands

gcloud init

Initialize gcloud CLI configuration

gcloud auth login

Authenticate with Google account

gcloud auth application-default login

Set application default credentials

gcloud config set project

Set default project

gcloud config set region

Set default region

gcloud config set zone

Set default zone

gcloud config list

List current configuration values

gcloud config configurations create

Create named configuration profile

gcloud projects list

List accessible projects

gcloud compute instances list

List VM instances

gcloud compute instances create

Create a new VM instance

gcloud compute instances start

Start a stopped VM instance

gcloud compute instances stop

Stop a VM instance

gcloud compute instances delete

Delete a VM instance

gcloud compute ssh

SSH into a VM instance

gcloud compute scp

Transfer files to/from VM instance

gcloud compute images list

List available images

gcloud compute disks create

Create a disk

gsutil ls

List buckets or objects

gsutil cp

Copy files to/from Cloud Storage

gsutil rsync

Sync directory with bucket

gsutil mb

Create a bucket

gsutil rb

Remove a bucket

gsutil rm

Remove objects

gsutil iam

Manage bucket IAM policy

gsutil signurl

Generate signed URL

gcloud iam service-accounts create

Create a service account

gcloud iam service-accounts list

List service accounts

gcloud iam service-accounts keys create

Create service account key

gcloud projects add-iam-policy-binding

Add IAM role binding to project

gcloud projects get-iam-policy

Get project IAM policy

gcloud iam roles list

List available IAM roles

gcloud functions deploy

Deploy Cloud Functions

gcloud functions list

List Cloud Functions

gcloud functions describe

Describe Cloud Functions details

gcloud functions delete

Delete Cloud Functions

gcloud functions call

Directly invoke Cloud Functions

gcloud functions logs read

Read Cloud Functions logs

gcloud container clusters create

Create GKE cluster

gcloud container clusters list

List GKE clusters

gcloud container clusters get-credentials

Get cluster credentials for kubectl

gcloud container clusters delete

Delete GKE cluster

gcloud container clusters resize

Resize GKE cluster node count

gcloud container node-pools list

List node pools

gcloud compute networks list

List VPC networks

gcloud compute networks create

Create VPC network

gcloud compute firewall-rules list

List firewall rules

gcloud compute firewall-rules create

Create firewall rule

gcloud compute addresses list

List static IP addresses

gcloud compute addresses create

Reserve a static IP address

gcloud dns managed-zones list

List Cloud DNS managed zones

gcloud sql instances list

List Cloud SQL instances

gcloud sql instances create

Create Cloud SQL instance

gcloud sql instances delete

Delete Cloud SQL instance

gcloud sql databases create

Create Cloud SQL database

gcloud sql connect

Connect to Cloud SQL instance

gcloud sql backups create

Create Cloud SQL backup