Fork of https://github.com/tmccombs/hcl2json that simply splits the project into library and cmd.
This is a tool to convert from HCL to json, to make it easier for non-go applications and scripts to process HCL inputs (such as terraform config).
It converts the provide native HCL file to an (almost) equivalent HCL JSON file. Note, however, that there are some corner cases where it may not be exactly equivalent, especially if the target application makes use of static analysis.
go get github.com/abiosoft/hcl2json/cmd/hcl2json@master
Usage:
-indent int
number of spaces to indent with (default 2)
-input string
input HCL file. If missing, reads from stdin
-output string
output JSON file. If missing, writes to stdout