nddiff - diff tool for nested data structures


    nddiff [OPTIONS] <file1> <file2> [<file3> ... ]


Diff for nested data structures with human friendly and machine-readable output formats.



Where X is an op tag: A (added), N (new value), O (old value), R (removed) or U (unchanged). All ops enabled by default, except U. See "DIFF FORMAT" in Struct::Diff for more info about nested diff format.


Show where differences occured, but don't show what exactly changed.


On/Off colors for diff.

--ctx-text <int>

Amount of lines for multiline values context. Default is 3.


Print full headers (delta printed by default). Deprecated and will be removed soon. --no-pretty should be used instead.

--grep <path>

Grep substructures to diff. See path syntax description at


Print a help message and exit.

--ifmt <JSON|YAML>

Force specified input format usage. Will be selected automatically (using file name extension) if omitted. YAML::XS should be installed for YAML support.

--ignore <path>

Ignore substructure. May be used several times.


Use JSON as output diff format.

--ofmt <JSON|YAML>

Force specified output format usage. JSON is used by default; YAML::XS should be installed for YAML support, see "LIMITATIONS" in App::NDTools for more info.


On/Off pretty-print for default and JSON formats. Full headers will be printed in default mode if disabled. Enabled by default.


Don't show diff, only exit code shows exists diff or not.


Dump diff as rules for ndproc.


Visualize diff (JSON/YAML formatted diff expected for argument).

--verbose|-v [int]

Increase verbosity, max level is 4.


Print version and exit.


Human-friendly diff:

    nddiff a.json b.json

Machine-readable diff:

    nddiff --json a.json b.json

Same as above, but without added items:

    nddiff --noA --json a.json b.json


 0   No errors, no diff.
 1   Generic error code.
 2   I/O Error.
 4   Path related errors.
 8   Difference found.


Report bugs to


ndpatch, ndproc, ndquery

App::NDTools::NDDiff, Struct::Diff


Copyright 2016-2018 Michael Samoglyadov <mixas at>.

This program is free software; you can redistribute it and/or modify it under the terms of GNU General Public License 3 or later versions.