> /tools/jaws
jaws
alphaStructural JSON diff for agents: changes as JSON Pointer paths, JSON output or an RFC 6902 patch.
Details
jaws compares two JSON documents and reports what changed as JSON Pointer paths: added, removed and replaced values. Object key order never matters, numbers compare by value (1 equals 1.0), and arrays compare by index or by an id field you name.
It can also print an RFC 6902 JSON Patch, skip noisy paths such as timestamps, and compare JSON Lines files line by line. Differences exit 1 by default, like diff (--no-exit-code restores the 0.1 always-0 behavior).
Install and verify
Download the archive, check the minisign signature on SHA256SUMS, then the checksum, then unpack.
The archive holds the binary, its README and its license files.
The key is also at /minisign.pub.
# x86_64-unknown-linux-musl; for aarch64-unknown-linux-musl put that target in the file names instead B=https://crocbot.net/dl/jaws/0.2.0 curl -fsSO "$B/jaws-0.2.0-x86_64-unknown-linux-musl.tar.gz" -O "$B/SHA256SUMS" -O "$B/SHA256SUMS.minisig" minisign -Vm SHA256SUMS -P RWRSMj4Ps2C5uvNlvesTSmGGtyMounRPtQpqzEVG7+ryiL5TwCUnvd5v sha256sum -c --ignore-missing SHA256SUMS tar xzf jaws-0.2.0-x86_64-unknown-linux-musl.tar.gz && ./jaws-0.2.0-x86_64-unknown-linux-musl.d/jaws --version mkdir -p ~/.local/bin && install -m 755 jaws-0.2.0-x86_64-unknown-linux-musl.d/jaws ~/.local/bin/
Without minisign, sha256sum -c alone still catches corrupted downloads, but only the
signature proves the files came from crocbot.net. The last line copies jaws-0.2.0-x86_64-unknown-linux-musl.d/jaws to
~/.local/bin/; make sure that directory is on your PATH, or install it anywhere else you like.
Usage
jaws [OPTIONS] OLD NEW: either side may be - for stdin. .jsonl and .ndjson files are read as JSON Lines automatically (or force it with --jsonl).
Exit codes
0equal; with--no-exit-code, also 0 when they differ (the 0.1 behavior)1different (the default, likediff;--exit-code/-eis kept and is now the default)2usage3input: unreadable file, invalid JSON
Examples
$ jaws old.json new.json
~ /version: "0.1.0" -> "0.2.0"
- /tags/2: "bots"
+ /tools/3: {"slug":"lurk","status":"beta"}
# machine-readable: [{"op": "add"|"remove"|"replace", "path", "old", "new"}]
jaws --json before.json after.json
# did anything that matters change? (exit 1 if so; default since 0.2)
jaws -q -i /generated_at -i '/items/*/updated_at' before.json after.json; [ $? -eq 1 ] && echo changed
# match list items by id, so reordering is not a change
curl -s https://crocbot.net/api/v1/tools.json | jaws --json -k slug -i /generated_at saved.json -
# an RFC 6902 patch that turns OLD into NEW
jaws --patch old.json new.json > fix.patch.json
Output rules
- Text:
+ /path: NEW,- /path: OLD,~ /path: OLD -> NEW; values are compact JSON, shortened after 200 characters unless--full. Nothing is printed when the inputs are equal. --json:addhas noold,removehas nonew. Paths are RFC 6901 pointers (~1is/,~0is~).--ignore PTRskips PTR and everything under it;*matches one segment; repeatable.--array-key FIELDapplies when every element of both arrays is an object with a unique scalar FIELD; otherwise jaws falls back to indexes. It cannot be combined with--patch.
Run jaws --help for every option.
Files for 0.2.0
| File | Kind | Target | Size | SHA-256 |
|---|---|---|---|---|
jaws-0.2.0-x86_64-unknown-linux-musl | binary | x86_64-unknown-linux-musl | 485 KiB | 9deb257c772823a87a9c04fff8be8bf51a8a712bbeea25d56bc4b41ca2f6a1ca |
jaws-0.2.0-aarch64-unknown-linux-musl | binary | aarch64-unknown-linux-musl | 398 KiB | 81517751033655456b49d04860b2ef4e0b1656010c7eb5d4f67281ccb2c33a5a |
jaws-0.2.0-x86_64-unknown-linux-musl.tar.gz | archive | x86_64-unknown-linux-musl | 249 KiB | cae8e7b9d7fc7edaf19ace785af854eedbde18b35097fe7d6737fc5955a21b66 |
jaws-0.2.0-aarch64-unknown-linux-musl.tar.gz | archive | aarch64-unknown-linux-musl | 222 KiB | 650eaa107abfb91357b5e56adda2e051d8000edae7ee6b3cc0d7eb5c9880f810 |
jaws-0.2.0-src.tar.gz | source | - | 133 KiB | 4116572f5b1defd52096052b9d36766cf8067d056f4d9085a49a650244da03f8 |
SHA256SUMS | checksums | - | 516 B | ad96b60f583202a14c48b1b35b07969c243d84276bba70492755a06944f294e3 |
SHA256SUMS.minisig | signature | - | 317 B | 17a01878fb7028880897eba75c20387ae75d810814df219fde84e4f139606347 |
Releases and news
- · jaws 0.1.1
- · jaws 0.1.0