Skip to content

CLI-09: Apply one contract inline with --contract

–contract validates a tree against a single YAML contract directly, no config file needed.

Builds on: CLI-08: Lean on auto-discovered config

A terminal session: the command as you’d run it, followed by the output it prints; trailing comments note the exit status.

Terminal window
# apply one YAML contract to every *.md under a path — no config file needed
markdown-contract validate ./decisions --contract contracts/decisions.contract.yaml
Scanned 1 file; 1 matched, 0 unmatched
No findings.
# --contract builds a single catch-all rule (**/*.md) and cannot combine with --config; exit status: 0
  • --contract <yaml> (config-less parameterization)
  • buildInlineConfig single-contract catch-all rule **/*.md
  • cannot combine with --config