What is gcloud ?
GCloud is a command line tool available from google that we can use to access google cloud services either using scripts or from command line and run other automations.
How can you access gcloud ?
GCloud is part of the Google Cloud SDK. You have to download and install the SDK on your system and initialize it before you can use gcloud.
Quickstart from Google Command Shell :
First of all open your cloud console and start Google Command Shell by clicking on the top right icon in the toolbar
Let's start with help command
$ gcloud -h
# To view information about your Cloud SDK installation and the active SDK configuration:
$ gcloud info
Quickstart from macOS command-line :
This page shows how to install the Google Cloud SDK, initialize it, and run core gcloud
commands from the command-line.
First, make sure that Python 2.7 is installed on your system:
$ python -V
Download the 64-bit package archive file from :
Extract the archive to your home directory :
$ /Users/rcherara/
$ cp /Users/rcherara/Downloads/google-cloud-sdk-228.0.0-darwin-x86_64.tar /Users/rcherara/
$ tar -zxvf google-cloud-sdk-228.0.0-darwin-x86_64.tar
$ rm google-cloud-sdk-228.0.0-darwin-x86_64.tar
$ ./google-cloud-sdk/install.sh
Restart your terminal for the changes to take effect.
Optional : To install or remove components at your SDK , run:
$ gcloud components install COMPONENT_ID
$ gcloud components remove COMPONENT_ID
To update your SDK installation to the latest version, run:
$ gcloud components update
Initialize the SDK
Use the gcloud init
command to authorizing the SDK tools to access Google Cloud Platform using your user account credentials and setting up the default SDK configuration.
$ gcloud init
# Select a Cloud Platform project or create one
# the command launching a web browser to be authenticated with the Google Cloud SDK