# Install json2hcl with Homebrew, Nix

Convert JSON to HCL, and vice versa. Version 0.2.0 via Homebrew; verified 2026-05-19.

## Install

```sh
sudo av install brew:json2hcl
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install json2hcl
```

  Evidence: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#json2hcl
```

  Evidence: nixpkgs package indexes: pkgs/by-name/js/json2hcl/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## Package facts

- **Package key:** brew:json2hcl
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/json2hcl>
- **Version:** 0.2.0
- **Source summary:** Convert JSON to HCL, and vice versa
- **Homepage:** <https://github.com/kvz/json2hcl>
- **Repository:** <https://github.com/kvz/json2hcl>
- **Upstream docs:** <https://github.com/kvz/json2hcl#readme>
- **License:** MIT
- **Source archive:** <https://github.com/kvz/json2hcl/archive/refs/tags/v0.2.0.tar.gz>
- **Last updated:** 2026-05-19T07:48:50-04:00
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- json2hcl (cli)
- json2hcl (alias)

## Build dependencies

- go

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, sonoma, ventura, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 0.2.0
- Package-manager updated: 2026-05-19
- Local data: ok
- Upstream repository: https://github.com/kvz/json2hcl
- Upstream latest detected: v0.2.0 (current)
## Project history and usage

json2hcl is a small Go command-line converter for moving data between JSON and HashiCorp Configuration Language. Its niche is the Terraform-era need to translate machine-friendly JSON into a more readable HCL form without building a larger configuration system.

### Project history

Kevin van Zonneveld published json2hcl in September 2016 around a workflow for an internal tool named Frey. The README says the authors wanted to store infrastructure recipes as HCL after converting from machine-readable JSON, YAML, or TOML, and it explicitly notes that the tool used existing HashiCorp libraries rather than inventing a parser.

The project soon added reverse conversion with the `-reverse` flag, exposing hcl2json behavior through the same executable. By June 25, 2025, the GitHub repository was archived; its README states that the original author no longer used it, while leaving the code available for forks.

### Adoption history

Adoption appears to have been modest but durable in package-manager terms: the tool was packaged by Homebrew and Nix, and the repository accumulated hundreds of stars and forks before archival. Its presence in Homebrew reflects the small-CLI pattern where a narrow converter remains useful even after upstream development slows.

### How it is used

The canonical usage is Unix-pipeline oriented: feed JSON on standard input and receive HCL on standard output, or pass `-reverse` to convert HCL back to JSON. The README examples focus on Terraform-like `.tf.json` input and redirection to `.tf` files.

### Why package nerds care

json2hcl is interesting because it captures a short period when HCL was becoming a preferred human-edited configuration language around HashiCorp tools, while JSON remained the common interchange format. For package collectors, it is a tiny bridge utility whose package-manager value is convenience rather than ecosystem size.

### Timeline

- 2016-09-05: The GitHub repository was created.
- 2016-09-05: v0.0.4 changelog entry covered error handling and release cross-compilation.
- 2016-09-06: v0.0.5 added reverse HCL-to-JSON conversion through `-reverse`.
- 2024-09-05: GitHub listed v0.2.0 among repository releases.
- 2025-06-25: The repository was archived by its owner.

### Related projects

- json2hcl is directly tied to HashiCorp HCL and Terraform-style JSON configuration. It also sits near other one-purpose data converters such as hcl2json, JSON-to-YAML tools, and Unix filters used in infrastructure repositories.

### Sources

- <https://api.github.com/repos/kvz/json2hcl>
- <https://formulae.brew.sh/formula/json2hcl>
- <https://github.com/kvz/json2hcl>
- <https://github.com/kvz/json2hcl/releases>


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** json2hcl
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** yes
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- Nix - json2hcl: normalized package name match | nixpkgs package indexes: pkgs/by-name/js/json2hcl/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [go](https://www.automicvault.com/pkg/brew/go/) - Build dependency declared by Homebrew.
- [config-file-validator](https://www.automicvault.com/pkg/brew/config-file-validator/) - Shares av.db curated category or tags: cli, configuration, developer-tools, json.
- [dhall-json](https://www.automicvault.com/pkg/brew/dhall-json/) - Shares av.db curated category or tags: cli, configuration, developer-tools, json.
- [hcl2json](https://www.automicvault.com/pkg/brew/hcl2json/) - Shares av.db curated category or tags: cli, configuration, developer-tools, hcl, json.
- [hcledit](https://www.automicvault.com/pkg/brew/hcledit/) - Shares av.db curated category or tags: cli, configuration, developer-tools, hcl.
- [json2tsv](https://www.automicvault.com/pkg/brew/json2tsv/) - Shares av.db curated category or tags: cli, converter, developer-tools, json.
- [butane](https://www.automicvault.com/pkg/brew/butane/) - Shares av.db curated category or tags: cli, configuration, developer-tools.
- [dhall-bash](https://www.automicvault.com/pkg/brew/dhall-bash/) - Shares av.db curated category or tags: cli, configuration, developer-tools.
- [dynaconf](https://www.automicvault.com/pkg/brew/dynaconf/) - Shares av.db curated category or tags: cli, configuration, developer-tools.

## Combined YAML source

View the package source record on GitHub. [combined/json2hcl.yml](https://github.com/automic-vault/db/blob/main/combined/json2hcl.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
