# Harness CLI — Command Reference > Complete list of every command supported by the Harness CLI, grouped by module. > **327 commands across 95 nouns × 11 public modules.** The grammar is **`harness [identifier] [flags]`** — the verb always comes first. A small set of self-management commands (`auth`, `install`, `version`, `debug`) sit outside the verb/noun grammar because they operate on the tool itself rather than a Harness resource. If you are an AI agent reading this file: every row below is a valid invocation. Placeholders in angle brackets (``, `/`) are the only free variables. Prefer `harness list noun --matrix` and `harness --help` for the live source of truth — this document mirrors the spec files under [`pkg/spec/`](pkg/spec/) but is regenerated by hand and may lag by a release. | Module | Commands | Notes | | ------------ | -------- | ------------------------------------------------------------------------------------------------------------------------- | | `core` | 22 | Auth (PAT + browser SSO via `--sso`), install/upgrade (core + plugins from GitHub/tarball/`all`), version, discovery (`list/get module`, `list/get plugin`, `list/get noun`), debug helpers | | `platform` | 48 | Orgs, projects, users, roles, connectors, secrets, settings, delegates, delegate tokens, Harness Worker Agents, entity usage | | `pipeline` | 45 | Pipelines, executions (abort/retry/retry_history), logs (live viewer), triggers CRUD, input sets CRUD, templates + versions, approvals, freeze windows | | `cd` | 20 | Services, environments, infrastructure definitions, service overrides | | `iacm` | 13 | IaCM workspaces (Terraform/OpenTofu) plus Ansible hosts/inventories/playbooks and the module/provider registries | | `har` | 47 | Artifact Registry — push (18 formats), pull, registries, artifact/version metadata, firewall scans, migrate, package-manager install helpers | | `code` | 51 | Harness Code — repos, PRs (`pr:mine`, `pr:review_pending`, review/merge/reopen/ready/edit, labels), review insights, reviewers/codeowners, branches, commits, tags, comments, checks | | `rt` | 41 | Resilience Testing — JMeter/Locust/k6 load tests, runs (follow/stop/rerun), templates, scripts, composite tests, usage | | `gitops` | 27 | GitOps agents, applications (sync/refresh), clusters, repositories, ApplicationSets | | `governance` | 11 | OPA policies, policy sets, policy evaluations | | `audit` | 2 | Read-only audit trail across every Harness resource | Use `harness list noun --matrix` for the live noun × verb matrix. Use `harness --help` for full flag details on any command. --- ## Contents - [Global conventions](#global-conventions) - [Core (management & discovery)](#core-management--discovery) - [Platform](#platform) - [Pipelines / CI-CD](#pipelines--ci-cd) - [CD (Continuous Delivery)](#cd-continuous-delivery) - [IaCM (Infrastructure as Code & Ansible)](#iacm-infrastructure-as-code--ansible) - [Artifact Registry (HAR)](#artifact-registry-har) - [Code (Harness Code)](#code-harness-code) - [Resilience Testing (RT)](#resilience-testing-rt) - [GitOps](#gitops) - [Harness Worker Agents](#harness-worker-agents) - [Governance](#governance) - [Audit](#audit) - [Interactive TUI (`--ui`)](#interactive-tui---ui) - [Cheat sheet for AI agents](#cheat-sheet-for-ai-agents) --- ## Global conventions These apply to every command and are not repeated in each module. - **``** — the resource identifier (e.g. pipeline ID, project ID, secret ID). - **Compound IDs** — code, pipeline-execution, PR-comment, and GitOps resources use `/` forms (e.g. `/`, `/`, `/`, `//`). The CLI accepts the same form everywhere a parent is required. - **Qualified nouns** — `noun:variant` distinguishes sub-operations on the same resource (`execute pr:merge`, `list pr:mine`, `list pr:review_pending`, `execute pr:review`, `execute pr:label`, `get pr:insight`, `get pipeline:summary`, `execute loadtest:sync`, `list kg:type`, `execute execution:abort`). - **`--set` / `--del`** — `create` and `update` commands accept `--set key=value` (repeatable) and, on update, `--del key` to clear a field. Nested paths use dots: `--set variables.region=us-east-1`. - **YAML I/O (`-f`)** — `create` and `update` on most resources accept `-f file.yaml` (or `-f -` for stdin) to send the body from a file instead of using `--set`. `get` prints YAML by default; add `--yaml` to force YAML on commands where another format is the default. - **Output format** — `--format table|text|csv|tsv|json|yaml` (plus `jsonl`/`markdown` where supported). Defaults: `table` for `list`, `text` for `get`/other verbs. `--json` / `--yaml` are shorthands. Pick the right shape: - `table` / `csv` / `tsv` (list) — projected columns only (shaped by `--columns`); `table` prints the paging footer; `tsv` is best for shell/awk. - `json` (any verb) — raw API response (full object + envelope); ignores `--columns`. Use when a field isn't a column, or to inspect create/update/execute results. - `yaml` (get) — data object with envelope stripped; the body that round-trips through `update -f` / `create -f`. - `text` — default human-readable summary for non-list verbs. - **Paging** — every `list` supports `--limit`, `--offset` (or `--page`), `--all`, and `--count` where the underlying API supports it. - **Scope** — `--account`, `--org`, `--project` override profile scope per-invocation. Multi-level nouns also accept `--level account|org|project` to switch scope. - **`--ui`** — many list and select commands support an interactive TUI (see [Interactive TUI](#interactive-tui---ui)). Requires a TTY. - **`--profile`** — pick a non-default auth profile for one invocation. Equivalent to setting `HARNESS_PROFILE`. --- ## Core (management & discovery) Source: [`pkg/spec/core.spec.yaml`](pkg/spec/core.spec.yaml). ### Authentication | Command | One-line description | | -------------------------- | ------------------------------------------------------------------------------------------ | | `harness auth login` | Save credentials to a named profile. Interactive PAT wizard by default; pass `--api-url` + `--api-token` for non-interactive login. Add `--sso` for browser OAuth2 (tokens stored in the OS keychain where available). | | `harness auth sso_refresh` | Refresh the SSO access token using the stored refresh token. | | `harness auth sso_status` | Show SSO token expiry and refresh status for the active profile. | | `harness auth setscope` | Set the default org and/or project on a profile. | | `harness auth logout` | Remove a profile and its stored credentials. | | `harness auth profiles` | List all configured authentication profiles. | | `harness auth status` | Show the current auth profile and validate credentials. | | `harness auth env` | Print env vars for the current auth context (use with `--export` for `eval`-friendly output). | | `harness auth token` | Print the active API token to stdout (useful for piping into other tooling). | ### Version & install | Command | One-line description | | -------------------------------- | ------------------------------------------------------------------------------- | | `harness version` | Print the Harness CLI version. | | `harness install cli` | Install or upgrade the `harness` binary **and** any installed modules in one shot (`--version`, `--install-dir`, `--force`, `--check`, `--core-only`). Errors if `--install-dir` does not match the current executable path. | | `harness install module ` | Install or upgrade a single CLI module binary (e.g. `har`). | | `harness install plugin ` | Install or upgrade a plugin. `` may be a plugin name (`har`), `owner/repo` (GitHub latest release), `owner/repo/prefix` (prefixed tags), a tarball URL, a local tarball/binary, or `all` to upgrade every installed registry plugin. `--version`, `--force`, `--check`, `--github-token`. | ### Discovery | Command | One-line description | | --------------------------- | --------------------------------------------------------------------------------- | | `harness list module` | List all loaded CLI modules (builtin + external). | | `harness get module ` | Show the domain model and nouns for a module (`--matrix` for noun × verb table). | | `harness list plugin` | List installed external plugin binaries. | | `harness get plugin ` | Show metadata for an installed plugin. | | `harness list noun` | List all registered nouns with their module and supported verbs (`--matrix`). | | `harness get noun ` | Show fields and supported commands for a specific noun. | ### Debug | Command | One-line description | | ----------------------------- | ---------------------------------------------------------------------------- | | `harness debug miscfg` | Trigger a misconfigured command (dev-only registry self-test). | | `harness debug update_check` | Probe the release manifest and report what an in-place upgrade would do. | | `harness debug sso-log` | Emit SSO auth debug events (for troubleshooting browser login flows). | --- ## Platform Source: [`pkg/spec/platform.spec.yaml`](pkg/spec/platform.spec.yaml). ### Account, Organizations & Projects | Command | One-line description | | -------------------------------- | --------------------------------------------------------------------- | | `harness get account` | Get details for the current account. | | `harness list organization` | List organizations in the account. | | `harness get organization ` | Get an organization by identifier. | | `harness create organization` | Create a new organization (`--set` fields or `-f org.yaml`). | | `harness update organization` | Update an organization (get-then-put via `--set`/`--del`, or `-f`). | | `harness delete organization` | Delete an organization by identifier. | | `harness list project` | List projects in an organization. | | `harness get project ` | Get a project by identifier. | | `harness create project` | Create a new project (`--set` fields or `-f project.yaml`). | | `harness update project` | Update a project (`--set`/`--del`, or `-f`). | | `harness delete project` | Delete a project by identifier. | ### Users, Groups & Service Accounts | Command | One-line description | | ------------------------------------ | --------------------------------------------------- | | `harness list user` | List users in the account. | | `harness get user ` | Get a user by identifier. | | `harness list user_group` | List user groups in the account. | | `harness get user_group ` | Get a user group by identifier. | | `harness list service_account` | List service accounts in the account. | | `harness get service_account ` | Get a service account by identifier. | ### Roles, Permissions & Resource Groups | Command | One-line description | | ------------------------------------ | ------------------------------------------------------------- | | `harness list role` | List roles in scope. | | `harness get role ` | Get a role by identifier. | | `harness list role_assignment` | List role assignments in scope. | | `harness get role_assignment ` | Get a role assignment by identifier. | | `harness list resource_group` | List resource groups in scope. | | `harness get resource_group ` | Get a resource group by identifier. | | `harness list permission` | List all available permissions. | | `harness get permission ` | Get a permission by identifier. | ### Settings | Command | One-line description | | ----------------------------- | ----------------------------------------------------- | | `harness list setting` | List platform settings. | | `harness get setting ` | Get a setting value by identifier. | ### Connectors & Secrets | Command | One-line description | | ------------------------------------- | --------------------------------------------------------------------------------------- | | `harness list connector` | List connectors (multi-level via `--level`). | | `harness get connector ` | Get a connector by identifier. | | `harness create connector ` | Create a connector (`--set` fields or `-f connector.yaml`). | | `harness update connector ` | Update a connector (`--set`/`--del`, or `-f`). | | `harness delete connector ` | Delete a connector by identifier. | | `harness execute connector:test ` | Run a connectivity test against a connector and return the structured result. | | `harness list secret` | List secrets (metadata only — values are never returned). | | `harness get secret ` | Get a secret by identifier (metadata only). | | `harness create secret ` | Create a secret (`--set` fields or `-f secret.yaml`; secret values are redacted in echo). | | `harness update secret ` | Update a secret (`--set`/`--del`, or `-f`). | | `harness delete secret ` | Delete a secret by identifier. | ### Delegates & Delegate Tokens | Command | One-line description | | ------------------------------------ | ------------------------------------------------------------------------------ | | `harness list delegate` | List delegates in scope (multi-level). | | `harness get delegate ` | Get a delegate by identifier. | | `harness list delegate_token` | List delegate tokens. | | `harness create delegate_token ` | Create a delegate token (token value is returned **once** at creation time). | | `harness delete delegate_token ` | Revoke (delete) a delegate token. | ### Entity Usage | Command | One-line description | | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | | `harness list entity_usage connector/` | List every place a given entity is referenced. Pass the target as `/` (e.g. `connector/git-hub`). | --- ## Pipelines / CI-CD Source: [`pkg/spec/pipeline.spec.yaml`](pkg/spec/pipeline.spec.yaml). ### Pipelines | Command | One-line description | | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | | `harness list pipeline` | List pipelines in a project. | | `harness get pipeline ` | Get a pipeline's YAML definition (`--format json` to convert; `--raw` for the full envelope). | | `harness create pipeline` | Create a pipeline — inline (`-f pipeline.yaml`) or Git-backed (`--connector`/`--repo`/`--file-path`). | | `harness update pipeline` | Update a pipeline's YAML definition (`-f file.yaml` or `-f -` for stdin). | | `harness delete pipeline ` | Delete a pipeline by identifier. | | `harness get pipeline:summary ` | Get a lightweight pipeline summary (without full YAML). | | `harness get runtime_input_template ` | Get the runtime input template for a pipeline (shows every `<+input>` placeholder). | | `harness list pipeline_v1` | List v1-schema pipelines in a project (legacy API compatibility). | | `harness get pipeline_v1 ` | Get a v1-schema pipeline by identifier. | ### Executions | Command | One-line description | | ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------- | | `harness execute pipeline ` | Trigger a pipeline execution (`--input key=val` repeatable, `--input-set`, `--input-file`, `--branch`, `--follow`). | | `harness execute pipeline:dynamic ` | Execute a pipeline whose YAML is validated dynamically (uses the validators endpoint before running). | | `harness execute pipeline:input_set ` | Execute using the inputSetList endpoint (input sets are merged server-side). | | `harness execute execution:abort <[pipeline/]id>`| Abort a running pipeline execution (`--interrupt-type AbortAll\|Abort\|Pause\|Resume\|StageRollback\|ExpireAll\|Retry`). | | `harness execute execution:retry ` | Retry a failed pipeline execution (`--retry-stages`, `--only-failed-stages`, `--input`, `--input-file`, `--follow`). | | `harness get execution:retry_history <[pipeline/]id>` | Show retry history and retryable stages for a pipeline execution. | | `harness list execution` | List pipeline executions in a project (`--status`, `--branch`, `--module`; optional pipeline scope). | | `harness get execution <[pipeline/]id>` | Get a pipeline execution by ID (`--no-graph` to skip the stage/step graph). | | `harness list execution_step <[pipeline/]id>` | List expanded execution steps (including loop/matrix iterations) for an execution. | | `harness list execution_log <[pipeline/]id>` | List all log keys for a pipeline execution. | | `harness get execution_log ` | Fetch logs for a log key. Passing `<[pipeline/]execId>` returns every log stream for the execution. `--follow` streams live, `--ui` launches the interactive log viewer, `--save` writes the log to a file. | ### Triggers, Input Sets & Templates | Command | One-line description | | ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- | | `harness list trigger` | List triggers for a pipeline (`--search` for a name filter). | | `harness get trigger ` | Get a trigger by identifier. | | `harness create trigger ` | Create a trigger from a YAML body (`-f trigger.yaml`; the file carries the full trigger definition). | | `harness update trigger <[pipeline/]id>` | Update a trigger's YAML definition (`-f trigger.yaml` or `-f -`). | | `harness delete trigger <[pipeline/]id>` | Delete a trigger by identifier (interactive confirm; use `-y` to skip). | | `harness list input_set` | List input sets for a pipeline. | | `harness get input_set ` | Get an input set by identifier. | | `harness create input_set ` | Create an input set from a YAML body (`-f input-set.yaml`). | | `harness update input_set ` | Update an input set's YAML definition (`-f input-set.yaml` or `-f -`). | | `harness delete input_set ` | Delete an input set by identifier (interactive confirm; use `-y` to skip). | | `harness list template` | List templates in a project. | | `harness get template ` | Get a template's stable version by identifier. | | `harness create template` | Create a template from a YAML body (`-f template.yaml`). | | `harness list template_version ` | List all versions of a template. | | `harness get template_version