A command-line tool for converting JSON to HashiCorp Configuration Language (HCL) and vice versa.
json2hcl is a command-line utility that converts JSON to HashiCorp Configuration Language (HCL) and HCL to JSON. It solves the problem of transitioning between machine-readable JSON configurations and human-friendly HCL formats, particularly useful for infrastructure-as-code workflows. The tool simplifies maintaining and editing configurations by providing bidirectional conversion capabilities.
Developers and DevOps engineers working with HashiCorp tools like Terraform who need to convert or maintain configurations in both JSON and HCL formats.
It offers a straightforward, scriptable solution for format conversion without requiring custom parsing logic, leveraging HashiCorp's own libraries for reliable transformations. The tool fills a gap where native conversion utilities from HashiCorp were not available.
Convert JSON to HCL, and vice versa. We don't use json2hcl anymore ourselves, so we can't invest time into it. However, we're still welcoming PRs.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Operates via STDIN/STDOUT, making it easy to integrate into scripts and automation pipelines, as shown in the usage examples with commands like 'json2hcl < input.json > output.hcl'.
Leverages HashiCorp's own HCL libraries to perform conversions, ensuring accuracy and compatibility with HCL syntax without requiring custom parsing logic.
Supports both JSON to HCL and HCL to JSON conversion with the -reverse flag, providing flexibility for different workflow needs, such as debugging or integration.
Offers pre-built executables for Linux and macOS, facilitating quick setup without the need for Go compilation, as detailed in the installation instructions.
The project is explicitly marked as deprecated by the original author, with no updates since 2016, making it risky for long-term or new projects.
Error handling was added in v0.0.4, but as a simple tool, it may not provide detailed diagnostics for complex conversion failures or edge cases.
Likely only supports older HCL versions, as HashiCorp may have introduced HCL2 or other changes post-2016, which this tool does not address, limiting its applicability.