DEV Community

Sergey Zhekpisov
Sergey Zhekpisov

Posted on

diffyml: a faster, leaner YAML diff tool

I love "dyff". I really do. For a long time, it was the best CLI tool for comparing YAML files for me.

But I was tired of typing "dyff between " every time. Every time thinking: why "between"? A diff tool should just... diff.

That small friction was the start. Then I submitted a PR and waited five months with no response. The project seemed to have stalled.

dyff is a well-built tool that popularised structural YAML diffing, and I have a lot of respect for it. Maintaining open source is hard, and I don't blame anyone for stepping back. But I needed a tool I could rely on and evolve — so I built one.

Meet diffyml.

→ "diffyml file1.yaml file2.yaml". No subcommands, no ceremony.
→ Faster than dyff at every file size tested.
→ 1 runtime dependency vs dyff's 14 — just yaml.v3 and the Go stdlib. Fewer deps = smaller attack surface.
→ Lowest memory footprint at every file size tested (18.4 MB at 5K lines vs 21–326 MB for alternatives).
→ Kubernetes-aware — auto-detects resources by apiVersion/kind/metadata and tracks renames as moves, not remove + add.
→ Git-native — works as GIT_EXTERNAL_DIFF and KUBECTL_EXTERNAL_DIFF drop-in replacement.
→ CI/CD annotations — GitHub Actions, GitLab CI, and Gitea output formats built in.
→ Directory comparison — compares entire directories, matching files by name.

But what about code quality?

→ 1,400+ tests — unit, end-to-end, property-based, and fuzz.
→ 99.9% code coverage on core logic, with mutation testing on every PR.
→ CI runs govulncheck, golangci-lint, CodeQL, and OpenSSF Scorecard.

It's out now, MIT-licensed. Install via Homebrew tap or go install.

Try it, and if you like it, leave it a star, so other fellow YAML developers can discover it too!

GitHub logo szhekpisov / diffyml

A fast, structural YAML diff tool — in a single-dependency binary

diffyml

A fast, structural YAML diff tool with built-in Kubernetes intelligence. One dependency, minimal attack surface, native CI annotations for GitHub, GitLab, and Gitea.

OpenSSF Scorecard Go Report Card Go Reference codecov Release License: MIT Tests Security & Static Analysis

diffyml output

diffyml compares YAML files and shows meaningful, structured differences — not line-by-line text diffs.

Why diffyml?

Fastest at scale. 7.5x faster than dyff on 78 KB files, 10.6x faster on 780 KB files, with the lowest memory footprint among YAML-aware tools at scale. Near-linear scaling. See PERFORMANCE.md for methodology and results.

One dependency, zero surprises. A single runtime dependency (yaml.v3) and pure Go stdlib. Minimal attack surface, auditable in minutes.

Gets YAML right. Dotted keys, type preservation, mixed-type lists, nil values — concrete edge cases other tools get wrong. diffyml treats YAML semantics as first-class, not an afterthought.

How It Compares

Feature diffyml dyff plain diff
YAML-aware (structural diff) Yes Yes No (line-based)
Kubernetes resource matching By apiVersion + kind + name By apiVersion

Top comments (0)