> 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/v0.md).

# V0

### Install Harness CLI <a href="#install-harness-cli" id="install-harness-cli"></a>

You can install `harness` CLI utility on Linux, MacOS, or Windows in order to interact with Harness Platform from a command-line interface.

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

#### Install the CLI on Linux <a href="#install-the-cli-on-linux" id="install-the-cli-on-linux"></a>

1. Download and extract the Harness CLI binary.

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

```bash
curl -LO https://github.com/harness/harness-cli/releases/download/v0.0.25-Preview/harness-v0.0.25-Preview-linux-arm64.tar.gz
tar -xvf harness-v0.0.25-Preview-linux-arm64.tar.gz
```

{% endtab %}

{% tab title="AMD" %}

```bash
curl -LO https://github.com/harness/harness-cli/releases/download/v0.0.25-Preview/harness-v0.0.25-Preview-linux-amd64.tar.gz
tar -xvf harness-v0.0.25-Preview-linux-amd64.tar.gz
```

{% endtab %}
{% endtabs %}

2. Add the binary path to the system `$PATH` variable

```bash
echo 'export PATH="$(pwd):$PATH"' >> ~/.bash_profile
source ~/.bash_profile
```

3. After you install the CLI, it is available using the `harness` command. To verify run:

```bash
harness --version
```

{% endtab %}

{% tab title="MacOS" %}

#### Install the CLI on MacOS <a href="#install-the-cli-on-macos" id="install-the-cli-on-macos"></a>

1. Run commands below on terminal

```bash
curl -LO https://github.com/harness/harness-cli/releases/download/v0.0.25-Preview/harness-v0.0.25-Preview-darwin-amd64.tar.gz
tar -xvf harness-v0.0.25-Preview-darwin-amd64.tar.gz 
export PATH="$(pwd):$PATH" 
echo 'export PATH="'$(pwd)':$PATH"' >> ~/.bash_profile  
source ~/.bash_profile 
harness --version
```

(If you are using different shell variation of terminal e.g. zsh, replace `~/.bash_profile` with your shell specific profile file path e.g. `~/.zshrc`)
{% endtab %}

{% tab title="Windows" %}

#### Install the CLI on Windows <a href="#install-the-cli-on-windows" id="install-the-cli-on-windows"></a>

1. Run the commands below in Windows Powershell:

```
Invoke-WebRequest -Uri https://github.com/harness/harness-cli/releases/download/v0.0.25-Preview/harness-v0.0.25-Preview-windows-amd64.zip -OutFile ./harness.zip
```

2. Extract the downloaded zip file and change directory to extracted file location
3. Run following command in powershell to setup environment variables:

```
$currentPath = Get-Location 
[Environment]::SetEnvironmentVariable("PATH", "$env:PATH;$currentPath", [EnvironmentVariableTarget]::Machine)
```

4. Restart terminal
   {% endtab %}
   {% endtabs %}

### Configure Harness CLI <a href="#configure-harness-cli" id="configure-harness-cli"></a>

1. Obtain **Harness API Token**. You can follow the steps outlined in the Harness documentation's guide on [how to create a personal API token](/harness-platform/use-harness-platform/automation/api/add-and-manage-api-keys.md).
2. Retrieve your `Account ID` by navigating within the `Harness UI` to `ACCOUNT SETTINGS` > `Overview` > `Account Id`.
3. Login to Harness from CLI.

   ```bash
   harness login --api-key HARNESS_API_TOKEN --account-id HARNESS_ACCOUNT_ID
   ```

   > Note: Replace `HARNESS_API_TOKEN` with the Harness API Token obtained in the previous step, and `HARNESS_ACCOUNT_ID` with your specific Account Id.
4. Upon successful login, you will be greeted with the confirmation message **Login successfully done. Yay!** ![Harness Login](/files/UQZmir9FiEJJtkTICP1A)
