Download Resources from Component Versions

Goal

Download resources from a component version using the OCM CLI. Learn how to fetch specific resources, optionally transform them to their native format, and save them to your local filesystem.

You’ll end up with

  • A resource file downloaded from a component version
  • Optionally a resource transformed to its native format (e.g., Helm chart .tgz)

Estimated time: ~5 minutes

How it works

  flowchart LR
    A[Component Version] -- "ocm download resource" --> B[Resource as Local File]

The OCM CLI fetches a specific resource from a component version and saves it to your local filesystem.

Prerequisites

Download Workflow

As mentioned in the concept document for Component Identity, components can be stored in OCI registries or local CTF archives, but the way you access them is the same — using their unique identity.

The following examples show component versions stored in a local CTF archive and in a remote OCI registry. The local CTF uses the component created in the Getting Started: Create Component Versions tutorial, while the remote OCI registry uses the Podinfo component published to GitHub Container Registry.

Using Transformers

To download resources in their native format instead of OCI blob format, use the --transformer flag.

In this example, we download the Helm chart resource using the helm transformer, which converts the OCI blob back into a standard Helm chart archive. The Helm chart is downloaded into a directory specified by --output.

ocm download resource ghcr.io/open-component-model//ocm.software/demos/podinfo:6.8.0 \
  --identity name=chart \
  --output helmchart-tgz \
  --transformer helm
You should see this output
time=2026-03-04T13:59:23.279+01:00 level=INFO msg="transforming resource..."
time=2026-03-04T13:59:24.238+01:00 level=INFO msg=copied descriptor.mediaType=application/vnd.cncf.helm.config.v1+json descriptor.digest=sha256:eb2808c21a03a7007ef9a7b5207af0a3b4115be5ce4bb340e0bf501abaf8d31e descriptor.size=348
time=2026-03-04T13:59:24.359+01:00 level=INFO msg=copied descriptor.mediaType=application/vnd.cncf.helm.chart.content.v1.tar+gzip descriptor.digest=sha256:ddf24dfc79800f80a8f1e5b8d462b15619c22d77c8ffe454636fef3b9a6d4f60 descriptor.size=14956
time=2026-03-04T13:59:24.361+01:00 level=INFO msg=copied descriptor.mediaType=application/vnd.oci.image.manifest.v1+json descriptor.digest=sha256:2360bdf32ddc50c05f8e128118173343b0a012a338daf145b16e0da9c80081a4 descriptor.size=828
time=2026-03-04T13:59:24.363+01:00 level=INFO msg="resource transformed successfully"
time=2026-03-04T13:59:24.363+01:00 level=INFO msg="resource downloaded successfully" output=helmchart-tgz
Inspect the Helm chart

The downloaded archive is now a regular Helm chart archive:

tar tvf helmchart-tgz/podinfo-6.8.0.tgz
-rw-r--r-- 0/0             313 2025-03-11 10:31 podinfo/Chart.yaml
-rw-r--r-- 0/0            4351 2025-03-11 10:31 podinfo/values.yaml
-rw-r--r-- 0/0            1361 2025-03-11 10:31 podinfo/templates/NOTES.txt
-rw-r--r-- 0/0            1965 2025-03-11 10:31 podinfo/templates/_helpers.tpl
-rw-r--r-- 0/0             455 2025-03-11 10:31 podinfo/templates/certificate.yaml
-rw-r--r-- 0/0            8051 2025-03-11 10:31 podinfo/templates/deployment.yaml
-rw-r--r-- 0/0             995 2025-03-11 10:31 podinfo/templates/hpa.yaml
-rw-r--r-- 0/0            1154 2025-03-11 10:31 podinfo/templates/ingress.yaml
-rw-r--r-- 0/0            2338 2025-03-11 10:31 podinfo/templates/linkerd.yaml
-rw-r--r-- 0/0             437 2025-03-11 10:31 podinfo/templates/pdb.yaml
-rw-r--r-- 0/0             239 2025-03-11 10:31 podinfo/templates/redis/config.yaml
-rw-r--r-- 0/0            1928 2025-03-11 10:31 podinfo/templates/redis/deployment.yaml
-rw-r--r-- 0/0             369 2025-03-11 10:31 podinfo/templates/redis/service.yaml
-rw-r--r-- 0/0             988 2025-03-11 10:31 podinfo/templates/service.yaml
-rw-r--r-- 0/0             325 2025-03-11 10:31 podinfo/templates/serviceaccount.yaml
-rw-r--r-- 0/0             598 2025-03-11 10:31 podinfo/templates/servicemonitor.yaml
-rw-r--r-- 0/0             912 2025-03-11 10:31 podinfo/templates/tests/cache.yaml
-rw-r--r-- 0/0             607 2025-03-11 10:31 podinfo/templates/tests/fail.yaml
-rw-r--r-- 0/0             694 2025-03-11 10:31 podinfo/templates/tests/grpc.yaml
-rw-r--r-- 0/0             884 2025-03-11 10:31 podinfo/templates/tests/jwt.yaml
-rw-r--r-- 0/0             781 2025-03-11 10:31 podinfo/templates/tests/service.yaml
-rw-r--r-- 0/0             632 2025-03-11 10:31 podinfo/templates/tests/timeout.yaml
-rw-r--r-- 0/0             815 2025-03-11 10:31 podinfo/templates/tests/tls.yaml
-rw-r--r-- 0/0             333 2025-03-11 10:31 podinfo/.helmignore
-rw-r--r-- 0/0           11365 2025-03-11 10:31 podinfo/LICENSE
-rw-r--r-- 0/0           13442 2025-03-11 10:31 podinfo/README.md
-rw-r--r-- 0/0            3427 2025-03-11 10:31 podinfo/values-prod.yaml

Specifying Resource Identity

If multiple resources share the same name, use additional identity attributes:

ocm download resource <repo>//<component>:<version> \
  --identity name=image,version=1.0.0 \
  --output image.tar

CLI Reference

CommandDescription
ocm download resourceDownload a specific resource
ocm get cvGet component versions and resources