This skill should be used when the user asks to "compare EDN files", "diff EDN", "see EDN changes between branches", mentions "edn-diff", discusses configuration changes between git branches, or wants to compare EDN data structures. Provides guidance for using the edn-diff Babashka script to compare EDN files between git branches.
edn-diff is a Babashka tool that compares EDN (Extensible Data Notation) files between different git branches. It's particularly useful for:
- Tracking configuration changes across branches
- Comparing data structures between commits
- Identifying added or removed keys/values in EDN files
- Automated EDN comparison in scripts
Invoke this skill when the user:
- Requests to compare EDN files between git branches
- Wants to see what changed in an EDN file
- Asks about configuration differences
- Mentions diffing EDN data structures
- Needs to track changes in Clojure/ClojureScript configuration files
Install via bbin:
bbin install io.github.200ok-ch/edn-diffedn-diff config.ednedn-diff -b=develop config.ednedn-diff -a config.ednedn-diff -r config.ednedn-diff -e config.ednedn-diff -b=develop -a -e config.edn| Option | Description | Default |
|-------------------------+------------------------------------+---------|
| -b, --branch=<branch> | Branch to compare with | master |
| -a, --added-only | Show only added items | - |
| -r, --removed-only | Show only removed items | - |
| -e, --edn-output | Output in EDN format for scripting | - |
| -h, --help | Show help message | - |
When working on a feature branch, see how your configuration differs from the main branch:
edn-diff -b=main deps.ednedn-diff -a -b=main deps.ednedn-diff -r -b=main config.ednUse -e flag to get EDN output for programmatic processing:
edn-diff -e config.edn | jq- Reads the EDN file from the current git branch
- Reads the same EDN file from the specified comparison branch
- Computes the diff using either:
clojure.data/difffor simple diffs (returns [only-in-a only-in-b common])lambdaisland.deep-diff2for detailed pretty-printed diffs (default output)
- Formats and outputs the result
- Always check the current branch with
git branch --show-currentto confirm what you're comparing - Use
-eflag when you need to parse the output in scripts or other tools - For large EDN files, consider using
-aor-rto filter to just the changes you care about - The tool works with any EDN file including deps.edn, config.edn, or custom data files
$ edn-diff deps.edn
=> Shows detailed diff between current branch and master$ edn-diff -a deps.edn
{:paths [...]
:deps {org.clojure/clojure {:mvn/version "1.11.1"}
new-lib/new-lib {:mvn/version "1.0.0"}}}$ edn-diff -e -a deps.edn
{:deps {new-lib/new-lib {:mvn/version "1.0.0"}}}