Installing 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 bash

Install using Homebrew

# Homebrew (macOS and Linux)
brew install open-component-model/tap/ocm

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 --help

see: Flakes

Install from AUR (Arch Linux User Repository)

git-url: https://aur.archlinux.org/ocm-cli.git package-url: https://aur.archlinux.org/packages/ocm-cli

# if not using a helper util
git clone https://aur.archlinux.org/ocm-cli.git
cd ocm-cli
makepkg -i

AUR Documentation

Install using Docker / Podman

podman run -t ghcr.io/open-component-model/ocm:latest --help

Build and Run It Yourself

podman build -t ocm .
podman run --rm -t ocm --loglevel debug --help

or interactively:

podman run --rm -it ocm /bin/sh

You 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-cli

see: chocolatey community package: ocm-cli

using winget

winget install ocm-cli

see: microsoft/winget-pkgs: Open-Component-Model

Building from Source

Prerequisites

Installation Process

Clone the open-component-model/ocm repo:

git clone https://github.com/open-component-model/ocm

Enter the repository directory (cd ocm/) and install the cli using make:

make install

Please note that the OCM CLI is installed in your go/bin directory, so you might need to add this directory to your PATH.

Verify the installation:

ocm version