# helm repo add: Usage, Options & Common CI Errors

> helm repo add registers a chart repository locally. Private-repo auth, --force-update in CI, and the not-a-valid-chart-repository and 401 errors.

Source: https://latchkey.dev/learn/command-reference/helm-repo-add-command  
Updated: 2026-06-25

Register a chart repo so you can install from it.

helm repo add records a named chart repository in the local Helm config so you can search and install its charts. In CI you add the repos a build needs before installing third-party charts.

## What it does

helm repo add NAME URL fetches the repo's index.yaml and stores the entry. --username / --password (or --pass-credentials) authenticate to private repos; --force-update overwrites an existing entry with the same name - important in CI where a cached config may already hold a stale URL. After adding, helm repo update refreshes the cached index.

## Common usage

```Terminal
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add internal https://charts.example.com \
  --username "$HELM_USER" --password "$HELM_PASS"
helm repo add bitnami https://charts.bitnami.com/bitnami --force-update
helm repo update bitnami
```

## Common errors in CI

"Error: looks like \"URL\" is not a valid chart repository or cannot be reached" means the URL does not serve an index.yaml - a wrong URL, a repo that is OCI-only (use oci:// with helm pull/install, not repo add), or a network/proxy block. "401 Unauthorized" on a private repo means missing or wrong credentials; pass --username/--password and, for some servers, --pass-credentials so creds follow redirects. In CI the repo config is per-home; a fresh runner has no repos, so add (and update) them every run, and use --force-update to avoid "repository name (X) already exists" on cached homes.

## Using this in CI

A runner has no kubeconfig, no cached context, and no interactive auth. Every kubectl invocation in CI needs the context supplied explicitly, and most confusing CI failures here are the command running against the wrong cluster or no cluster at all.

```Terminal
# never rely on the ambient context on a runner
kubectl --context "$KUBE_CONTEXT" -n "$NAMESPACE" get pods

# confirm what you are actually connected to before mutating anything
kubectl config current-context
kubectl cluster-info

# fail fast instead of hanging on an unreachable API server
kubectl --request-timeout=30s get nodes
```

> Always set `--request-timeout` in CI. Without it an unreachable API server hangs until the job times out, which turns a thirty-second failure into a twenty-minute one.

## FAQ

### helm repo add: Usage, Options & Common CI Errors?

helm repo add records a named chart repository in the local Helm config so you can search and install its charts. In CI you add the repos a build needs before installing third-party charts.

### What it does?

helm repo add NAME URL fetches the repo's index.yaml and stores the entry. --username / --password (or --pass-credentials) authenticate to private repos; --force-update overwrites an existing entry with the same name - important in CI where a cached config may already hold a stale URL.

### Common errors in CI?

"Error: looks like \"URL\" is not a valid chart repository or cannot be reached" means the URL does not serve an index.yaml - a wrong URL, a repo that is OCI-only (use oci:// with helm pull/install, not repo add), or a network/proxy block.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
