Skip to main content
Automatically check for and install the latest version of the Harness CLI.

Usage

hc upgrade [flags]

Flags

--pre-release
boolean
default:"false"
Include pre-release versions when checking for updates. By default, only stable releases are considered.

How it works

The upgrade process:
1

Check current version

Compares your installed version with the latest release on GitHub
2

Download latest release

Downloads the appropriate binary for your platform (OS and architecture)
3

Verify checksum

Validates the downloaded file using SHA-256 checksums from the release
4

Extract binary

Extracts the hc binary from the archive (.tar.gz or .zip)
5

Replace current binary

Backs up your current binary and installs the new version

Examples

# Check and upgrade to latest stable release
hc upgrade

Supported platforms

The upgrade command automatically detects your platform and downloads the correct binary:
  • macOS: Darwin (Intel x86_64, Apple Silicon arm64)
  • Linux: x86_64, arm64, i386
  • Windows: x86_64, i386

Output examples

Already up to date

Checking for updates...
✓ You are already using the latest version: v2.0.0

Upgrade available

Checking for updates...
Current version: v1.5.0
Latest version:  v2.0.0

Downloading hc_v2.0.0_linux_x86_64.tar.gz...
Downloading... 100.0% (15234567/15234567 bytes)
Verifying checksum...
✓ Checksum verified
Extracting...
Installing...

✓ Successfully upgraded to v2.0.0
Release notes: https://github.com/harness/harness-cli/releases/tag/v2.0.0

Pre-release upgrade

hc upgrade --pre-release
Checking for updates...
Current version: v2.0.0
Latest version:  v2.1.0-beta.1
⚠️  This is a pre-release version

Downloading...
...
✓ Successfully upgraded to v2.1.0-beta.1

Development builds

If you’re running a development build, you’ll be warned:
Checking for updates...
⚠️  Development version detected. Upgrade may overwrite your local build.
Continue? (y/N):
Type y to proceed or n to cancel.

Safety features

Automatic backup

Your current binary is backed up before replacement

Checksum verification

Downloads are verified against official checksums

Rollback on failure

Automatically restores backup if installation fails

Platform detection

Automatically downloads the correct binary for your system

Troubleshooting

If you installed hc to a system directory, you may need elevated permissions:
sudo hc upgrade
This usually indicates a corrupted download. Try again:
hc upgrade
If the problem persists, download manually from the releases page.
Your platform may not be supported. Check the releases page for available platforms.
The upgrade command needs to access:
  • https://api.github.com - To check for releases
  • https://github.com - To download binaries
Ensure these domains are accessible from your network.

Manual upgrade

If automatic upgrade doesn’t work, you can upgrade manually:
  1. Download the latest release from GitHub
  2. Extract the binary
  3. Replace your existing hc binary:
# macOS/Linux
sudo mv hc /usr/local/bin/hc
sudo chmod +x /usr/local/bin/hc

# Verify
hc version

See also

Build docs developers (and LLMs) love