hyrum [--version] COMMAND ...
Hyrum exposes five subcommands:
hyrum check TARGET [OPTIONS] — run TARGET (a tox environment name or make target, for example unit, lint) across many charm repos.hyrum clean [OPTIONS] — remove the build artefacts a run leaves behind, keeping the checkouts.hyrum compare BASELINE CURRENT [OPTIONS] — diff two saved runs.hyrum get-charms [OPTIONS] — clone or update every charm listed in a CSV into the charms directory.hyrum show PATH [OPTIONS] — print the status summary of a saved run.hyrum checkhyrum check [OPTIONS] TARGET
TARGET is the tox environment name or make target to run in each charm (for example, unit, lint, fmt).
--charms-dir PATH~/.cache/hyrum/charmsHYRUM_CHARMS--config PATH[ignore] table and the save setting are read.hyrum.toml (in the current directory; silently ignored if absent)--repo REGEX.* (all charms)--limit N--limit 1 always gives one run if any charm is runnable at all.0--framework {scenario,jubilant}--from-results PATH--save or --auto-save). Always a filesystem path: there is no default location, run id, or target-name lookup. Intersects with --repo, --framework, and [ignore] like every other filter, and is applied before --limit. A narrowed run turns off the default rolling save, since it would record every charm the run skipped as skipped; pass --save or --auto-save to save anyway.--status STATUS[,STATUS...]--from-results, only select charms whose saved outcome is one of these. Repeatable and comma-separated. Accepts the outcome statuses (passed, failed, no_target, timeout, runner_error, patcher_error, skipped) plus two groups: failing (reached the runner or the patcher and did not come out clean) and not-passing (everything but passed). Requires --from-results.failing (with --from-results)--runner {auto,tox,make}auto: prefer tox if tox.ini is present, otherwise prefer make; fall back to the other backend if the requested target is absent.tox: always use tox.make: always use make.auto--workers N1--tox-executable CMDtox--make-executable CMDmake--timeout SECONDStimeout.1800--no-patch--patch.--patch of ops @ canonical:main applies)--patch SPECSPEC is a PEP 508 requirement. May be given multiple times (once per package). If --patch is not given (and --no-patch is not set), hyrum applies the default ops @ canonical:main. Accepted forms:<name>==<version> (or any PEP 440 specifier) — pin to a PyPI version, for example ops==2.17.0, requests>=1.2,<2.<name> @ git+<url>[@<ref>][#subdirectory=<sub>] — explicit PEP 508 git source. <ref> is any git ref (branch, tag, commit SHA).<name> @ <url>[@<ref>] — bare https://… URL with optional @ref.<name> @ file://<path>, or a bare path (/abs, ./rel, ~/checkout) — a local checkout.ops @ <owner>:<branch> — GitHub shorthand for ops; expands to https://github.com/<owner>/operator at that branch.charmlibs-<name> @ <owner>:<branch> — GitHub shorthand for a charm library; expands to https://github.com/<owner>/charmlibs at that branch, with the subdirectory taken from the package name verbatim. Type the separators the way the directory exists in the monorepo (for example, charmlibs-nginx_k8s, charmlibs-interfaces-k8s-service). Charmlibs packages must be patched from a git source: a version pin or a local path is rejected.charms.<author>.v<n>.<lib> -> <spec> — patch a vendored charm library to a package. The left side is the dotted import path of the vendored lib/charms/<author>/v<n>/<lib>.py file; <spec> is any of the forms above for the replacement package, for example charms.operator_libs_linux.v0.apt -> charmlibs-apt==1.0.0.owner:branch shorthand is only accepted for ops and charmlibs-* packages. Any other package needs an explicit git+<url> or bare https://… URL.ops, hyrum also rewrites the ops[testing] and ops[tracing] companion packages from matching subdirectories of the operator monorepo.SPEC are not honoured: the patcher preserves whatever extras the charm itself declares.ops @ canonical:main--poetry-executable CMDpoetry.lock after patching."uvx poetry") or a single executable name.poetry--uv-executable CMDuv command used to regenerate uv.lock after patching.uv--lock-timeout SECONDSpoetry lock or uv lock during patching. Independent of --timeout (the per-charm runner timeout).600--auto-python / --no-auto-pythonpoetry lock with uv run --python X.Y so that the lock command runs under an interpreter that satisfies the charm’s declared requires-python. Requires uv on PATH.--auto-python--no-lock--preflight / --no-preflight--patch git ref exists in its remote (one git ls-remote per distinct URL and ref) and that the runner executables are installed, so a typo or a missing tool fails once instead of once per charm. A ref that does not exist in the remote is fatal; a full 40-character commit SHA is accepted even though git ls-remote cannot see it, while an abbreviated SHA is rejected because it cannot be fetched. Network and authentication failures warn and let the run continue, since they say nothing about whether the ref exists. Under --runner auto, a backend whose executable is missing is dropped with a warning, and only an empty set of backends is fatal. The ref check needs network access.--preflight--host-env-defaults / --no-host-env-defaultsPYO3_USE_ABI3_FORWARD_COMPATIBILITY=1) plus matching TOX_OVERRIDE pass_env+= entries, so common host build issues are not mis-attributed to the charm. Existing values are preserved. See Host prerequisites for the rationale.--host-env-defaults--log-dir PATH/ replaced by __.--quiet--verbose and --verbosity.--brief--quiet, --verbose and --verbosity.--verbose--quiet and --verbosity.--verbosity {debug,trace}debug: detailed execution logging.trace: currently aliased to debug; reserved for future per-line code tracing.--quiet and --verbose.--no-headers--no-failThe three save options are mutually exclusive. When none of them is given, hyrum reads the save setting from hyrum.toml; if that is absent too, it falls back to --auto-save with the default directory. An unusable save target is rejected before the run starts, rather than after it.
--save PATHPATH is an existing directory, hyrum writes a timestamped hyrum-<UTC>-<target>.json file inside it; otherwise PATH is the exact output file.--auto-save [DIR]DIR: <target>.auto.json for this run, with the previous run’s file rotated to <target>.auto.prev.json. Keyed on the target, so runs of different targets do not clobber each other.~/.cache/hyrum/results (also the default when no save option is given at all)--no-savehyrum cleanhyrum clean [OPTIONS]
Remove the build artefacts a check run leaves in each charm — .tox, .venv, tool caches, __pycache__ — while leaving the git checkouts in place, so the next run does not have to clone everything again. Across the whole collection these reach tens of gigabytes.
--charms-dir PATH~/.cache/hyrum/charmsHYRUM_CHARMS--dry-run--force--charms-dir cannot recursively delete something else.--no-lockcheck run then has its .tox or .venv deleted mid-run, so only use this when nothing else is running.--quiethyrum comparehyrum compare [OPTIONS] BASELINE CURRENT
Diff two saved results files at the status level: which charms newly fail, which are resolved, and which newly error. BASELINE and CURRENT are paths to JSON files written by hyrum check (see Output reference).
Charms are matched by their path relative to the charms directory, so two runs from different hosts or checkouts still compare charm-for-charm. A charm present in only one of the runs is reported as absent rather than as a change. If the two files record different targets, hyrum prints a warning to stderr and compares them anyway.
--fail-on-regression / --no-fail-on-regression--no-fail-on-regression--format {text,markdown,json}text: the colourised status-level summary, preceded by a line of metadata for each run.markdown: a document with a pass-rate paragraph, a list per change category, and a table with one row per non-passing charm, including each run’s failure summary. Suitable for pasting into an issue or pull request.json: the same diff as a machine-readable object, carrying both runs’ metadata, the per-category charm lists, and the pass-rate counts. Versioned separately from the saved-results format. See Output reference.texthyrum get-charmshyrum get-charms [OPTIONS]
Clone every repository listed in a CSV file into the charms directory, or git pull it if the directory already exists. Each row in the CSV is one repository; repositories that host multiple charms in subdirectories are cloned once.
Each repository is cloned to <dest>/<owner>/<name>, where <owner> and <name> are the last two components of the repository URL. A row that names a branch is cloned to <dest>/<owner>/<name>-<branch>, so the same repository can be present at more than one branch.
--source PATHRepository column (required), and the Branch (if not the default) and Commit columns (optional), are read; any other column, such as those in the repository’s charm-list/charms.csv, is ignored. A Commit must be a full 40-character SHA: the checkout is fetched and kept at that commit rather than pulled.charms.csv or charm-list/charms.csv in the current directory.--dest PATH~/.cache/hyrum/charmsHYRUM_CHARMS--workers Ngit subprocesses. The cap keeps a large charm list from exhausting the process file-descriptor limit.16--timeout SECONDSgit clone or pull is abandoned; 0 waits forever.300--repo REGEX.*--limit N0 clones or pulls every match. With --repo, the limit applies to the charms that match the pattern.0--quiethyrum showhyrum show [OPTIONS] PATH
Print a saved run: its metadata, then the same status table check prints at the end of a run. PATH is always a filesystem path to a results JSON file — there is no run-id or target-name lookup.
Exits 0 whatever the run contained: show displays a run, it does not gate on one. Gating lives in hyrum compare --fail-on-regression.
--verbose--no-headers--format {text,markdown,json}text: the colourised status-level summary.markdown: the same table in markdown.json: the same outcomes as a machine-readable object.text--version--help(exit-codes)=
| Code | Meaning |
|---|---|
0 |
All non-skipped charms passed (or --no-fail was set, or hyrum get-charms succeeded, or hyrum compare found no regressions) |
1 |
At least one charm resulted in failed, timeout, runner_error, or patcher_error; or the results file could not be written; or hyrum compare found a regression under --fail-on-regression |
2 |
Bad input, reported before or instead of a run: the save target given to hyrum check is unusable (a missing or unwritable directory, or a path that is a directory when a file is expected, checked before the run starts); or --status was given without --from-results, the --from-results file could not be read, or no charm matched it; or hyrum compare or hyrum show could not read a results file; or the two runs given to hyrum compare have no charms in common, so there is nothing to compare |
HYRUM_CHARMShyrum check --charms-dir and hyrum get-charms --dest. Overridden by the explicit flag.NO_COLOR1), suppresses ANSI colour in the summary table even on a tty. Setting it to the empty string leaves colour enabled.TOX_OVERRIDE--host-env-defaults so that tox pass_env entries propagate into the testenv. See Host prerequisites for fleet runs.# Clone every repository listed in ./charms.csv into the default charms directory:
hyrum get-charms
# Run tox -e unit with ops patched to a dev branch, 8 workers:
hyrum check unit --patch 'ops @ canonical:fix/my-change' --workers 8
# Pin ops to a specific PyPI release across the fleet:
hyrum check unit --patch 'ops==2.17.0'
# Patch a non-ops dependency from a git fork:
hyrum check unit --patch 'requests @ git+https://github.com/psf/requests@main'
# Point a charm library at a branch of canonical/charmlibs:
hyrum check unit --patch 'charmlibs-nginx_k8s @ canonical:main'
# Replace a vendored charm library with its PyPI package:
hyrum check unit --patch 'charms.operator_libs_linux.v0.apt -> charmlibs-apt==1.0.0'
# Patch ops *and* another dependency in the same run:
hyrum check unit \
--patch 'ops @ canonical:fix/my-change' \
--patch 'requests==2.31.0'
# Run without patching:
hyrum check unit --no-patch
# Run only charms that use the Scenario framework:
hyrum check unit --no-patch --framework scenario
# Run only charms matching a name pattern:
hyrum check unit --no-patch --repo '^mysql'
# Save logs for offline triage:
hyrum check unit --no-patch --log-dir ~/hyrum-logs
# Always exit 0 (useful in scripts):
hyrum check unit --no-patch --no-fail
# Show failed charms inline:
hyrum check unit --no-patch --verbose
# Save a baseline, then diff a patched run against it:
hyrum check unit --no-patch --save baseline.json
hyrum check unit --patch 'ops @ canonical:fix/my-change' --save current.json
hyrum compare baseline.json current.json
# Gate on regressions, and produce a table to paste into a pull request:
hyrum compare baseline.json current.json --fail-on-regression
hyrum compare baseline.json current.json --format markdown > report.md