> 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/3.0/harness-platform-resources/automation/cli/reference.md).

# Harness CLI Reference

{% hint style="danger" %}
**DEPRECATION NOTICE**

**Harness CLI (`hc`) v1.x.x will be deprecated and will reach end of life in a future release**.

We recommend migrating to the new version of [**Harness CLI**](/harness-ai/use-harness-cli/harness-cli/harness-cli-overview.md) to continue receiving the latest features, improvements, and official support.
{% endhint %}

Documentation containing information about all available commands and options within the Harness CLI v1 (`hc`) utility tool.

### Synopsis <a href="#synopsis" id="synopsis"></a>

```
Harness CLI is a tool to interact with Harness Resources.

Find more information at: https://developer.harness.io/docs/

Usage:
  hc [command]

VERSION:
   1.0.0 (Built with go1.24.9)

Available Commands:
  artifact    Manage Harness Artifacts
  auth        Authentication commands for Harness CLI
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  registry    Manage Harness Artifact Registries
  upgrade     Upgrade hc to the latest version
  version     Print the version number of hc

Flags:
      --account string          Account (overrides saved config)
      --api-url string          Base URL for the API (overrides saved config)
      --format string           Format of the result (default "table")
  -h, --help                    help for hc
      --org string              Org (overrides saved config)
      --profile string          Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex) (default "none")
      --profile-output string   Name of the file to write the profile to (default "profile.pprof")
      --project string          Project (overrides saved config)
      --token string            Authentication token (overrides saved config)
  -v, --verbose                 Enable verbose logging to console

Use "hc [command] --help" for more information about a command.
```

### Description <a href="#description" id="description"></a>

The new Harness CLI (`hc`) provides a modern, unified interface for managing Harness resources across the platform, with comprehensive support.

### Commands <a href="#commands" id="commands"></a>

`hc auth` - Manage authentication with Harness services (login, logout, status)

`hc registry` - Manage Harness Artifact Registries (create, list, get, delete, migrate)

`hc artifact` - Manage artifacts in Harness Artifact Registry (list, push, pull, delete)

`hc upgrade` - Upgrade hc to the latest version

`hc version` - Print the version number of hc

`hc completion` - Generate autocompletion scripts for your shell (bash, zsh, fish, powershell)

`hc help` - Show help for any command

### Global Flags <a href="#global-flags" id="global-flags"></a>

`--account` - Account ID (overrides saved config)

`--api-url` - Base URL for the API (overrides saved config)

`--format` - Format of the result: `table` (default), `json`, or `yaml`

`--org` - Organization ID (overrides saved config)

`--profile` - Name of profile to capture: `none` (default), `cpu`, `heap`, `goroutine`, `threadcreate`, `block`, `mutex`

`--profile-output` - Name of the file to write the profile to (default: `profile.pprof`)

`--project` - Project ID (overrides saved config)

`--token` - Authentication token (overrides saved config)

`-h, --help` - Show help for hc

`-v, --verbose` - Enable verbose logging to console

### Local command options <a href="#local-command-options" id="local-command-options"></a>

#### 1. `hc auth` commands <a href="#id-1-hc-auth-commands" id="id-1-hc-auth-commands"></a>

```
AVAILABLE COMMANDS:
   login       Login to Harness
   logout      Logout from Harness
   status      Check authentication status
```

#### 2. `hc registry` commands <a href="#id-2-hc-registry-commands" id="id-2-hc-registry-commands"></a>

```
AVAILABLE COMMANDS:
   configure   Configure package manager clients
   delete      Delete a registry
   fw          Firewall and security commands
   get         Get registry details
   list        List all registries
   metadata    Manage registry metadata
   migrate     Start a migration based on configuration
```

**For detailed examples and usage guides**, see [Manage Artifacts & Registries](/artifact-registry/use-artifact-registry/artifact-registry-cli/manage-artifacts-registries.md).

#### 3. `hc artifact` commands <a href="#id-3-hc-artifact-commands" id="id-3-hc-artifact-commands"></a>

```
AVAILABLE COMMANDS:
   copy        Copy an artifact package version to another registry
   delete      Delete an artifact or specific version
   get         Get artifact details
   list        List all packages
   metadata    Manage artifact metadata
   pull        Pull artifacts from Harness Artifact Registry
   push        Push artifacts to Harness Artifact Registry
```

**For detailed examples and usage guides**, see [Manage Artifacts & Registries](/artifact-registry/use-artifact-registry/artifact-registry-cli/manage-artifacts-registries.md).

#### 4. `hc upgrade` command <a href="#id-4-hc-upgrade-command" id="id-4-hc-upgrade-command"></a>

```
USAGE:
   hc upgrade [flags]

FLAGS:
   --pre-release   Include pre-release versions
```

#### 5. `hc version` command <a href="#id-5-hc-version-command" id="id-5-hc-version-command"></a>

```
USAGE:
   hc version
```

#### 6. `hc completion` command <a href="#id-6-hc-completion-command" id="id-6-hc-completion-command"></a>

```
AVAILABLE COMMANDS:
   bash        Generate the autocompletion script for bash
   fish        Generate the autocompletion script for fish
   powershell  Generate the autocompletion script for powershell
   zsh         Generate the autocompletion script for zsh
```

### Files <a href="#files" id="files"></a>

The CLI stores authentication credentials and configuration securely on your local machine after running `hc auth login`.

### Author <a href="#author" id="author"></a>

The Harness CLI v1 is developed and maintained by Harness, Inc.

### License <a href="#license" id="license"></a>

Harness CLI is released under the terms of the [MIT License](https://github.com/harness/harness-cli/blob/develop/LICENSE).

### See also <a href="#see-also" id="see-also"></a>

* [Install and Configure Harness CLI](/harness-ai/use-harness-platform/automation/cli/install.md)
* [Harness CLI Examples](/harness-ai/use-harness-platform/automation/cli/examples.md)
