Skip to content

Scaffold the config with init

validate-05 · CLI transcript

init reads the markdown you already have, infers the tightest config that accepts it, and doubles as a CI drift guard with --check.

Builds on: Check a folder of docs

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

Terminal window
# preview what would be inferred from the folder
markdown-contract init ./decisions --dry-run
# write markdown-contract.yaml (init re-validates the folder against what it wrote)
markdown-contract init ./decisions
# in CI: fail when the documents outgrow the config
markdown-contract init ./decisions --check
# exit status: 0 in sync / 1 drift found / 2 nothing to check
  • init subcommand (inference)
  • --dry-run
  • --check drift guard
  • self-check on write