# 使用 Homebrew, Nix 安装 ocm

查看 ocm 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:ocm
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install ocm
```

  证据: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#ocm
```

  证据: nixpkgs package indexes: pkgs/by-name/oc/ocm/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:ocm
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/ocm>
- **版本:** 1.0.15
- **来源摘要:** CLI for the Red Hat OpenShift Cluster Manager
- **主页:** <https://www.openshift.com/>
- **仓库:** <https://github.com/openshift-online/ocm-cli>
- **上游文档:** <https://www.openshift.com/>
- **许可证:** Apache-2.0
- **源码归档:** <https://github.com/openshift-online/ocm-cli/archive/refs/tags/v1.0.15.tar.gz>
- **最后更新:** 2026-07-27T23:46:50+02:00
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- ocm (cli)
- ocm (别名)

## 构建依赖

- go

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 1.0.15
- 管理器更新时间: 2026-07-27
- 本地数据: OK
- 上游仓库: https://github.com/openshift-online/ocm-cli
- 检测到的最新版本: v1.0.15 (当前)
## 项目历史与用法

OCM CLI is the command-line client for Red Hat OpenShift Cluster Manager. It gives administrators and automation scripts a direct interface to the OCM API at api.openshift.com.

### 项目历史

The upstream openshift-online/ocm-cli README describes the project as command-line tools that simplify use of the OCM API. It is written and distributed as a Go CLI, with installation paths through Fedora/CentOS Copr packages, Homebrew, GitHub release binaries, and Go tooling.

The CLI follows the service model of OpenShift Cluster Manager: a managed service on Red Hat Hybrid Cloud Console used to create, operate, and upgrade OpenShift clusters. Red Hat documentation positions OCM as a unified dashboard for OpenShift Container Platform, OpenShift Dedicated, and Red Hat OpenShift Service on AWS cluster workflows.

The CLI evolved around authenticated API access. Its README documents offline access token login, OpenID token exchange through sso.redhat.com, per-user configuration files, `OCM_CONFIG` for multiple concurrent logins, keyring storage, opaque-token support, and raw API-style `get` requests.

### 采用历史

OCM CLI adoption is tied to Red Hat OpenShift operations rather than general Kubernetes administration. It complements the OpenShift `oc` CLI: `oc` manages cluster and application resources, while `ocm` speaks to Red Hat's cluster-manager APIs for subscription, fleet, and managed-cluster workflows.

Homebrew's formula API generated on 2026-07-01 lists stable version 1.0.15 and 620 installs over 365 days. The README's Fedora/CentOS Copr path and release-binary installation instructions show that Homebrew is only one of several distribution channels for OpenShift operators.

### 使用方式

A user logs in with an OpenShift Cluster Manager offline token from console.redhat.com, after which credentials are stored in an OCM configuration file or supported OS keyring. Commands can then retrieve objects, query cluster collections, print tokens for use with curl, and interact with API resources under paths such as `/api/clusters_mgmt/v1/clusters`.

The CLI is especially useful for operators who need repeatable cluster-management tasks, support workflows, or scripting against api.openshift.com without manually driving the web console.

### 为什么软件包爱好者会关心

OCM CLI is a vendor operations CLI with service-specific authentication, multiple native distribution channels, and a clean Homebrew formula. Its metadata helps distinguish Red Hat's cluster-manager API tooling from the separate OpenShift client binary `oc`.

### 时间线

- The README's installation example references release v0.1.30, reflecting the pre-1.0 release series used for binary distribution.
- Before version 0.1.56, the README says the configuration file used `~/.ocm.json`; later versions use platform-specific application configuration paths.
- 2026-07-01: Homebrew formula metadata lists stable version 1.0.15 and 620 installs over the previous 365-day analytics window.

### Related projects

- Related projects include Red Hat OpenShift Cluster Manager, the OCM API, openshift-online/ocm-sdk-go, openshift-online/ocm-api-model, Red Hat Hybrid Cloud Console, and the OpenShift `oc` client.

### 来源

- <https://api.openshift.com>
- <https://docs.redhat.com/en/documentation/openshift_cluster_manager/1-latest/html-single/managing_clusters/index>
- <https://formulae.brew.sh/api/formula/ocm.json>
- <https://github.com/openshift-online/ocm-api-model>
- <https://github.com/openshift-online/ocm-sdk-go>
- <https://raw.githubusercontent.com/openshift-online/ocm-cli/main/README.md>


## 安全说明

infrastructure mutation or orchestration signal.

- **Geiger 风险:** orange / 中
- infrastructure mutation or orchestration signal


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Linux: ~/.config/ocm/ocm.json
- macOS: ~/Library/Application Support/ocm/ocm.json

## Credential files

- Linux: ~/.config/ocm/ocm.json
- macOS: ~/Library/Application Support/ocm/ocm.json
## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** ocm
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## 其他软件包管理器记录

- Nix - ocm: normalized package name match | nixpkgs package indexes: pkgs/by-name/oc/ocm/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## 相关链接

- [Cloud CLI packages](https://pkg.so/zh-hans/cloud-clis/) - Belongs to a cloud or infrastructure command family.
- [Secret-risk packages](https://pkg.so/zh-hans/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Networking and protocol packages](https://pkg.so/zh-hans/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [go](https://pkg.so/zh-hans/brew/go/) - Build dependency declared by Homebrew.
- [openshift-cli](https://pkg.so/zh-hans/brew/openshift-cli/) - Shares the same upstream homepage.
- [osdctl](https://pkg.so/zh-hans/brew/osdctl/) - Shares pkgdb curated category or tags: cli, cloud-infrastructure, cluster-management, kubernetes, openshift.
- [kubernetes-cli](https://pkg.so/zh-hans/brew/kubernetes-cli/) - Shares pkgdb curated category or tags: cli, cloud-infrastructure, cluster-management, kubernetes.
- [k9s](https://pkg.so/zh-hans/brew/k9s/) - Shares pkgdb curated category or tags: cli, cloud-infrastructure, cluster-management, kubernetes.
- [talosctl](https://pkg.so/zh-hans/brew/talosctl/) - Shares pkgdb curated category or tags: cli, cloud-infrastructure, cluster-management, kubernetes.
- [cmctl](https://pkg.so/zh-hans/brew/cmctl/) - Shares pkgdb curated category or tags: cli, cloud-infrastructure, cluster-management, kubernetes.
- [clusterctl](https://pkg.so/zh-hans/brew/clusterctl/) - Shares pkgdb curated category or tags: cli, cloud-infrastructure, cluster-management, kubernetes.
- [rancher-cli](https://pkg.so/zh-hans/brew/rancher-cli/) - Shares pkgdb curated category or tags: cli, cloud-infrastructure, cluster-management, kubernetes.
- [rosa-cli](https://pkg.so/zh-hans/brew/rosa-cli/) - Local package facts share a topical domain. Shared terms: cli, cloud, cloud-infrastructure, infrastructure, kubernetes.

## Combined YAML source

View the package source record on GitHub. [combined/ocm.yml](https://github.com/mxcl/pkgdb/blob/main/combined/ocm.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
