jd
$ jd Community Low Riskjd compares JSON and YAML documents structurally rather than line-by-line, supporting set/multiset array matching (-set, -mset), RFC 6902 JSON Patch (-f patch), and applying patches cleanly via -p.
brew install jd Computes exact structural diffs and RFC 6902 patches locally without burning LLM tokens comparing raw JSON files.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports -f patch / -f merge structured JSON outputs, -yaml conversion, non-colored output by default, and predictable exit codes (0 match, 1 diff).
- Supports
-f patch(RFC 6902) and-f merge(RFC 7386) - No color unless
-coloris passed
Read-only diffing to stdout by default; patching outputs to stdout unless -o is explicitly supplied.
- Read-only default; explicit
-pand-orequired for patch writes
Single static Go binary available via Homebrew, go install, and GitHub Releases.
- Single Go binary (
brew install jd)
Eliminates key-order and array-order noise via -set and -mset while also acting as a format translator (-t yaml2json).
- Structural diffing with
-set,-mset, and-yaml
Actively maintained by Joseph Burnett under the MIT license.
- Active
josephburnett/jdrepository under MIT
Clear README examples and concise -h flag documentation covering patch formats and set semantics.
- Documented CLI flags and RFC patch examples in README
Security, Auth & Guardrails
None; operates purely on local JSON/YAML files and stdin/stdout.
MIT open-source CLI; completely free.
# jd Agent Rules - Use `jd -f patch` for machine-parseable RFC 6902 JSON Patch output. - Write patched outputs to a new file with `-o <out>` before replacing the original.
Agent-Ready Command Recipes
Safe Read-Only Queries
jd -f patch a.json b.json
Compares a.json and b.json structurally and emits a machine-readable RFC 6902 JSON Patch array.
jd -set a.json b.json
Treats JSON arrays as sets so reordered elements do not trigger noisy false-positive diffs.
Controlled Writes & Previews
jd -p -o patched.json diff.jd target.json
Applies diff.jd to target.json and writes the result to a new file via -o instead of overwriting in place.
Strengths for Agents
- + Outputs standard RFC 6902 (
-f patch) and RFC 7386 (-f merge) JSON diffs. - +
-setand-msetprevent noisy diffs on unordered JSON arrays. - + Color is off by default (
-coloropt-in), keeping stdout clean for agents.
Caveats & Pitfalls
- ! Diff mode returns exit code
1when differences exist, which scripts usingset -emust handle explicitly. - ! Native
jdpatch format is custom syntax unless-f patchor-f mergeis specified.