Skip to main content

v1

Last updated on

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

Synopsis

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

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

Commands

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

--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

1. hc auth commands

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

2. hc registry commands

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.

3. hc artifact commands

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.

4. hc upgrade command

USAGE:
hc upgrade [flags]

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

5. hc version command

USAGE:
hc version

6. hc completion command

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

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

Author

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

License

Harness CLI is released under the terms of the MIT License.

See also