https://github.com/abiosoft/hcl2json
HCL to JSON converter
https://github.com/abiosoft/hcl2json
Last synced: over 1 year ago
JSON representation
HCL to JSON converter
- Host: GitHub
- URL: https://github.com/abiosoft/hcl2json
- Owner: abiosoft
- License: apache-2.0
- Created: 2020-05-30T23:25:32.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-31T06:23:26.000Z (about 6 years ago)
- Last Synced: 2025-01-23T14:49:48.307Z (over 1 year ago)
- Language: Go
- Size: 11.7 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hcl2json
[](https://github.com/abiosoft/hcl2json/actions)
Fork of [https://github.com/tmccombs/hcl2json](https://github.com/tmccombs/hcl2json) that simply splits the project into library and cmd.
This is a tool to convert from [HCL](https://github.com/hashicorp/hcl2/blob/master/hcl/hclsyntax/spec.md) 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](https://github.com/hashicorp/hcl2/blob/master/hcl/hclsyntax/spec.md#static-analysis).
## Install
```
go get github.com/abiosoft/hcl2json/cmd/hcl2json@master
```
## Usage
```
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
```