CLI Configuration File (AICRConfig)
CLI Configuration File (AICRConfig)
AICRConfig is a Kubernetes-style YAML/JSON document that captures the inputs
to the four workflow commands — aicr snapshot, aicr recipe, aicr bundle,
and aicr validate — so an end-to-end run version-controls as a single file
instead of a shell script full of flags. Each command accepts it through the
same --config flag:
This page documents the complete document schema in one place. The
CLI Reference shows per-command usage in its
Snapshot,
Recipe,
Validate, and
Bundle config-file-mode sections.
The schema’s source of truth is
pkg/config.
Document Envelope
Each spec.* section is optional and each command reads only its own section,
so a file may carry just one section or any combination. A document with none
of the four sections is rejected.
Loading, Precedence, and Secrets
Sources. --config accepts a local file path or an HTTP/HTTPS URL
(format detected from the extension; fetches are timeout- and size-bounded).
ConfigMap cm:// URIs are intentionally rejected — extract the data with
kubectl and pass the resulting file.
Precedence. A CLI flag always wins over the matching config field. For
slice and map fields (tolerations, selectors, --set), a flag given on the
command line replaces the file’s value; it does not append.
Nil vs. empty. For agent selectors and tolerations, omitting the field
entirely (nil) inherits the compiled-in defaults (tolerations defaults to
tolerate all taints), while an explicit empty value ({} / []) clears the
default. Several booleans are tri-state for the same reason: absent means
“inherit the CLI default”, an explicit false is an opt-out
(spec.validate.execution.failOnError, failFast,
spec.snapshot.execution.privileged, spec.recipe.criteriaStrict,
spec.validate.evidence.*).
Secrets are never part of the schema. The cosign OIDC identity token used
by attestation and evidence push is deliberately absent — supply it via the
COSIGN_IDENTITY_TOKEN environment variable or the --identity-token flag.
Complete Example
Field Reference
spec.snapshot
Inputs to aicr snapshot. There is no input section — the snapshot is
produced from the live cluster.
spec.recipe
Inputs to aicr recipe. criteria and input.snapshot are mutually
exclusive — query by criteria or derive from a snapshot, not both.
spec.bundle
Inputs to aicr bundle.
spec.validate
Inputs to aicr validate.
Cross-Section Rules
- At least one of the four
spec.*sections must be present. spec.recipe.criteriaandspec.recipe.input.snapshotare mutually exclusive.- When both
spec.recipe.output.pathandspec.bundle.input.recipeare set, they must reference the same file (compared afterfilepath.Clean; mixing absolute and relative forms is rejected). Mismatched paths in a workflow file are almost always a typo, so the loader fails up-front. - Enum-valued fields (
criteria.*, output formats, phases) are validated with the same parsers the CLI flags use, so error messages match the CLI’s.
See Also
- CLI Reference — per-command flags and config-file-mode examples
- Validation — validation phases and evidence workflow
- Bundling — deployers and bundle outputs