You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add major enhancements - HCL support, colored output, shell completion, Docker, and config files
This commit adds several significant enhancements to configdiff:
## New Features
### HCL Format Support
- Add full HCL parsing support using hashicorp/hcl/v2
- Support for Terraform .tf and .tfvars files
- Recursive conversion of cty.Value types to normalized tree
- Test coverage with simple and complex HCL examples
### Colored Output
- Add color-coded report output using fatih/color
- Green for additions, red for removals, yellow for modifications
- Respects NO_COLOR environment variable
- Disable with --no-color flag
### Shell Completion
- Add completion command for bash, zsh, fish, and powershell
- Includes installation instructions for each shell
- Uses Cobra's built-in completion generation
### Docker Support
- Add Dockerfile based on Alpine Linux
- Configure GoReleaser for multi-arch Docker builds (amd64, arm64)
- Publish to ghcr.io/pfrederiksen/configdiff
- Docker manifests for platform-agnostic pulls
### Configuration File Support
- Add .configdiffrc and .configdiff.yaml support
- Configure default options: ignore paths, array keys, output format, etc.
- Multiple location support: current dir and home dir
- CLI flags override config file settings
- Merge behavior for arrays and maps
## Documentation
- Update README with all new features
- Add HCL examples and use cases
- Document configuration file format and locations
- Add Docker installation and usage instructions
- Add shell completion setup instructions
- Update project status to reflect completed features
## Tests
- Add comprehensive tests for config package
- Add HCL parsing tests
- Update report tests for color support
- All tests passing with >80% coverage
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Handle type coercions (e.g., `"1"` vs `1`, `"true"` vs `true`)
13
13
- Generate both machine-readable patches and human-friendly reports
14
+
- Colorized output for better readability
15
+
- Configuration file support for project defaults
14
16
15
-
Perfect for GitOps reviews, CI checks, configuration drift detection, and any scenario where you need to understand what actually changed in your config files.
17
+
Perfect for GitOps reviews, CI checks, configuration drift detection, Terraform/HCL comparisons, and any scenario where you need to understand what actually changed in your config files.
16
18
17
19
## Installation
18
20
@@ -22,10 +24,35 @@ Perfect for GitOps reviews, CI checks, configuration drift detection, and any sc
-**report** (default): Detailed human-friendly report with values
169
+
-**report** (default): Detailed human-friendly report with values, colorized for better readability
142
170
-**compact**: Summary with paths only
143
171
-**json**: JSON-serialized changes array
144
172
-**patch**: JSON Patch (RFC 6902) format
145
173
174
+
**Color Output**: The report format includes color-coded output by default:
175
+
- Green for additions
176
+
- Red for removals
177
+
- Yellow for modifications
178
+
- Cyan for moves
179
+
180
+
Disable with `--no-color` or `NO_COLOR=1` environment variable.
181
+
182
+
### Configuration File
183
+
184
+
Create a `.configdiffrc` or `.configdiff.yaml` file in your project or home directory to set default options:
185
+
186
+
```yaml
187
+
# .configdiffrc
188
+
ignore_paths:
189
+
- /metadata/generation
190
+
- /metadata/creationTimestamp
191
+
- /status/*
192
+
193
+
array_keys:
194
+
/spec/containers: name
195
+
/spec/volumes: name
196
+
197
+
numeric_strings: false
198
+
bool_strings: false
199
+
stable_order: true
200
+
output_format: report
201
+
max_value_length: 100
202
+
no_color: false
203
+
```
204
+
205
+
**Configuration file locations** (checked in order):
206
+
1. `./.configdiffrc` (current directory)
207
+
2. `./.configdiff.yaml` (current directory)
208
+
3. `~/.configdiffrc` (home directory)
209
+
4. `~/.configdiff.yaml` (home directory)
210
+
211
+
CLI flags always override configuration file settings. For arrays and maps (like `ignore_paths` and `array_keys`), CLI flags are merged with config file values.
212
+
146
213
### Exit Codes
147
214
148
215
- `0`: Success (no differences, or differences displayed)
0 commit comments