Convert HCL to JSONL
Turn HCL files into JSONL. Each entry of a top-level list becomes one line of compact JSON, and any other value becomes a single line, with values and key order kept.
Converted in an isolated sandbox on our serversDeleted after 24 hours
Drop HCL files on the dialor turn it to pick what to do
HCL as lines of JSON.A top-level list becomes one JSON object per line. Any other value becomes a single line.
What you get
One JSONL file. If the HCL holds a top-level list, each entry of the list becomes one line of compact JSON. If it holds any other value, the whole value is written as a single line.
Values and key order are kept as they are in the HCL.
How blocks and expressions appear
Blocks nest by type and label, so a block's type and its labels become levels in the JSON, with the block's contents inside them.
Expressions become text in the form ${...}. They are written into the JSON as that text.
Going the other way
To turn JSON Lines back into HCL, use JSONL to HCL. The same page group also lists every HCL conversion.
HCL and JSONL.What each format is.
The formats
HCL
HashiCorp Configuration Language, what Terraform and Packer files are written in.
- Extensions
- .hcl .tf .tfvars
- MIME type
- application
/x -hcl - Kind
- Text and data
JSON Lines
JSON Lines, one JSON object per line, the format of logs and datasets.
- Extensions
- .jsonl .ndjson
- MIME type
- application
/jsonl - Kind
- Text and data
In your code.The same HCL to JSONL conversion through the API, for your app or your agent.
$ cv convert report.hcl report.jsonl$ cv convert report.hcl report.jsonlQuestions.What people ask about HCL to JSONL.
One file. It holds every line of JSON from the conversion.
Each entry of a top-level list becomes one line of compact JSON.
The value becomes a single line of JSON.
They become ${...} text in the JSON.