# Helm CLI Usage

This page describes the CLI commands to fetch and publish charts after creating and configuring a Helm repository on Nexus.

## Fetch Helm Charts

After adding a Nexus Helm repository to your Helm client, fetch the latest chart or a specific chart version using the following commands.

```
helm fetch <helm_repository_name>/<chart_name>
helm fetch <helm_repository_name>/<chart_name> --version <chart_version>
```

Where,

- `<helm_repository_name>` - Local alias of the repository added to the Helm client.
- `<chart_name>` - Name of the chart to fetch.
- `<chart_version>` The chart version to fetch.

### Example:
```
helm fetch nexusrepo/mysql
helm fetch nexusrepo/mysql --version 1.4.0
```

### Example using an NVIDIA Helm proxy:
```
helm repo add nvidia-helm https://example.repo/repository/nvidia-helm/ --username admin --password admin123

# Use with any Helm command - for example:
helm fetch nvidia-helm/gpu-operator --version 25.3.2
```

## Upload Helm Charts

After creating a Helm hosted repository, publish charts to Nexus either through UI or using a supported command-line method. For publishing through UI, refer to [Uploading Components](https://help.sonatype.com/en/uploading-components.html "Uploading Components").

**Note**  
As of release 3.71.0, you can only upload components to a root Helm repository.

To upload a chart through command-line, use the following codeblock:
```
curl -u <username>:<password> http://<host>:<port>/repository/<repository_name>/ --upload-file <chart_file>.tgz -v
```

Where,
- `<username>` - Username used to authenticate to Nexus  
- `<password>` -Password used to authenticate to Nexus  
- `<host>` - Host name of your Nexus instance  
- `<port>` - Port of your Nexus instance  
- `<repository_name>` - Name of the Helm hosted repository  
- `<chart_file>.tgz` - Chart package to upload

### Example:
```
curl -u admin:admin http://localhost:8081/repository/helm-hosted/ --upload-file mysql-1.4.0.tgz -v
```

When using the Helm Push plugin, provide authentication credentials and a `--context-path` parameter that points to the hosted repository path, for example:
```
--username=<username> --password=<password> --context-path=/repository/<repository_name>/
```

Where,
- `<username>` - Username used to authenticate to Nexus  
- `<password>` - Password used to authenticate to Nexus  
- `<repository_name>` - Name of the Helm hosted repository

### Example:
```
--username=admin --password=admin --context-path=/repository/helm-hosted/
```

Provenance files with the `.prov.tgz` extension use the same upload process as chart uploads and are stored at the same tree structure level as chart. More information about provenance files, visit the [Helm website](https://helm.sh/docs/topics/provenance/).

## Search results

No results found
