Harness CLI 3.0
A unified, spec-driven CLI for the entire Harness platform. Built for Humans and Agents, supercharging the Developer Experience across Harness ecosystem.
Manage pipelines, artifacts, code, GitOps, load testing, infrastructure, feature flags, governance, and platform resources
with a single consistent grammar.
Install ·
Quickstart ·
Grammar ·
Discovery ·
Commands ·
Output ·
Configuration ·
Contributing
Table of Contents
✨ Why Harness CLI?
- One grammar, every resource —
harness <verb> <noun> works identically across pipelines, code, artifacts, GitOps, load testing, IaC, feature flags, governance, and platform.
- Spec-driven — commands are declared in YAML specs and wired at startup, so new resources arrive without waiting on custom code paths.
- Self-describing — every module, noun, field, and verb is queryable at runtime with
list module, get module, list noun --matrix, and get noun.
- Human and machine friendly — the same command outputs a colored table for you, or JSON / JSONL / YAML / CSV / TSV / Markdown for scripts and agents. See docs/format.md for when to pick each format.
- Interactive when you want, headless when you don't — TUI wizards for onboarding and picking, non-interactive flags for CI, and
HARNESS_API_KEY for zero-config env-var auth.
- Live log streaming — follow pipeline executions with real-time SSE-based log tailing;
get execution_log --ui opens an interactive log viewer with step navigation and back (b).
- Interactive TUI (
--ui) — browse paginated lists, drill into PRs (details → AI review → conversation → checks → logs), and pick resources without memorizing IDs. Browser-like back navigation and link replay.
- Harness Code, end to end — clone repos (
pull repository), review PRs (list pr:review_pending, execute pr:review), merge/label/comment, configure AI Code Review (repo_settings:aicr), and read AI review insights (get pr:insight, get pr:conversation).
- GitOps & load testing — manage Argo CD agents, applications, clusters, and ApplicationSets; run JMeter/Locust/k6 load tests with
--follow streaming.
- SSO login —
harness auth login --sso (or the in-wizard "Login with SSO" option) drives a browser-based OAuth2 PKCE flow, no PAT/SAT required.
- Tab completion that talks to the API — completions for IDs return live
id<tab>Name suggestions.
- Multi-account, multi-profile — named profiles let you jump between accounts, orgs, and projects on the same shell.
- Agent-friendly — detects and reports the coding agent (Claude Code, Cursor, Gemini CLI, Codex, Cline, and more) so operators know how the CLI is being driven.
📦 Install
Recommended: one-line installer
macOS / Linux
curl -fsSL https://raw.githubusercontent.com/harness/cli/main/install.sh | sh
Windows (PowerShell)
irm https://raw.githubusercontent.com/harness/cli/main/install.ps1 | iex
The installer will:
- Download the latest
harness-bundle for your platform (macOS, Linux, and Windows — amd64 / arm64).
- Install
harness to ~/.local/bin on Unix or %LOCALAPPDATA%\Programs\harness on Windows (override with --install-dir / -InstallDir).
- Install the
har plugin from the same bundle into ~/.harness/bin.
- Optionally add the install directory to your
PATH and enable shell completions.
Installer flags
| Flag |
Description |
--install-dir <path> |
Override the install directory (default: ~/.local/bin on Unix, %LOCALAPPDATA%\Programs\harness on Windows) |
--core |
Install only the harness binary (skip the har plugin) |
--non-interactive |
Skip all prompts (useful for CI, Docker, provisioning scripts) |
--no-verify |
Skip checksum verification |
Windows PowerShell flags: -InstallDir, -Version, -Core, -NonInteractive, -NoVerify.
[!NOTE]
install.ps1 reads assets from GitHub Releases by default. Set HARNESS_INSTALL_BASE_URL to a local directory or internal mirror holding the release zip and checksums file to install from there instead — useful for air-gapped environments and for testing unreleased builds.
[!TIP]
When passing flags through a pipe, use sh -s -- — -s tells sh to read from stdin, and -- separates sh's own options from the installer flags.
# install core + har bundle (default)
curl -fsSL https://raw.githubusercontent.com/harness/cli/main/install.sh | sh
# install harness core only (skip the har plugin)
curl -fsSL https://raw.githubusercontent.com/harness/cli/main/install.sh | sh -s -- --core
# non-interactive install to a custom directory
curl -fsSL https://raw.githubusercontent.com/harness/cli/main/install.sh | sh -s -- --non-interactive --install-dir /usr/local/bin
# Windows — install core + har bundle (default)
irm https://raw.githubusercontent.com/harness/cli/main/install.ps1 | iex
# Windows — core only, non-interactive
$env:HARNESS_NONINTERACTIVE=1; $env:HARNESS_CORE_ONLY=1; irm https://raw.githubusercontent.com/harness/cli/main/install.ps1 | iex
Homebrew (macOS)
brew install --cask harness/tap/harness-cli
Installs the core harness binary only. Modules/Plugins are managed by the CLI, not by Homebrew.
Manual install
Prefer to install by hand? Download an archive from GitHub Releases, place harness on your PATH, and register the bundled har plugin with harness install plugin. Unix bundles are tar.gz; Windows bundles are zip. Published for linux_amd64, linux_arm64, darwin_amd64, darwin_arm64, windows_amd64, and windows_arm64.
This is also the path to take if curl | sh doesn't work in your environment — e.g. WSL behind a corporate SSL-inspecting proxy, air-gapped/vetted-binary environments, or scripted installs — see docs/manual-install.md for step-by-step instructions.
🔄 Upgrade
The CLI can upgrade itself in place:
harness install cli # upgrade to latest
harness install cli --version v1.2.3 # install a specific version
harness install cli --check # print the resolved version without installing (exits 1 if not found)
harness install cli --force # reinstall even if already up to date
harness install cli --core-only # skip module updates
| Flag |
Description |
--version <v> |
Version to install (default: latest) |
--install-dir <path> |
Directory to install the core binary into (default: ~/.local/bin) |
--force |
Install even if the current version is already up to date |
--check |
Print the resolved version without installing; exits 1 if not found |
--core-only |
Only install the core binary, skip module updates |
[!NOTE]
If you installed with Homebrew, upgrade with Homebrew: brew upgrade --cask harness/tap/harness-cli.
External modules are managed the same way:
harness install module har # install the Artifact Registry plugin
Modules that aren't compiled into the CLI ship as plugins — separate binaries the
CLI installs into ~/.harness/bin and dispatches to. install module is a
convenience form of install plugin, which also takes a tarball URL or a local
path for plugins that aren't Harness modules:
harness install plugin har # by name (same as install module har)
harness install plugin harness/cli # from a GitHub release (owner/repo)
harness install plugin https://example.com/foo.tar.gz # from a tarball URL
harness install plugin ./foo.tar.gz # from a local tarball
harness install plugin all # upgrade every installed plugin
⌨️ Shell Completions
Tab-completion is fully wired and hits the live API where useful — completions for IDs return id<tab>Name pairs.
Zsh
source <(harness completion zsh)
Bash
source <(harness completion bash)
Add the appropriate line to your .zshrc or .bashrc to make it permanent. The installer can do this for you.
🚀 Quickstart
# 1. Log in (interactive TUI)
harness auth login
# 2. See the shape of the world
harness list module
harness list noun --matrix
# 3. Do something
harness list pipeline
harness execute pipeline my-pipeline --follow
harness get execution my-pipeline/<execution-id>
🧭 Grammar
Every command is:
harness <verb> <noun> [identifier] [flags]
Verbs
| Verb |
Meaning |
list |
List resources of a noun (paginated). |
get |
Fetch a single resource by ID. |
create |
Create a resource — supports --file/-f (YAML) or --set key=value. |
update |
Update a resource — --set key=value, --del key. |
delete |
Delete a resource by ID. |
execute |
Run, trigger, or invoke a resource (pipelines, scans, HQL, etc.). |
push / pull |
Push/pull artifacts in HAR; clone a Code repo (pull repository). |
configure |
Configure a local client to use a Harness resource (e.g. a registry). |
install |
Install or upgrade the CLI and its modules. |
auth |
Manage authentication profiles. |
version |
Print the CLI version. |
Qualified nouns (noun:variant)
Some resources expose multiple variants of the same verb. The CLI uses a colon to qualify them:
harness get pipeline:summary <id>
harness execute pipeline:input_set <id>
harness execute pipeline:dynamic <id>
harness list pr:mine
harness list pr:review_pending
harness get pr:conversation <repo>/<pr>
harness execute pr:review <repo>/<pr> --decision approve
harness execute pr:merge <repo>/<pr>
harness execute pr:close <repo>/<pr>
harness pull repository <repo_id> [<dest-dir>]
harness execute loadtest my-test --follow
harness execute gitops_application:sync <agent>/<app>
harness get execution_log <pipeline>/<exec-id> --ui
harness push artifact:docker my-image:1.0
harness push artifact:terraform my-reg ./module.tar.gz --namespace myorg --name vpc --provider aws --version 1.0.0
harness execute artifact:download --registry my-reg --regex '.*\.tar\.gz$' --dest ./out
harness execute artifact_version:firewall_scan <ver>
harness execute registry:migrate <registry>
harness execute execution:abort <id>
harness execute execution:retry <id>
harness execute approval_instance:approve <id>
harness execute evaluation:run <id>
harness execute feature_flag:kill <id>
harness execute hql:run
Run harness list noun --matrix at any time to see every qualified verb the CLI supports.
🔐 Authentication
Credentials resolve in this order:
--profile <name> flag
HARNESS_API_KEY env var
HARNESS_PROFILE env var
- CI runner env vars (auto-detected)
- Default profile from
~/.harness/config.yaml
Interactive login
harness auth login
Launches a TUI wizard that walks through the API URL, PAT/SAT token, and default org/project. Requires a TTY. "Login with SSO" is offered right in the URL picker, so SSO is reachable from plain harness auth login — no extra flag needed.
SSO login
harness auth login --sso
Routes straight to the browser-based OAuth2 PKCE flow instead of prompting for a PAT/SAT token. --org / --project passed on the command line are respected and won't be overwritten by the picker.
Non-interactive login (CI, scripting)
Prefer HARNESS_API_KEY for CI. If you need a saved profile without a TTY, pass credentials as flags: