CLI reference
Syntax
dmn-diff <file1.dmn> <file2.dmn> [--rows|-r] [--json|-j] [--xml|-x] [--no-color|-n] [--skip-breaking|-s] [--help|-h]Options
| Flag | Alias | Description |
|---|---|---|
| (none) | Semantic output — human-readable prose with change descriptions | |
--rows | -r | Row-diff table with + / - prefixes per changed field |
--json | -j | Structured DiffResult JSON object |
--xml | -x | Raw line-by-line diff of the XML source |
--no-color | -n | Disable ANSI color output |
--skip-breaking | -s | Always exit 0 — show the diff without failing the build |
--help | -h | Print the banner and option reference, then exit 0 |
Color output
All text outputs (semantic, --rows, --xml) use ANSI colors when writing to a terminal — removed lines in red, added lines in green, breaking markers in bold red. Colors are automatically disabled when piping to a file or another process (stdout is not a TTY), so CI logs stay clean.
To force-disable colors explicitly:
bash
dmn-diff before.dmn after.dmn --no-colorOr set the NO_COLOR environment variable:
bash
NO_COLOR=1 dmn-diff before.dmn after.dmn--json never uses colors.
Exit codes
| Code | Meaning |
|---|---|
0 | No semantic changes detected |
1 | One or more changes detected |
This makes dmn-diff suitable as a CI gate:
bash
dmn-diff main.dmn pr.dmn && echo "Clean" || echo "Changes detected"--skip-breaking
Use --skip-breaking to show the diff without failing the build — useful in informational pipelines or when changes are already reviewed.
bash
dmn-diff main.dmn feature.dmn --skip-breakingAlways exits 0 regardless of what changed. The diff is still printed in full.
| Changes present | Without flag | With --skip-breaking |
|---|---|---|
| Breaking only | 1 | 0 |
| Non-breaking only | 1 | 0 |
| Breaking + non-breaking | 1 | 0 |
| None | 0 | 0 |
Output examples
Default (semantic)
before.dmn → after.dmn
⚠ 1 breaking change(s) detected
~ inputEntry "r1ie1" (r1ie1) modified
text: > 700 → >= 700
1 added · 1 modified · 0 removed · 14 unchanged--rows
- [inputEntry] r1ie1 text: > 700
+ [inputEntry] r1ie1 text: >= 700
0 added · 1 modified · 0 removed · 14 unchanged--json
json
{
"meta": { "fromFile": "before.dmn", "toFile": "after.dmn", "hasChanges": true },
"summary": { "added": 0, "removed": 0, "modified": 1, "unchanged": 14 },
"changes": [
{
"type": "modified",
"id": "r1ie1",
"name": "r1ie1",
"elementType": "inputEntry",
"fieldChanges": [
{ "field": "text", "from": "> 700", "to": ">= 700", "severity": "non-breaking" }
]
}
]
}