Colorized JSON diff for terminal — compare two JSON files and see differences highlighted in red/green.
终端彩色 JSON 对比工具——比较两个 JSON 文件,差异以红绿色高亮显示。
$ json-diff old.json new.json
- debug: true
+ debug: false
+ features: ["ai"]
- name: "old_project"
+ name: "new_project"
- version: "1.0"
+ version: "2.0"
7 difference(s) found.| Feature | Description |
|---|---|
| 🔍 Recursive diff | Handles nested objects and arrays |
| 🎨 Color output | Green for additions, red for removals |
| 📍 Path notation | Shows exact location (e.g., data.users[0].name) |
| ⚡ Zero dependencies | Pure Python standard library |
# Compare two JSON files
json-diff file1.json file2.json
# Or run directly
python main.py file1.json file2.jsonpip install json-diff-cli-lizer
json-diff old.json new.json| Flag | Description |
|---|---|
--color |
Enable color output (default) |
--no-color |
Disable color output |
json-diff api_v1.json api_v2.jsonjson-diff config.dev.json config.prod.jsonif json-diff old.json new.json --no-color | grep -q "difference"; then
echo "Configs changed!"
fi- Python 3.9+ — Zero external dependencies
- json — Standard library JSON parser
- argparse — Standard library CLI parser
Made with ❤️ by Lizer | Powered by Hermes Agent