go install github.com/BaseMax/go-config-diff/cmd/go-config-diff@latest# Compare two config files
go-config-diff config1.yaml config2.yaml
# Use different output format
go-config-diff -format=json config1.json config2.json
go-config-diff -format=plain config1.toml config2.toml
# Show summary of changes
go-config-diff -summary config1.ini config2.ini
# Show version
go-config-diff -version
# Show help
go-config-diff -help+Green: Added field or value-Red: Removed field or value~Yellow: Modified field or value
0: No differences found1: Differences found or error occurred
- YAML (
.yaml,.yml) - JSON (
.json) - TOML (
.toml) - INI (
.ini,.conf)
# Exit with error if configs differ
go-config-diff prod-config.yaml staging-config.yaml# Output JSON for further processing
go-config-diff -format=json old.json new.json > diff-report.json# Colored output with summary
go-config-diff -summary app-v1.yaml app-v2.yaml✅ Semantic comparison (not line-by-line)
✅ Ignores key ordering in objects/maps
✅ Deep nested structure comparison
✅ Type-aware comparison
✅ Multiple output formats
✅ Colored terminal output
✅ Path tracking for changes
✅ Summary statistics
# Even different formats are compared semantically
go-config-diff config.yaml config.json# Compare config between branches
git show main:config.yaml > /tmp/old.yaml
git show feature:config.yaml > /tmp/new.yaml
go-config-diff /tmp/old.yaml /tmp/new.yaml# Use in scripts
if go-config-diff base.yaml custom.yaml; then
echo "Configs are identical"
else
echo "Configs differ"
figit clone https://github.com/BaseMax/go-config-diff.git
cd go-config-diff
make build
./go-config-diff -version# Run tests
make test
# Build binary
make build
# Run with examples
make run
# Clean artifacts
make clean