> 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/harness-cli-overview.md).

# Harness CLI Overview

The Harness CLI provides a command-line interface for managing and automating resources across your Harness account. From a single terminal, you can trigger deployments, manage resources, rotate secrets, query audit logs, and perform many of the same actions available in the Harness UI.

Common use cases include:

* **Automating repetitive tasks:** Create and manage pipelines, connectors, secrets, and other resources in bulk using YAML files or command-line flags.
* **Integrating with CI/CD workflows:** Trigger pipeline executions, monitor execution status, and automate deployment workflows from scripts and external automation tools.
* **Troubleshooting and validation:** View execution logs, inspect resource configurations, and verify connector connectivity without leaving the terminal.
* **Managing resources at scale:** Export resources as JSON, compare configurations, and audit changes across accounts, organizations, and projects.

***

### 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 page, you will understand:

* How Harness CLI commands are structured, including actions, resources, identifiers, and flags.
* Which actions are available and the operations they support.
* How resource-specific commands extend base actions for specialized workflows.
* Which Harness modules are supported and the resources available within each module.
* How to discover and explore available commands directly from the terminal.

***

### Command structure <a href="#command-structure" id="command-structure"></a>

Every Harness CLI command follows a consistent `action resource identifier flags` pattern:

```sh
harness <action> <resource> [identifier] [flags]
```

For example:

```sh
harness list pipeline
harness get secret my-secret --level account
harness execute pipeline deploy-prod --branch main
harness create project -f project.yaml
```

This predictable command structure makes the CLI easier to learn and use. After you identify the action and resource you want to work with, you can discover available options through built-in help and tab completion.

Tab completion suggests resources, identifiers, flags, and valid values directly from the Harness API, helping you construct commands efficiently and accurately.

***

### Core actions <a href="#core-actions" id="core-actions"></a>

The CLI provides six core actions that are available across most resources:

| Action    | Description                                                                                                                                    |
| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `list`    | Display a collection of resources. You can optionally filter results by a parent resource, such as listing executions for a specific pipeline. |
| `get`     | Retrieve details for a single resource by its identifier.                                                                                      |
| `create`  | Create a new resource from a YAML file (`--file` or `-f`) or by specifying values with `--set` flags.                                          |
| `update`  | Modify an existing resource by updating fields with `--set` or removing fields with `--del`.                                                   |
| `delete`  | Remove a resource by its identifier.                                                                                                           |
| `execute` | Run or trigger an operation, such as executing a pipeline, starting a scan, or running an HQL query.                                           |

Some modules provide additional actions. For example, the Artifact Registry module includes `push` and `pull` commands for uploading and downloading package content.

***

### Advanced resource operations <a href="#advanced-resource-operations" id="advanced-resource-operations"></a>

Some resources support specialized operations that extend the six core actions. These operations are represented using a `resource:operation` syntax.

```sh
harness get pipeline:summary <id>
harness execute pipeline:input_set <id>
harness push artifact:docker my-image:1.0
harness execute registry:firewall_scan <id>
```

Resource operations provide access to functionality that is specific to a particular resource. For example, `pipeline:summary` returns a lightweight overview of a pipeline without retrieving its complete YAML definition.

To discover available resource operations, run the following command:

```sh
harness list noun --matrix
```

This command displays all supported resources and resource operations available in your installed CLI version.

***

### Modules <a href="#modules" id="modules"></a>

The Harness CLI organizes commands into modules. Each module groups related resources within a specific functional area:

| Module                                | Resources it covers                                                                                                                                                                    |
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Core**                              | Authentication and profiles, install and upgrade, version, module and plugin discovery, and debug helpers                                                                              |
| **Platform**                          | Account hierarchy, RBAC, connectors, secrets, settings, delegates, delegate tokens, Harness Worker Agents, and entity usage                                                            |
| **Continuous Delivery**               | Pipelines, executions, triggers, input sets, templates and template versions, approvals, deployment freezes, services, environments, infrastructure definitions, and service overrides |
| **Artifact Registry**                 | Registries, artifacts, versions, metadata, push in 18 package formats, pull, install helpers, security scans, and migrations                                                           |
| **Infrastructure as Code Management** | Terraform and OpenTofu workspaces, remote plans, Ansible hosts, inventories, playbooks, and the module and provider registries                                                         |
| **Code Repository**                   | Repositories, pull requests, code review, reviewers and codeowners, AI review insights, branches, commits, tags, comments, and checks                                                  |
| **GitOps**                            | Agents, applications, destination clusters, source repositories, and ApplicationSets                                                                                                   |
| **Governance**                        | OPA policies, policy sets, and policy evaluations                                                                                                                                      |
| **Audit**                             | Read-only audit trail across every Harness resource                                                                                                                                    |
| **AI Evaluations**                    | Datasets, metrics, metric sets, evaluation targets, models, evaluation runs, and suites                                                                                                |
| **Knowledge Graph**                   | Entity graph schema and HQL query engine (run, validate, explain)                                                                                                                      |

All modules use the same command structure, flag conventions, and output formats. Once you learn how to work with one module, you can apply the same patterns across the rest of the CLI.

***

### Discover commands interactively <a href="#discover-commands-interactively" id="discover-commands-interactively"></a>

You can explore available modules, resources, actions, and command options directly from the terminal:

```sh
harness list noun --matrix       # Show resources and supported actions
harness list module              # Show available modules
harness get module pipeline      # Show module details and guides
harness get noun pipeline        # Show resource fields and actions
harness list pipeline --help     # Show command usage and flags
```

If you enter an invalid resource name, the CLI suggests the closest matching resource and exits with a non-zero status code.

***

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

Install the CLI, then log in and confirm which operations the CLI supports for the resources you plan to automate.

* [Install and upgrade](/harness-platform/use-harness-cli/harness-cli/install-and-upgrade.md): Get the CLI on your machine.
* [Authenticate](/harness-platform/use-harness-cli/harness-cli/authenticate.md): Log in and configure profiles.
* [Supported resources and actions](/harness-platform/use-harness-cli/harness-cli/supported-resources-and-actions.md): Review the full resource and action matrix.
