GCP gcloud Basics

Essential Google Cloud Platform gcloud commands.

Authentication

gcloud auth login # login to GCP
gcloud config set project project-id # set active project
gcloud config list # show current config
gcloud projects list # list all projects

Compute Engine

gcloud compute instances create instance-1 --zone=us-central1-a
gcloud compute instances list # list all instances
gcloud compute instances start instance-1 # start instance
gcloud compute instances stop instance-1 # stop instance

Cloud Storage

gsutil mb gs://bucket-name # create bucket
gsutil cp file.txt gs://bucket-name/ # upload file
gsutil ls gs://bucket-name # list bucket contents
gsutil rm gs://bucket-name/file.txt # delete file

App Engine

gcloud app deploy # deploy application
gcloud app browse # open app in browser
gcloud app logs tail # stream logs