talira

The HashiCorp configuration language

open sourceMPL-2.0free

HCL (HashiCorp Configuration Language) is a toolkit for building structured configuration languages that people and machines can both read and write, aimed mainly at devops tools and servers. It has a native syntax of attributes and nested blocks, inspired by libucl and nginx configuration, plus a JSON-based variant for machine-generated files, and an expression syntax for inline computation; the application that embeds it defines the expected structure and the variables and functions available. It's the language of Terraform and OpenTofu files, among other HashiCorp tools. This listing covers the specification and its Go implementation (github.com/hashicorp/hcl/v2, HCL 2, whose Go API is incompatible with version 1). MPL-2.0 licensed.

Libraries for HCL

Talira doesn't list any yet.

Problems it solves

  • a human-friendly config file format for my command-line tool or server
  • parse structured config with blocks and expressions in my Go program
  • which config language should my devops tool use instead of YAML
  • generate or edit Terraform-style configuration files programmatically

Features

  • native syntax of attributes and nested blocks
  • JSON-based variant for machine-generated configuration
  • expression syntax with application-provided variables and functions
  • application-defined schemas with clear error messages
  • Go API from a simple decoder (hclsimple) down to low-level parsing
  • hclwrite for generating and editing HCL files
  • a written specification

Capabilities

Has official SDKsplan not known

Alternatives

The same job

These do what HCL does.

  1. Pkl A configuration-as-code language with rich validation and tooling
  2. CUE Validate, define, and use dynamic and text-based data
  3. Jsonnet A configuration language for app and tool developers
  4. KCL An open-source constraint-based record and functional language for configuration and policy
  5. Starlark A Python dialect designed as a configuration language, made for Bazel
  6. Nickel Better configuration for less

Compare HCL with the top 3