| Crates.io | hcl2json |
| lib.rs | hcl2json |
| version | 0.1.8 |
| created_at | 2025-06-28 22:23:57.158034+00 |
| updated_at | 2025-07-11 23:57:19.03452+00 |
| description | CLI program for converting HCL to JSON |
| homepage | |
| repository | https://github.com/martinohmann/hcl-rs |
| max_upload_size | |
| id | 1730166 |
| size | 86,629 |
CLI program for converting HCL to JSON.
cargo install hcl2json
stdincat file.hcl | hcl2json
hcl2json file.hcl other-file.tf
Note: When converting multiple files or directories hcl2json emits a JSON
array. By passing --file-paths/-P the behaviour can be changed to produce a
JSON map keyed by input file path.
hcl2json --glob '**/*.tf' dir/
Note: The command above is equivalent to hcl2json dir/**/*.tf but may
have slightly better performance when there are hundreds of matching files.
Simplify HCL expressions where possible and emit pretty-printed JSON:
hcl2json --simplify --pretty file.hcl
Contributions are welcome! Please read
CONTRIBUTING.md
before creating a PR.
The source code of hcl2json is licensed under either of Apache License, Version 2.0 or MIT license at your option.