What is Harness CLI?
The Harness CLI (hc) is a unified command-line interface that provides a consistent, resource-based approach to managing your Harness infrastructure. Whether you’re managing artifact registries, deploying infrastructure as code, or automating workflows, hc gives you powerful tools at your fingertips.The CLI follows a consistent pattern:
hc [<global-flags>] <command> <subcommand> [<positional-args>…] [<flags>]Key features
Artifact Registry management
Create, manage, and migrate artifact registries supporting 12+ package types including Docker, NPM, Maven, and more.
Infrastructure as Code
Plan, apply, and manage your infrastructure deployments directly from the command line.
Multiple output formats
Get results in human-readable tables or JSON format for easy integration with other tools and scripts.
Flexible authentication
Authenticate using interactive login, API keys, environment variables, or configuration files.
Available commands
auth - Authentication
auth - Authentication
Manage authentication with Harness services. Login, logout, and check your authentication status.
registry - Artifact registries
registry - Artifact registries
Manage Harness Artifact Registries. List, create, configure, and delete registries. Migrate artifacts from external sources.
artifact - Artifacts
artifact - Artifacts
Manage artifacts within registries. Push, pull, list, and delete artifacts across all supported package types.
iacm - Infrastructure as Code
iacm - Infrastructure as Code
Manage infrastructure deployments using Terraform and other IaC tools through Harness.
Supported package types
The Harness CLI supports a wide range of package formats:Docker
Generic
Go
NPM
Maven
Python
NuGet
Cargo
Composer
Conda
Dart
RPM
Quick start
Get up and running with the Harness CLI in minutes:Full quickstart guide
Follow our complete quickstart guide for detailed setup instructions.
Global options
All commands support these global flags for flexible configuration:Global flags can be overridden by environment variables (
HARNESS_API_URL, HARNESS_API_KEY, etc.) and command-line flags.Next steps
Installation
Explore all installation methods including manual installation and building from source.
Quickstart guide
Get from zero to your first successful command in minutes.
Authentication concepts
Learn about authentication methods and configuration options.
Command reference
Explore the complete command reference documentation.