LinuxCommandLibrary

dyff

YAML/JSON diff tool for configuration files

TLDR

Compare two YAML/JSON files
$ dyff between [file1.yaml] [file2.yaml]
copy
Compare Kubernetes manifests
$ dyff between -k [manifest1.yaml] [manifest2.yaml]
copy
Show differences with specific output format
$ dyff between -o json [file1] [file2]
copy
Compare directories recursively
$ dyff between -r [dir1] [dir2]
copy

SYNOPSIS

dyff [command] [options] [files]

DESCRIPTION

dyff is a diff tool specifically designed for YAML and JSON configuration files. Unlike traditional line-based diff tools, it understands the structure of YAML/JSON documents and shows meaningful differences at the semantic level.
The tool is particularly useful for comparing Kubernetes manifests, configuration files, and structured data where the order of keys doesn't matter but their values do. It can ignore certain types of changes (like metadata timestamps) and provides various output formats.

PARAMETERS

between FILE1 FILE2

Compare two files
-k, --kubernetes
Compare Kubernetes manifests (ignore metadata timestamps)
-r, --recursive
Compare directories recursively
-o, --output FORMAT
Output format: human, json, yaml, tap (default: human)
--chroot PATH
Chroot both inputs to a specific path
--ignore-order-changes
Ignore changes in list order
--ignore-value-changes PATH
Ignore value changes at specific path
--no-table-style
Disable table output styling
-v, --version
Display version and exit
-h, --help
Display help and exit

COMMANDS

between FILE1 FILE2

Compare two files and show differences
json FILE
Parse and validate JSON file
yaml FILE
Parse and validate YAML file
version
Display version information

CAVEATS

Complex nested structures may produce verbose output. Large files can be slow to compare. Order-sensitive comparisons may miss reorderings unless specifically enabled. Some special YAML features may not be fully supported.

HISTORY

dyff was created by the Homeport team to address the need for semantic diffing of Kubernetes and configuration files. It provides more meaningful output than traditional diff tools when working with structured configuration data.

SEE ALSO

diff(1), kubectl(1), yq(1), dyff(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard