mdpact

CLI reference

mdpact ships a single binary: mdpact. Every command supports --help.

mdpact init

Scaffolds mdpact.config.ts, detects known spec files, edits .gitignore.

mdpact init [--yes] [--force]

mdpact lint

Runs enabled rules against the target specs.

mdpact lint [paths...] [--format pretty|json|github] [--max-warnings N]

Exit codes: 0 clean, 1 errors, 2 warnings over --max-warnings.

mdpact fix

Applies auto-fixable rule corrections in place.

mdpact fix [paths...] [--unsafe] [--dry-run]

Safe-only by default; --unsafe enables transformational fixes (e.g. inserting default frontmatter).

mdpact score

Computes the static score (0–100). Fails the command below --threshold.

mdpact score [paths...] [--threshold N] [--format pretty|json]

mdpact test

Runs the behavior-prediction engine against your declared models. Requires API keys in the environment.

mdpact test [--models claude-sonnet-4-6,gpt-4o-mini] [--runs 5] [--budget-usd 1]

Aborts mid-run without partial debit if the USD budget would be exceeded.

mdpact diff <ref>

Compares lint state against a git ref. Prints a diff of introduced / fixed / unchanged diagnostics.

mdpact diff main [--format markdown|json]

mdpact explain <rule-id>

Prints rule metadata and its documentation URL.

mdpact explain conflict/binding