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
The artifact
Section titled “The artifact”A terminal session: the command as you’d run it, followed by the output it prints; trailing comments note the exit status.
# preview what would be inferred from the foldermarkdown-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 configmarkdown-contract init ./decisions --check# exit status: 0 in sync / 1 drift found / 2 nothing to checkWhat it exercises
Section titled “What it exercises”init subcommand (inference)--dry-run--check drift guardself-check on write
Continue
Section titled “Continue”- Previous: Bind a contract directly, scope the run
- Next: this is the last example of the group
- Group: Validate from the terminal · All examples
- Reference: CLI reference