Skip to main content

ocmo-cli

Command-line interface for the OCMO configuration service. A thin shell over ocmo-sdk with a kubectl-shaped verb/noun grammar. The CLI contains no API protocol logic of its own.

Distribution: PyPI name ocmo-cli · Python: 3.11+ · License: Apache-2.0

Pre-1.0.0: Pin ocmo-cli and ocmo-sdk to the same release as your OCMO API server.


Installation

Published package:

uv tool install ocmo-cli
# or
pipx install ocmo-cli

Monorepo development (from repository root):

uv sync --all-packages
uv run ocmo --help

Quick start

# Point at your server (saved to ~/.config/ocmo/config.yaml)
ocmo config set server https://ocmo.example.com
ocmo config set namespace prod

# Authenticate
ocmo auth login

# Use it
ocmo -n prod get config app/web
ocmo -n prod resolve app/web --cast json
ocmo -n prod ls tree app/

Configuration

Precedence (same model as kubectl):

command flag > OCMO_* env var > current context in ~/.config/ocmo/config.yaml > built-in default

Manage contexts:

ocmo config get-contexts
ocmo config use-context prod
ocmo config set server https://ocmo.example.com
ocmo config view

Output formats

-o, --output accepts: table (default on TTY), wide, json, yaml, name, raw, jsonpath=<expr>.


Exit codes

Code Meaning
0 Success
1 Generic runtime failure
2 Usage error
3 Not found (404)
4 Auth / permission failure (401, 403)
5 Conflict (409)
6 Path locked (423)
7 Validation failure (422, 413)
8 Hook execution failure
9 Import/export verification failure
10 Resolve returned no output items (length: 0)
130 Interrupted

Development

From repository root (workspace includes CLI and SDK):

uv sync --all-packages
uv run pytest cli/tests -q
uv run ruff check cli/
uv run mypy cli/ocmo_cli

Regenerate the command tree from the SDK operation map:

cd cli
uv run python scripts/generate_commands.py --write

Integration smoke tests (live API):

OCMO_RUN_INTEGRATION=1 uv run pytest cli/tests/test_smoke_integration.py -v

Architecture notes

Command surface

Generated operations are registered at import time from committed commands.yaml (produced from sdk/operations.yaml). CI fails if the file drifts from the spec. Hand-written commands live in ocmo_cli/commands/.

Framework

Built on click (not typer) for fast cold start, dynamic command registration, and programmatic ocmo api escape hatch.


Metadata

Release files for ocmo-cli 0.8.23

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for ocmo-cli 0.8.23
File Interpreter ABI Platform
ocmo_cli-0.8.23-py3-none-any.whl Python 3 none any Details

Release files / ocmo_cli-0.8.23-py3-none-any.whl

Download URL ocmo_cli-0.8.23-py3-none-any.whl
Size 139.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65a0ba761baa3d134c748794f18db475528f61da7d3f12c536191e7b1ab49b95
BLAKE2b-256 checksum
How to use checksums
72120b920f69eda7bfbb39fe579b5eedd677fc5855f40cbd6432e6ba324b1576
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.8.23 This release

1 release file

0.8.22

1 release file

0.8.21

1 release file

0.8.20

1 release file

0.8.19

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page