Google Cloud CLI (gcloud) cheatsheet

Google Cloud CLI (gcloud): Setup and configuration

10 common Google Cloud CLI (gcloud) tasks.

Check the CLI version

Print the gcloud version and installed components.

gcloud version

Initialize gcloud

Sign in and choose a default project and region interactively.

gcloud init

Sign in

Sign in with your Google account in the browser.

gcloud auth login

Set up application default credentials

Create credentials that client libraries and tools on your machine use.

gcloud auth application-default login

Set the default project

Make a project the default for later commands.

gcloud config set project my-project-id

Show current settings

Print the active account, project and region.

gcloud config list

List projects

Show the projects you can access.

gcloud projects list

Create a named configuration

Switch between accounts and projects with named configurations.

gcloud config configurations create work

Update gcloud

Update the CLI and its installed components.

gcloud components update

Enable an API

Turn on a Google Cloud API for the project.

gcloud services enable run.googleapis.com

Was this page helpful?