Documentation Index
Fetch the complete documentation index at: https://mehen.ophi.dev/llms.txt
Use this file to discover all available pages before exploring further.
mehen diff compares metrics between two git revisions and emits a per-file delta report. It is the
engine behind the GitHub Action and the recommended way to wire mehen into a
PR workflow.
| Flag | Description |
|---|---|
--from <FROM> | Base revision to compare from. |
--to <TO> | Head revision to compare to. |
-p, --paths <PATHS>... | Repository-relative files or directories to compare. |
-M, --metrics <METRICS> | Comma-separated metrics. Defaults to cyclomatic,cognitive,nom.functions,loc.lloc,mi.visual_studio. Prefix with + for higher-is-better, - for lower-is-better. |
-I, --include <INCLUDE>... | Glob to include files. |
-X, --exclude <EXCLUDE>... | Glob to exclude files. |
-O, --output-format <OUTPUT_FORMAT> | markdown or json. |
--show-unchanged | Show files where every metric is unchanged. |
--ignore-generated[=<BOOL>] | Skip files marked linguist-generated (default true). |
--fail-on <FAIL_ON> | Exit non-zero when named thresholds are crossed. Comma-separated: dmi-drop, new-broken-link, filler-high, all. |
Examples
- PR head vs main (Markdown)
- JSON for a CI script
- Custom metrics + polarity
- Strict gate on docs
Output formats
- Markdown
- JSON
GitHub-flavored Markdown table optimized for sticky PR comments. This is what the
GitHub Action posts on each PR.
What gets compared
mehen runs the equivalent ofmehen metrics against each side, joins by repository-relative path, and
computes per-metric deltas. Files that exist on only one side are reported as new or deleted. Files
matched by linguist-generated are skipped by default.
--fail-on thresholds
--fail-on accepts a comma-separated list of band-crossing rule IDs:
| Rule | Triggers when… |
|---|---|
dmi-drop | A Markdown file’s DMI crosses a band downward. |
new-broken-link | At least one new broken link is added. |
filler-high | A Markdown file’s Filler / Lazy Risk is ≥ 0.60. |
all | Any of the above. |
thresholds input, which post-processes the JSON report.
See Concepts → Thresholds and diffs.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success — the comment is advisory. |
| 1 | IO, git, parser-fatal, or unsupported-language error. |
| 2 | One or more --fail-on rules crossed (gating exit). |
See also
- GitHub Action — runs
mehen difffor you and posts the report on PRs. - PR comment design — Markdown comment template.
- Concepts → Thresholds and diffs.