Skip to main content

Harness CLI Examples

Last updated on

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 to continue receiving the latest features, improvements, and official support.

Registry Management Examples

List Registries

View all registries in your project:

hc registry list --org devrel --project sd1

You can also use the short alias:

hc reg list --org devrel --project sd1

Registry List

This displays a table with your registries, including their identifiers, package types, and other details.

Artifact Management Examples

Pull Artifacts

Download artifacts from your registry to your local machine.

General syntax:

hc artifact pull <package_type> <registry_name> <package_path> <destination_path> [flags]

Flag:

  • --pkg-url: Full URL to the artifact package (useful for direct access)

Example with package URL:

hc artifact pull generic image cli-arti/latest/package.json ./dummy --pkg-url https://pkg.harness.io

Pull Generic Artifact

This downloads the specified artifact to the destination path on your local machine.


Learn More

For comprehensive documentation on managing artifacts and registries with the Harness CLI, including additional commands, flags, and advanced usage examples, visit the Artifact Registry CLI documentation.