Quick Start to Install Google Cloud CLI

2021/11/011 min read
bookmark this
Responsive image

Table of Contents

  1. Introduction
  2. Install GCP SDK
  3. Install SDK on macOS
  4. gcloud init
  5. Confirm Current GCP Setting
  6. Conclusion

Introduction

This blog shows a quick memo on how to get started with the GCP Cloud CLI.

Install GCP SDK

https://cloud.google.com/sdk/docs/install-sdk

Also, reference here for the release notes: https://cloud.google.com/sdk/docs/release-notes

Install SDK on macOS

For macOS, double-click the install.sh to install it on macOS.

gcloud init

Run gcloud init to configure the GCP Cloud CLI. This will start authentication with Google. If you have multiple different GCP accounts, you can also use gcloud init to switch to a different account.

Confirm Current GCP Setting

Run gcloud config list to check the current GCP account and current GCP project.

Run gcloud projects list to view all the projects in the current GCP account.

Use gcloud config set project {project id} to set the GCP project ID.

Conclusion

With the GCP Cloud CLI installed and configured, you can manage your Google Cloud resources directly from the command line. Use gcloud init to switch between accounts and gcloud config set project to switch between projects.