Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

OpenShift CLI

$ oc Official High Risk
Red Hat · Cloud & Infra · Apache-2.0 · macos / linux / windows

Red Hat's OpenShift CLI (oc) wraps and extends kubectl with OpenShift Projects, Routes, BuildConfigs, and ImageStreams. It supports -o json, -o jsonpath, --dry-run=client|server, and oc status.

FCRS-1.0 Score
89 /100
Good
Medium Confidence
Zero-Friction Install
brew install openshift-cli
CLI vs MCP Decision CLI Preferred vs MCP

oc mirrors kubectl grammar with -o json, -o jsonpath, and --dry-run=server, giving agents complete OpenShift coverage without MCP overhead.

Agent-Readiness Checklist

✓ JSON Output
✓ Field Filtering
✓ Non-Interactive
✓ Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 21 / 25

Inherits kubectl -o json, -o jsonpath, --dry-run=client|server, and oc explain, though commands like oc new-app can print text warnings to stdout alongside JSON.

  • Supports -o json, -o jsonpath, and --dry-run=server
  • oc new-app -o json can emit non-JSON warning text on stdout
Trust & Safety 20 / 25

Supports server-side dry-run and oc auth can-i, though oc login can prompt interactively and cluster-scoped edits carry high impact.

  • Server-side --dry-run=server and RBAC oc auth can-i
Setup & Portability 15 / 15

Static Go binary distributed via Homebrew (openshift-cli) and Red Hat/OKD mirrors for macOS, Linux, and Windows.

  • Cross-platform binary via brew install openshift-cli
Utility & Efficiency 14 / 15

Single CLI covers both standard Kubernetes resources and OpenShift-specific Routes, Builds, and Operators.

  • Unified kubectl + OpenShift workflow
Maintenance & Lineage 10 / 10

Official Red Hat / OKD repository (openshift/oc) maintained in lockstep with OpenShift releases under Apache-2.0.

  • Official openshift/oc under Apache-2.0
Docs & Verifiability 9 / 10

Comprehensive Red Hat / OKD CLI reference docs and built-in oc explain / --help.

  • OKD and Red Hat CLI reference documentation

Security, Auth & Guardrails

Auth Modes
Config File OAuth Browser Service Account Env API Key
Credential Storage

Stores cluster tokens and contexts in ~/.kube/config (KUBECONFIG) via oc login.

Side Effects
Read-Only Local Write Remote Write Destructive
Cost & Quotas

CLI is Apache-2.0 open-source; OpenShift cluster usage depends on OKD or commercial Red Hat subscriptions.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# OpenShift CLI (oc) Agent Rules
- Always verify `oc whoami` and pass `-n <project>` explicitly on commands.
- Use `--dry-run=client` or `--dry-run=server` with `oc apply`/`oc new-app` before mutating clusters.
- Pass `--token` non-interactively instead of calling interactive `oc login` prompts.

Agent-Ready Command Recipes

Safe Read-Only Queries

Check current OpenShift user and project
oc whoami && oc project -q && oc status

Verifies active identity, project namespace, and workload summary before running mutations.

List routes in a namespace as JSON
oc get routes -n my-app -o json

Retrieves OpenShift Route hostnames and TLS configuration in structured JSON.

Controlled Writes & Previews

Preview a new application manifest with --dry-run=client
oc new-app quay.io/example/app:latest -n staging --dry-run=client -o json

Generates the Deployment, Service, and ImageStream JSON locally without creating cluster resources.

Strengths for Agents

  • + Full kubectl compatibility (-o json, -o jsonpath, --dry-run=server, explain).
  • + Native support for OpenShift Routes, Projects, BuildConfigs, and oc adm diagnostics.
  • + Cross-platform single binary maintained directly by Red Hat.

Caveats & Pitfalls

  • ! oc login without --token triggers interactive credential prompts that block headless shells.
  • ! Commands such as oc new-app may prepend human-readable warning lines before JSON output.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI