Skip to content

HCL

python-hcl2

  • GitHub
  • AUR package: python-hcl2
  • Python lib only, no cli tool

hcl2json

  • GitHub
  • Recent releases
  • No arch/AUR package
  • Not able to get final values like from join() function

Install:

eget tmccombs/hcl2json
hcl2json < ~/projects/data-serialization/hcl/longlines.hcl | jq '.test'

hcledit

  • GitHub
  • AUR package: hcledit
  • Not able to get final values like from join() function

Usage:

hcledit block list -f main.tofu
hcledit block get terraform -f main.tofu
hcledit attribute get terraform.required_version -f main.tofu

hcldec

  • GitHub
  • Converts HCL to JSON
  • Needs a .hclspec spec file

Install:

go install github.com/hashicorp/hcl/v2/cmd/hcldec@latest

Other tools

Stale

  • pyhcl
    • Does not support HCL2 (which Terraform or Opentofu use)
    • Last commit 2023
    • AUR package: python-pyhcl