Skip to main content

Install and upgrade the Harness CLI

Last updated on

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 will you learn in this topic?

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.
  • Remove the CLI and its local configuration.

Before you begin

Make sure you have:

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

Install the CLI

Open source

The Harness CLI is open source.

  • View the source code on GitHub.
  • Go to the command reference to view the complete list of supported commands.
  • Download specific versions from the releases page.

We welcome contributions. To report bugs or request features, open an issue. To contribute code, submit a pull request.

Run the installer:

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:

harness version

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

source ~/.zshrc
# or
source ~/.bashrc

Customize the installation

Pass installer options after sh -s --:

# Install only the core CLI
curl -fsSL https://raw.githubusercontent.com/harness/harness-unified-cli/main/install.sh | \
sh -s -- --core

# Install to a custom location without prompts
curl -fsSL https://raw.githubusercontent.com/harness/harness-unified-cli/main/install.sh | \
sh -s -- --non-interactive --install-dir /usr/local/bin
FlagDescription
--install-dir <path>Installs the binaries to a custom directory.
--coreInstalls only the harness binary.
--non-interactiveSuppresses prompts for automated environments such as CI/CD pipelines and containers.
--no-verifySkips checksum verification after download.

Install manually

If you prefer not to use the installer, download the appropriate release archive from GitHub Releases, extract the archive, and place the binaries in a directory that is included in your PATH.


Upgrade the CLI

The CLI can update itself without rerunning the installer:

# Upgrade to the latest release
harness install cli

# Install a specific version
harness install cli --version v1.2.3

# Check for the latest available version
harness install cli --check
FlagDescription
--version <tag>Installs a specific release version.
--install-dir <path>Overrides the installation directory.
--forceReinstalls the CLI even if the target version is already installed.
--checkDisplays the latest available version without installing it.

Uninstall the CLI

Remove the binaries:

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

Remove the CLI configuration directory:

rm -rf ~/.harness

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


Next steps