To install and initialize the Distributed Cloud CLI,
[download the CLI bundle](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/resources/gdcloud-download) 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.

> [!NOTE]
> **Note:** The commands in the following sections assume the `google-distributed-cloud-hosted-cli` folder is in the current working directory.

Add the gdcloud CLI `bin` directory to your path:

    eval echo '\nexport 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 air-gapped appliance organization's console. This URL must follow the syntax `https://console.org-name.gdch.google.com`.
- `project`: The name of your current GDC project.
- View these properties using the `gdcloud config list` command.

## Manage gdcloud CLI components

Components are installable parts of the GDC 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 GDC components to the latest version of
the gdcloud CLI, see
[Upgrade to the latest gdcloud CLI](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/resources/gdcloud-upgrade).