# PCD CLI - pcdctl

<code class="expression">space.vars.product\_acronym</code> CLI (`pcdctl`) is a unified command line interface (CLI) tool to manage all your <code class="expression">space.vars.product\_name</code> services. <code class="expression">space.vars.product\_acronym</code> CLI lets you install, manage, update Platform9 host agent and related software components on your hypervisor hosts. It also enables you to run all supported operations across all <code class="expression">space.vars.product\_name</code> services. The goal of <code class="expression">space.vars.product\_acronym</code> CLI is to be a single unified tool that enables you to control all <code class="expression">space.vars.product\_name</code> services and automate them.

## Before You Install

Before you install <code class="expression">space.vars.product\_acronym</code> CLI, please note the following:

* When using <code class="expression">space.vars.product\_acronym</code> CLI to prepare and onboard a new host to be added to <code class="expression">space.vars.product\_name</code>, you need to install and run the CLI on the host being added. Ability to perform remote install and onboarding of new host using <code class="expression">space.vars.product\_acronym</code> is coming in the future.
* When using product\_acronym CLI to control your <code class="expression">space.vars.product\_name</code> services, you can run <code class="expression">space.vars.product\_acronym</code> CLI on any node with network connectivity to your <code class="expression">space.vars.product\_name</code> environment.

## Prerequisites

* If using <code class="expression">space.vars.product\_acronym</code> CLI to onboard a new host into your <code class="expression">space.vars.product\_name</code> setup, make sure to install <code class="expression">space.vars.product\_acronym</code> CLI on that host. Also ensure that the [host prerequisites](/private-cloud-director/2025.4/getting-started/pre-requisites.md#hypervisor-host-prerequisites) are met before using <code class="expression">space.vars.product\_acronym</code> CLI to onboard a new host.
* If using <code class="expression">space.vars.product\_acronym</code> to access your <code class="expression">space.vars.product\_name</code> services, you can install it on any Ubuntu machine with network access to your <code class="expression">space.vars.product\_name</code> setup.

## Installation

To install <code class="expression">space.vars.product\_acronym</code> CLI `pcdctl`, execute the following command on the machine you are installing the CLI on:

{% tabs %}
{% tab title="Bash" %}

```bash
bash <(curl -s https://pcdctl.s3.us-west-2.amazonaws.com/pcdctl-setup)
```

{% endtab %}
{% endtabs %}

To view available commands and their information, use the help command:

{% tabs %}
{% tab title="Bash" %}

```bash
pcdctl --help
```

{% endtab %}
{% endtabs %}

For help with a specific command, run the following:

{% tabs %}
{% tab title="Bash" %}

```bash
pcdctl [command] --help
```

{% endtab %}
{% endtabs %}

### Global Flags

Following global flags apply to any run of `pcdctl`

`--log-dir string path to save pcdctl logs`

`--no-prompt disable all user prompts`

`--verbose print verbose logs`

## Configuration

Before using `pcdctl` with your <code class="expression">space.vars.product\_name</code> environment, you need to configure it:

1. Navigate to Access & Security -> API Access -> pcdctl RC in the <code class="expression">space.vars.product\_name</code> UI
2. Copy the contents to a new file named `pcdctlrc`
3. Update `OS_PASSWORD` with your <code class="expression">space.vars.product\_name</code> password
4. Run `source pcdctlrc` to set the required environment variables

### Configuration Commands

#### config set

Sets the configuration details, including Account URL etc, in `~/pf9/db/config.json`

Run this command first prior to running any other `pcdctl` commands to set the information about your account url and credentials once instead of having to specify it for each command.

{% tabs %}
{% tab title="Bash" %}

```bash
pcdctl config set
```

{% endtab %}
{% endtabs %}

**Parameters**:

`-u, --account-url` string – Sets account URL

`-h, --help` – Displays help for set

`-p, --password` string – Sets password (use 'single quotes' to pass password)

`-r, --region` string – Sets region

`-t, --tenant` string – Sets tenant

`-e, --username` string – Sets the username

#### config get

Retrieves the current configuration settings

{% tabs %}
{% tab title="Bash" %}

```bash
pcdctl config get
```

{% endtab %}
{% endtabs %}

## Host Onboarding & Management Commands

### prep-node

The `prep-node` command allows you to add a new host to your <code class="expression">space.vars.product\_name</code> environment. This command prepares the host with required pre-requisites by downloading and installing a set of required software packages on the host, so that it can be used in your <code class="expression">space.vars.product\_name</code> environment.

{% tabs %}
{% tab title="Bash" %}

```bash
pcdctl prep-node
```

{% endtab %}
{% endtabs %}

authorize-node

This command sssigns a <code class="expression">space.vars.product\_name</code> role to the host.

{% tabs %}
{% tab title="Bash" %}

```bash
pcdctl authorize-node [flags]
```

{% endtab %}
{% endtabs %}

Flags:

`-h, --help help for authorize-node`

\--role string role for the host

### decommission-node

Decommissions this host from <code class="expression">space.vars.product\_acronym</code> management plane and purges all <code class="expression">space.vars.product\_acronym</code> components on the host.

{% tabs %}
{% tab title="Bash" %}

```bash
pcdctl decommission-node [flags]
```

{% endtab %}
{% endtabs %}

**Parameters**:

`-h, --help help for decommission-node`

`-f, --force force decommission node purging everything`

`-r, --skip-installed-role-check Skip checking for installed roles`

deauthorize-node

Removes roles from an onboarded node.

{% tabs %}
{% tab title="Bash" %}

```yaml
pcdctl deauthorize-node [flags]
```

{% endtab %}
{% endtabs %}

**Parameters**:

`-h, --help help for deauthorize-node`

`-H, --skip-host-removal Skip host removal`

`-r, --skip-role-removal Skip role removal`

`-t, --timeout string Timeout for the operation (default "5m")`

## <code class="expression">space.vars.product\_acronym</code> Operation

`pcdctl` supports all core <code class="expression">space.vars.product\_name</code> operations. The standard format is:

{% tabs %}
{% tab title="Bash" %}

```bash
pcdctl [command] [flags] [subcommands]
```

{% endtab %}
{% endtabs %}

### Examples

#### Volume Operations

{% tabs %}
{% tab title="Bash" %}

```bash
pcdctl volume list
```

{% endtab %}
{% endtabs %}

Sample output:

{% tabs %}
{% tab title="Bash" %}

```
+--------------------------------------+------+-----------+------+-------------+
| ID                                   | Name | Status    | Size | Attached to |
+--------------------------------------+------+-----------+------+-------------+
| 48529b0c-1140-4cd2-aaad-4be01268181c | dude | available | 1    |             |
+--------------------------------------+------+-----------+------+-------------+
```

{% endtab %}
{% endtabs %}

#### Domain Operations

{% tabs %}
{% tab title="Bash" %}

```bash
pcdctl domain list
```

{% endtab %}
{% endtabs %}

Sample output:

{% tabs %}
{% tab title="Bash" %}

```
+----------------------------------+---------+---------+-----------------------------------+
| ID                               | Name    | Enabled | Description                       |
+----------------------------------+---------+---------+-----------------------------------+
| b2dbee7257d0418f8458fda6799eba45 | heat    | True    | Service Domain for RegionOne/heat |
| default                          | Default | True    | The default domain                |
+----------------------------------+---------+---------+-----------------------------------+
```

{% endtab %}
{% endtabs %}

#### Availability Zone Operations

{% tabs %}
{% tab title="Bash" %}

```bash
pcdctl availability zone list
```

{% endtab %}
{% endtabs %}

Sample Output:

{% tabs %}
{% tab title="Bash" %}

```
+-----------+-------------+
| Zone Name | Zone Status |
+-----------+-------------+
| internal  | available   |
| tej       | available   |
| nova      | available   |
| nova      | available   |
+-----------+-------------+
```

{% endtab %}
{% endtabs %}

#### Network Operations

{% tabs %}
{% tab title="Bash" %}

```bash
pcdctl network list
```

{% endtab %}
{% endtabs %}

## Troubleshooting

If you encounter issues:

* Ensure your configuration file is sourced correctly
* Verify network connectivity to your <code class="expression">space.vars.product\_name</code> environment
* Check that you have the necessary permissions for the operation
* Review logs for detailed error information


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.platform9.com/private-cloud-director/2025.4/reference/pcdctl-command-line.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
