> 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-cli/harness-cli/install-and-upgrade.md).

# Install and upgrade the Harness CLI

The Harness CLI is distributed as a self-contained binary for macOS and Linux (amd64 and arm64). This guide explains how to install, upgrade, and uninstall the CLI.

***

### What you will learn in this topic <a href="#what-you-will-learn-in-this-topic" id="what-you-will-learn-in-this-topic"></a>

By the end of this guide, you will be able to:

* Install the Harness CLI using the automated installer or a release archive.
* Customize the installation for CI/CD systems, containers, and non-standard installation paths.
* Upgrade to the latest release or install a specific version.
* Install or upgrade an individual module or external plugin.
* Inspect what an in-place upgrade would do before you run it.
* Remove the CLI and its local configuration.

***

### Before you begin <a href="#before-you-begin" id="before-you-begin"></a>

Make sure you have:

* macOS or Linux (amd64 or arm64).
* Bash or Zsh.
* Network access to download binaries and release metadata.

***

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

{% hint style="info" %}
**OPEN SOURCE**

**The Harness CLI is open source.**

* View the source code on [GitHub](https://github.com/harness/cli).
* For the complete list of supported commands, see the [command reference](https://github.com/harness/cli/wiki/Command-Reference).
* Download specific versions from the [releases](https://github.com/harness/cli/releases) page.

We welcome contributions. To report bugs or request features, open an [issue](https://github.com/harness/cli/issues). To contribute code, submit a [pull request](https://github.com/harness/cli/pulls).
{% endhint %}

Run the installer:

```sh
curl -fsSL https://raw.githubusercontent.com/harness/cli/main/install.sh | sh
```

The installer:

* Installs the `harness` and `harness-har` binaries.
* Adds the installation directory to your `PATH` if necessary.
* Configures shell completions for supported shells.

Verify the installation:

```sh
harness version
```

If the `harness` command is not available immediately after installation, restart your shell or reload your shell configuration:

```sh
source ~/.zshrc
# or <a href="#or" id="or"></a>
source ~/.bashrc
```

***

### Customize the installation <a href="#customize-the-installation" id="customize-the-installation"></a>

Pass installer options after `sh -s --`:

```sh
# Install only the core CLI <a href="#install-only-the-core-cli" id="install-only-the-core-cli"></a>
curl -fsSL https://raw.githubusercontent.com/harness/harness-unified-cli/main/install.sh | \
  sh -s -- --core

# Install to a custom location without prompts <a href="#install-to-a-custom-location-without-prompts" id="install-to-a-custom-location-without-prompts"></a>
curl -fsSL https://raw.githubusercontent.com/harness/harness-unified-cli/main/install.sh | \
  sh -s -- --non-interactive --install-dir /usr/local/bin
```

| Flag                   | Description                                                                           |
| ---------------------- | ------------------------------------------------------------------------------------- |
| `--install-dir <path>` | Installs the binaries to a custom directory.                                          |
| `--core`               | Installs only the `harness` binary.                                                   |
| `--non-interactive`    | Suppresses prompts for automated environments such as CI/CD pipelines and containers. |
| `--no-verify`          | Skips checksum verification after download.                                           |

***

### Install manually <a href="#install-manually" id="install-manually"></a>

If you prefer not to use the installer, download the appropriate release archive from [GitHub Releases](https://github.com/harness/harness-unified-cli/releases), extract the archive, and place the binaries in a directory that is included in your `PATH`.

***

### Upgrade the CLI <a href="#upgrade-the-cli" id="upgrade-the-cli"></a>

The CLI can update itself without rerunning the installer:

```sh
# Upgrade to the latest release <a href="#upgrade-to-the-latest-release" id="upgrade-to-the-latest-release"></a>
harness install cli

# Install a specific version <a href="#install-a-specific-version" id="install-a-specific-version"></a>
harness install cli --version v1.2.3

# Check for the latest available version <a href="#check-for-the-latest-available-version" id="check-for-the-latest-available-version"></a>
harness install cli --check
```

`harness install cli` upgrades the `harness` binary and every installed module in one shot. Add `--core-only` to upgrade the core binary and leave the modules untouched.

```sh
harness install cli --core-only
```

| Flag                   | Description                                                         |
| ---------------------- | ------------------------------------------------------------------- |
| `--version <tag>`      | Installs a specific release version.                                |
| `--install-dir <path>` | Overrides the installation directory.                               |
| `--force`              | Reinstalls the CLI even if the target version is already installed. |
| `--check`              | Displays the latest available version without installing it.        |
| `--core-only`          | Installs or upgrades only the core binary, not the modules.         |

{% hint style="info" %}
`--install-dir` must match the path of the executable that is currently running. If it does not, the command exits with an error rather than installing a second copy elsewhere.
{% endhint %}

***

### Install a module or plugin <a href="#install-a-module-or-plugin" id="install-a-module-or-plugin"></a>

Modules and external plugins ship as separate binaries that `harness` dispatches to transparently. Install or upgrade them individually when you do not want to touch the rest of the installation.

```sh
harness install module <module_name>
harness install plugin <plugin_name>
```

For example, install the Artifact Registry module on its own:

```sh
harness install module har
```

`harness install plugin` is an alias for `harness install module`, so either form works for an external plugin binary.

To review what is installed:

```sh
harness list module
harness list plugin
harness get plugin <plugin_name>
```

***

### Check what an upgrade would do <a href="#check-what-an-upgrade-would-do" id="check-what-an-upgrade-would-do"></a>

Probe the release manifest and report the actions an in-place upgrade would take, without changing anything on disk.

```sh
harness debug update_check
```

***

### Uninstall the CLI <a href="#uninstall-the-cli" id="uninstall-the-cli"></a>

Remove the binaries:

```sh
rm "$(command -v harness)" "$(command -v harness-har)" 2>/dev/null
```

Remove the CLI configuration directory:

```sh
rm -rf ~/.harness
```

Removing the configuration directory also deletes saved profiles, credentials, and CLI settings.

***

### Next steps <a href="#next-steps" id="next-steps"></a>

With the CLI installed, log in and set up a profile before you run your first command.

* [Authenticate](/harness-platform/use-harness-cli/harness-cli/authenticate.md): Log in and set up your first profile.
* [Harness CLI overview](/harness-platform/use-harness-cli/harness-cli/harness-cli-overview.md): Understand the command structure.
