> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/harness-platform/use-harness-platform/automation/cli/content/versions/v1.md).

# V1

### Installation <a href="#installation" id="installation"></a>

Install the Harness CLI on Unix-based systems (macOS, Linux) using the following command:

```bash
curl https://raw.githubusercontent.com/harness/harness-cli/v2/install | sh
```

This script will download and install the latest version of the CLI to your system.

### Version Check <a href="#version-check" id="version-check"></a>

After installing the CLI, verify the installation by checking the version:

```bash
hc version
```

Example output:

```bash
hc version dev
Built with go1.24.9
```

### Upgrade to Latest Version <a href="#upgrade-to-latest-version" id="upgrade-to-latest-version"></a>

To ensure you have the latest features and bug fixes, upgrade the Harness CLI to the latest version:

```bash
hc upgrade
```

### Authentication Setup <a href="#authentication-setup" id="authentication-setup"></a>

To authenticate the CLI with your Harness account, use the login command:

```bash
hc auth login
```

![Auth Login form](/files/EqxjYQJZeZpHPtjeebHe)

You will be prompted to provide the following details:

* **URL**: Your Harness platform URL
* **API Token Key**: Your personal access token or API key ([learn how to create API keys](/harness-platform/use-harness-platform/automation/api/add-and-manage-api-keys.md))
* **Account ID**: Your Harness account identifier
* **Organization ID**: Your organization identifier (optional)
* **Project ID**: Your project identifier (optional)

Once authenticated, the CLI will store your credentials securely for subsequent commands.

{% hint style="info" %}
**GETTING HELP**

Use `hc [command] --help` to get more information about any command. This will display available options, flags, and usage examples for the specified command.
{% endhint %}

### Basic Verification <a href="#basic-verification" id="basic-verification"></a>

After authentication, verify your connection by performing a basic operation, for example, listing your registries:

```bash

hc registry list --org devrel --project sd1
```

This command should display your available registries, confirming a successful connection. ![Registry List](/files/gdbQJOOaUB8HJsaZg59N)

### Using the CLI Binary <a href="#using-the-cli-binary" id="using-the-cli-binary"></a>

If you've downloaded the CLI binary directly, you may need to run it using `./hc` from the directory where it's located:

```bash
./hc version
```

#### Adding to PATH <a href="#adding-to-path" id="adding-to-path"></a>

To use `hc` from anywhere without the `./` prefix, add the CLI binary to your system PATH:

**macOS/Linux:**

1. Move the binary to a directory in your PATH (e.g., `/usr/local/bin`):

   ```bash
   sudo mv hc /usr/local/bin/
   ```
2. Make sure it's executable:

   ```bash
   sudo chmod +x /usr/local/bin/hc
   ```
3. Verify you can now use `hc` from anywhere:

   ```bash
   hc version
   ```

**Alternative: Add to PATH without moving**

If you prefer to keep the binary in its current location, add that directory to your PATH:

```bash
export PATH=$PATH:/path/to/directory/containing/hc
```

To make this permanent, add the above line to your shell configuration file (`~/.bashrc`, `~/.zshrc`, or `~/.bash_profile`).
