> 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-ai/use-harness-platform/automation/cli/examples.md).

# Harness CLI (hc) Examples

Examples of various use cases of Harness CLI.

{% 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 %}

### Registry Management Examples <a href="#registry-management-examples" id="registry-management-examples"></a>

#### List Registries <a href="#list-registries" id="list-registries"></a>

View all registries in your project:

```bash
hc registry list --org devrel --project sd1
```

You can also use the short alias:

```bash
hc reg list --org devrel --project sd1
```

![Registry List](https://173309742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3F2TpHXhur2QtQnORSM9%2Fuploads%2Fgit-blob-b4cfc852bb92c64cce61d236727f8c99ca649d4a%2Freg-list.png?alt=media)

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

### Artifact Management Examples <a href="#artifact-management-examples" id="artifact-management-examples"></a>

#### Pull Artifacts <a href="#pull-artifacts" id="pull-artifacts"></a>

Download artifacts from your registry to your local machine.

**General syntax:**

```bash
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:**

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

![Pull Generic Artifact](https://173309742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3F2TpHXhur2QtQnORSM9%2Fuploads%2Fgit-blob-e21e4cbcabdcd8e0022093badc77a6223f4ab7ea%2Fpull-arti-general.png?alt=media)

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

***

{% hint style="info" %}
**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](/artifact-registry/use-artifact-registry/artifact-registry-cli/manage-artifacts-registries.md).
{% endhint %}

{% @harness-feedback/feedback module="harness-ai" pagePath="harness-ai/use-harness-platform/automation/cli/examples" %}
