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
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
bindirectory that allow commands like
gdcloud componentsto 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
Initialize gdcloud CLI default configuration
Initialize the gdcloud CLI default configuration:
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 listcommand.
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.
View the current list of available components:
gdcloud components list
Install a component on the current version of your gdcloud CLI installation:
gdcloud components install COMPONENT_ID
For example, this command installs the
gdcloud components install kubectl
To update all GDCH components to the latest version of the gdcloud CLI, see Upgrade to the latest gdcloud CLI.