{"id":37087578,"url":"https://github.com/kylemcc/hcl","last_synced_at":"2026-01-14T10:46:46.270Z","repository":{"id":57603433,"uuid":"95138537","full_name":"kylemcc/hcl","owner":"kylemcc","description":"HCL is the HashiCorp configuration language.","archived":false,"fork":true,"pushed_at":"2017-06-10T02:30:28.000Z","size":571,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T03:54:10.938Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"hashicorp/hcl","license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kylemcc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-22T17:09:07.000Z","updated_at":"2021-11-01T19:26:54.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/kylemcc/hcl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kylemcc/hcl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylemcc%2Fhcl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylemcc%2Fhcl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylemcc%2Fhcl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylemcc%2Fhcl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kylemcc","download_url":"https://codeload.github.com/kylemcc/hcl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylemcc%2Fhcl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28417716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:25:19.714Z","status":"ssl_error","status_checked_at":"2026-01-14T10:22:49.371Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T10:46:45.733Z","updated_at":"2026-01-14T10:46:46.262Z","avatar_url":"https://github.com/kylemcc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HCL\n\n[![GoDoc](https://godoc.org/github.com/hashicorp/hcl?status.png)](https://godoc.org/github.com/hashicorp/hcl) [![Build Status](https://travis-ci.org/hashicorp/hcl.svg?branch=master)](https://travis-ci.org/hashicorp/hcl)\n\nHCL (HashiCorp Configuration Language) is a configuration language built\nby HashiCorp. The goal of HCL is to build a structured configuration language\nthat is both human and machine friendly for use with command-line tools, but\nspecifically targeted towards DevOps tools, servers, etc.\n\nHCL is also fully JSON compatible. That is, JSON can be used as completely\nvalid input to a system expecting HCL. This helps makes systems\ninteroperable with other systems.\n\nHCL is heavily inspired by\n[libucl](https://github.com/vstakhov/libucl),\nnginx configuration, and others similar.\n\n## Why?\n\nA common question when viewing HCL is to ask the question: why not\nJSON, YAML, etc.?\n\nPrior to HCL, the tools we built at [HashiCorp](http://www.hashicorp.com)\nused a variety of configuration languages from full programming languages\nsuch as Ruby to complete data structure languages such as JSON. What we\nlearned is that some people wanted human-friendly configuration languages\nand some people wanted machine-friendly languages.\n\nJSON fits a nice balance in this, but is fairly verbose and most\nimportantly doesn't support comments. With YAML, we found that beginners\nhad a really hard time determining what the actual structure was, and\nended up guessing more often than not whether to use a hyphen, colon, etc.\nin order to represent some configuration key.\n\nFull programming languages such as Ruby enable complex behavior\na configuration language shouldn't usually allow, and also forces\npeople to learn some set of Ruby.\n\nBecause of this, we decided to create our own configuration language\nthat is JSON-compatible. Our configuration language (HCL) is designed\nto be written and modified by humans. The API for HCL allows JSON\nas an input so that it is also machine-friendly (machines can generate\nJSON instead of trying to generate HCL).\n\nOur goal with HCL is not to alienate other configuration languages.\nIt is instead to provide HCL as a specialized language for our tools,\nand JSON as the interoperability layer.\n\n## Syntax\n\nFor a complete grammar, please see the parser itself. A high-level overview\nof the syntax and grammar is listed here.\n\n  * Single line comments start with `#` or `//`\n\n  * Multi-line comments are wrapped in `/*` and `*/`. Nested block comments\n    are not allowed. A multi-line comment (also known as a block comment)\n    terminates at the first `*/` found.\n\n  * Values are assigned with the syntax `key = value` (whitespace doesn't\n    matter). The value can be any primitive: a string, number, boolean,\n    object, or list.\n\n  * Strings are double-quoted and can contain any UTF-8 characters.\n    Example: `\"Hello, World\"`\n\n  * Multi-line strings start with `\u003c\u003cEOF` at the end of a line, and end\n    with `EOF` on its own line ([here documents](https://en.wikipedia.org/wiki/Here_document)).\n    Any text may be used in place of `EOF`. Example:\n```\n\u003c\u003cFOO\nhello\nworld\nFOO\n```\n\n  * Numbers are assumed to be base 10. If you prefix a number with 0x,\n    it is treated as a hexadecimal. If it is prefixed with 0, it is\n    treated as an octal. Numbers can be in scientific notation: \"1e10\".\n\n  * Boolean values: `true`, `false`\n\n  * Arrays can be made by wrapping it in `[]`. Example:\n    `[\"foo\", \"bar\", 42]`. Arrays can contain primitives,\n    other arrays, and objects. As an alternative, lists\n    of objects can be created with repeated blocks, using\n    this structure:\n\n    ```hcl\n    service {\n        key = \"value\"\n    }\n\n    service {\n        key = \"value\"\n    }\n    ```\n\nObjects and nested objects are created using the structure shown below:\n\n```\nvariable \"ami\" {\n    description = \"the AMI to use\"\n}\n```\nThis would be equivalent to the following json:\n``` json\n{\n  \"variable\": {\n      \"ami\": {\n          \"description\": \"the AMI to use\"\n        }\n    }\n}\n```\n\n## Thanks\n\nThanks to:\n\n  * [@vstakhov](https://github.com/vstakhov) - The original libucl parser\n    and syntax that HCL was based off of.\n\n  * [@fatih](https://github.com/fatih) - The rewritten HCL parser\n    in pure Go (no goyacc) and support for a printer.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylemcc%2Fhcl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkylemcc%2Fhcl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylemcc%2Fhcl/lists"}