Skip to content

CLI reference

Syntax

dmn-diff <file1.dmn> <file2.dmn> [--rows|-r] [--json|-j] [--xml|-x] [--no-color|-n] [--skip-breaking|-s] [--help|-h]

Options

FlagAliasDescription
(none)Semantic output — human-readable prose with change descriptions
--rows-rRow-diff table with + / - prefixes per changed field
--json-jStructured DiffResult JSON object
--xml-xRaw line-by-line diff of the XML source
--no-color-nDisable ANSI color output
--skip-breaking-sAlways exit 0 — show the diff without failing the build
--help-hPrint 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-color

Or set the NO_COLOR environment variable:

bash
NO_COLOR=1 dmn-diff before.dmn after.dmn

--json never uses colors.

Exit codes

CodeMeaning
0No semantic changes detected
1One 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-breaking

Always exits 0 regardless of what changed. The diff is still printed in full.

Changes presentWithout flagWith --skip-breaking
Breaking only10
Non-breaking only10
Breaking + non-breaking10
None00

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" }
      ]
    }
  ]
}

Released under the MIT License.