Install the OCM CLI
Overview
You can install the latest release of the OCM CLI from any of the following sources (more details below):
Bash
To install with bash for macOS or Linux, execute the following command:
curl -s https://ocm.software/install.sh | sudo bashInstall using Homebrew
# Homebrew (macOS and Linux)
brew install open-component-model/tap/ocmEarlier releases of the tap installed the OCM CLI as a version-pinned formula
(e.g. ocm@0.43.0), which caused each release to accumulate as a separate
keg instead of upgrading in place. The tap has been fixed to use the
canonical, unversioned ocm formula, but Homebrew tracks installed packages
by the formula they were installed as — so existing version-pinned installs
need a one-time migration to switch onto the canonical formula.
Symptom you may see first:
$ brew upgrade open-component-model/tap/ocm
Error: open-component-model/tap/ocm not installedThis is expected. From Homebrew’s perspective you have ocm@<version>
installed, not ocm — they are two different formulas, even though they
ship the same binary. brew upgrade only upgrades formulas you already have,
so the canonical ocm is skipped and the existing ocm@<version> keg has
nothing newer to upgrade to. Run the migration below to switch over.
Quick path — installs the canonical formula and retargets the ocm
symlink in one go (older ocm@X.Y.Z kegs stay on disk; clean them up with
the next step or later at your leisure):
brew install open-component-model/tap/ocm
brew link --overwrite ocmFull cleanup — remove every version-pinned keg as well:
# list every version-pinned keg you currently have installed
brew list | grep '^ocm@'
# uninstall each one (repeat for every entry above)
brew uninstall ocm@<version> # e.g. brew uninstall ocm@0.43.0After migrating, brew upgrade replaces the binary in place on every release.
Install using Nix (with Flakes)
# Nix (macOS, Linux, and Windows)
# ad hoc cmd execution
nix run github:open-component-model/ocm -- --help
nix run github:open-component-model/ocm#helminstaller -- --help
# install development version
nix profile install github:open-component-model/ocm
# or release <version>
nix profile install github:open-component-model/ocm/<version>
#check installation
nix profile list | grep ocm
# optionally, open a new shell and verify that cmd completion works
ocm --helpsee: Flakes
Install from AUR (Arch Linux User Repository)
# if not using a helper util
git clone https://aur.archlinux.org/ocm-cli.git
cd ocm-cli
makepkg -iInstall using Docker / Podman
podman run -t ghcr.io/open-component-model/ocm:latest --helpBuild and Run It Yourself
podman build -t ocm .
podman run --rm -t ocm --loglevel debug --helpor interactively:
podman run --rm -it ocm /bin/shYou can pass in the following arguments to override the predefined defaults:
GO_VERSION: The golang version to be used for compiling.ALPINE_VERSION: The alpine version to be used as the base image.GO_PROXY: Your go proxy to be used for fetching dependencies.
Please check hub.docker.com for possible version combinations.
podman build -t ocm --build-arg GO_VERSION=1.22 --build-arg ALPINE_VERSION=3.19 --build-arg GO_PROXY=https://proxy.golang.org .on MS Windows
using Chocolatey
choco install ocm-clisee: chocolatey community package: ocm-cli
using winget
Deprecated: Please note, winget packages are no longer provided. Any existing packages are still working, but no new packages are built and published to winget repository.
Building from Source
Prerequisites
Installation Process
Clone the open-component-model/ocm repo:
git clone https://github.com/open-component-model/ocmEnter the repository directory (cd ocm/) and install the cli using make:
make installPlease note that the OCM CLI is installed in your
go/bindirectory, so you might need to add this directory to yourPATH.
Verify the installation:
ocm version