gcloud cheat-sheet Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud cheat-sheet - display gcloud cheat sheet
- SYNOPSIS
gcloud cheat-sheet[GCLOUD_WIDE_FLAG …]
- DESCRIPTION
- A roster of go-to
gcloudcommands for the gcloud tool, Google Cloud's primary command-line tool. - Getting started
- Get going with the
gcloudcommand-line toolgcloud init: Initialize,authorize, and configure thegcloudtool.gcloud version: Displayversion and installed components.gcloud componentsinstall: Install specific components.gcloud componentsupdate: Update your Google Cloud CLI to the latest version.gcloud config setproject: Set a default Google Cloud project to work on.gcloud info: Displaycurrentgcloudtool environmentdetails.
- Help
- Google Cloud CLI is happy to help
gcloud help: Search thegcloudtool reference documentsfor specific terms.gcloud feedback:Provide feedback for the Google Cloud CLI team.gcloud topic:Supplementary help material for non-command topics like accessibility,filtering, and formatting.
- Personalization
- Make the Google Cloud CLI your own; personalize your configuration withproperties
gcloud config set:Define a property (like compute/zone) for the current configuration.gcloud config get:Fetch value of a Google Cloud CLI property.gcloud config list:Display all the properties for the current configuration.gcloud configconfigurations create: Create a new named configuration.gcloud configconfigurations list: Display a list of all available configurations.gcloudconfig configurations activate: Switch to an existing namedconfiguration.
- Credentials
- Grant and revoke authorization to Google Cloud CLI
gcloud auth login:Authorize Google Cloud access for thegcloudtool with Google user credentialsand set current account as active.gcloud authactivate-service-account: Likegcloud auth loginbut withservice account credentials.gcloud auth list:List all credentialed accounts.gcloud authprint-access-token: Display the current account's access token.gcloud auth revoke:Remove access credentials for an account.
- Projects
- Manage project access policies
gcloud projectsdescribe: Display metadata for a project (including its ID).gcloudprojects add-iam-policy-binding: Add an IAM policy binding to aspecified project.
- Identity & Access Management
- Configuring Cloud Identity & Access Management (IAM) preferences and serviceaccounts
gcloud iamlist-grantable-roles: List IAM grantable roles for a resource.gcloud iam rolescreate: Create a custom role for a project or org.gcloud iamservice-accounts create: Create a service account for a project.gcloudiam service-accounts add-iam-policy-binding: Add an IAM policybinding to a service account.gcloudiam service-accounts set-iam-policy: Replace existing IAM policybinding.gcloud iamservice-accounts keys list: List a service account's keys.
- Docker & Google Kubernetes Engine (GKE)
- Manage containerized applications on Kubernetes
gcloud authconfigure-docker: Register thegcloudtool as a Docker credentialhelper.gcloud containerclusters create: Create a cluster to run GKE containers.gcloud containerclusters list: List clusters for running GKE containers.gcloudcontainer clusters get-credentials: Updatekubeconfigtogetkubectlto use a GKE cluster.gcloudcontainer images list-tags: List tag and digest metadata for acontainer image.
- Virtual Machines & Compute Engine
- Create, run, and manage VMs on Google infrastructure
gcloud compute zoneslist: List Compute Engine zones.gcloud computeinstances describe: Display a VM instance's details.gcloud computeinstances list: List all VM instances in a project.gcloud computedisks snapshot: Create snapshot of persistent disks.gcloud computesnapshots describe: Display a snapshot's details.gcloud computesnapshots delete: Delete a snapshot.gcloud compute ssh:Connect to a VM instance by using SSH.
- Serverless & App Engine
- Build highly scalable applications on a fully managed serverless platform
gcloud app deploy:Deploy your app's code and configuration to the App Engine server.gcloud app versionslist: List all versions of all services deployed to the App Engineserver.gcloud app browse:Open the current app in a web browser.gcloud app create:Create an App Engine app within your current project.gcloud app logsread: Display the latest App Engine app logs.
- Miscellaneous
- Commands that might come in handy
gcloud kms decrypt:Decrypt ciphertext (to a plaintext file) using a Cloud Key Management Service(Cloud KMS) key.gcloud logging logslist: List your project's logs.gcloud sql backupsdescribe: Display info about a Cloud SQL instance backup.gcloud sql exportsql: Export data from a Cloud SQL instance to a SQL file.
- EXAMPLES
- To view this cheat sheet, run:
gcloudcheat-sheet - GCLOUD WIDE FLAGS
- These flags are available to all commands:
--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.Run
$gcloud helpfor details.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-07 UTC.