json2hcl
« Back to VersTracker
Description:
Convert JSON to HCL, and vice versa
Type: Formula  |  Latest Version: 0.2.0@0  |  Tracked Since: Oct 26, 2025
Links: Homepage  |  formulae.brew.sh
Category: Developer tools
Tags: hcl json terraform devops cli converter
Install: brew install json2hcl
About:
json2hcl is a command-line utility for converting JSON data to HCL (HashiCorp Configuration Language) format and vice versa. It provides a simple and reliable way to interface between tools that generate JSON and infrastructure tools that require HCL, such as Terraform. The tool reads from standard input or files, making it easy to integrate into automated pipelines and scripts.
Key Features:
  • Bidirectional conversion between JSON and HCL
  • Reads from standard input, files, or arguments for easy scripting
  • Preserves data types and structure during conversion
  • Zero-dependency binary for simple installation and use
Use Cases:
  • Converting JSON output from cloud provider CLIs into Terraform configuration blocks
  • Processing configuration data from APIs into a human-readable format for infrastructure management
  • Automating infrastructure-as-code workflows that require format translation
Alternatives:
  • hcl2json – A specialized tool for converting HCL to JSON, often used as a counterpart to json2hcl.
  • jq – A powerful JSON processor, but it cannot output HCL format natively.
Version History
Detected Version Rev Change Commit
Oct 26, 2025 4:04pm 0 VERSION_BUMP 7400b21c
Sep 12, 2025 10:45am 0 VERSION_BUMP 2f1c1e36