Install the gdcloud CLI

To install and initialize the Distributed Cloud Hosted gdcloud CLI, download the CLI bundle and complete the following steps.

Add gdcloud CLI bin directory to path

Google recommends adding the gdcloud CLI bin directory to your path.

When the bin directory is added to your path:

  • You won't have to specify the entire directory structure with each command.
  • Crucial gdcloud CLI components are installed in the bin directory that allow commands like gdcloud components to work correctly.

Add the gdcloud CLI bin directory to your path:

eval echo 'export GDCLOUD_PATH=$(pwd)/google-distributed-cloud-hosted-cli' >> ~/.bashrc
echo 'export PATH="$GDCLOUD_PATH/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

Initialize gdcloud CLI default configuration

Initialize the gdcloud CLI default configuration:

gdcloud init

Follow the prompted instructions to initialize the configuration. You must provide two properties to complete the initialization:

  • organization_console_url: The URL to your current Google Distributed Cloud Hosted organization's console. This URL must follow the syntax
  • project: The name of your current GDCH project.
  • View these properties using the gdcloud config list command.

Manage gdcloud CLI components

Components are installable parts of the GDCH CLI. The gdcloud CLI is installed by default. List, install, and update gdcloud CLI components as needed.

List components

View the current list of available components:

gdcloud components list

Install components

Install a component on the current version of your gdcloud CLI installation:

gdcloud components install COMPONENT_ID

For example, this command installs the kubectl component:

gdcloud components install kubectl

Update components

To update all GDCH components to the latest version of the gdcloud CLI, see Upgrade to the latest gdcloud CLI.