Skip to content

DECLARATIVE-YAML-12: Run a YAML config from the CLI

Feeding a declarative config into the validate command, which auto-discovers markdown-contract.yaml or takes an explicit –config.

Builds on: DECLARATIVE-YAML-11: Route several globs first-match-wins, with named contracts and exclude

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

Terminal window
# auto-discovers markdown-contract.yaml in the working dir:
markdown-contract validate docs/planning
# or point at one explicitly, JSON findings, exit 1 on errors:
markdown-contract validate docs/planning --config markdown-contract.yaml --format json
  • CLI validate <path> --config --format
  • loadConfigFile -> runCorpus
  • exit 0 clean / 1 errors / 2 usage