{"id":18440241,"url":"https://github.com/drowzy/hxl","last_synced_at":"2025-04-07T21:33:05.174Z","repository":{"id":57506043,"uuid":"396428795","full_name":"drowzy/hxl","owner":"drowzy","description":"An Elixir implementation of HCL.","archived":false,"fork":false,"pushed_at":"2024-05-12T20:44:34.000Z","size":143,"stargazers_count":33,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T01:05:50.457Z","etag":null,"topics":["elixir","hcl"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drowzy.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-15T17:13:42.000Z","updated_at":"2025-01-29T04:10:35.000Z","dependencies_parsed_at":"2024-05-12T21:46:15.346Z","dependency_job_id":null,"html_url":"https://github.com/drowzy/hxl","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drowzy%2Fhxl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drowzy%2Fhxl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drowzy%2Fhxl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drowzy%2Fhxl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drowzy","download_url":"https://codeload.github.com/drowzy/hxl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247732794,"owners_count":20986922,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["elixir","hcl"],"created_at":"2024-11-06T06:29:11.647Z","updated_at":"2025-04-07T21:33:00.164Z","avatar_url":"https://github.com/drowzy.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HXL\n\n---\n\n![CI](https://github.com/drowzy/hxl/actions/workflows/ci.yml/badge.svg)\n[![Hex.pm Version](https://img.shields.io/hexpm/v/hxl.svg?style=flat-square)](https://hex.pm/packages/hxl)\n\nAn Elixir implementation of [HCL](https://github.com/hashicorp/hcl)\n\n## Features\n\n* Decode from string or file\n* Aims to be fully compliant with the [HCL](https://github.com/hashicorp/hcl/blob/main/hclsyntax/spec.md) specification\n* Function \u0026 variables support during evaluation\n\n## Example Usage\n\n```elixir\nhcl = \"\"\"\nresource \"upcloud_server\" \"server1\" {\n  hostname = \"terraform.example.com\"\n\n  zone = \"nl-ams1\"\n\n  plan = \"1xCPU-1GB\"\n\n  template {\n    size = 25\n    storage = \"01000000-0000-4000-8000-000030200200\"\n  }\n\n  network_interface {\n    type = \"public\"\n  }\n\n  login {\n    user = \"root\"\n    keys = [\n      \"ssh-rsa public key\",\n    ]\n    create_password = true\n    password_delivery = \"email\"\n  }\n\n  connection {\n    host        = \"127.0.0.2\"\n    type        = \"ssh\"\n    user        = \"root\"\n    private_key = file(\"~/.ssh/rsa_private_key\")\n  }\n\n  provisioner \"remote-exec\" {\n    inline = [\n      \"echo 'Hello world!'\"\n    ]\n  }\n}\n\"\"\"\n\n{:ok, config_file} = HXL.decode(hcl, functions: %{\"file\" =\u003e \u0026File.read/1})\n```\n\n### From file\n\n```elixir\n{:ok, config_file} = HXL.decode_file(\"/path/to/file\")\n```\n\n### As ast\n\n```elixir\nhcl = \"\"\"\nservice \"http\" {\n  a = 1\n  b = 2\n}\n\"\"\"\n\n{:ok, %HXL.Body{}} = HXL.decode_as_ast(hcl)\n\n```\n\n## Installation\n\nAdd `hxl` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:hxl, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\n## HCL Syntax Specification\n\n### [Lexical Elements](https://github.com/hashicorp/hcl/blob/main/hclsyntax/spec.md#lexical-elements)\n\n- [x] Comments\n- [x] Identifiers\n- [x] Operators \u0026 delimiters\n- [x] Numeric literals\n\n### [Structural Language](https://github.com/hashicorp/hcl/blob/main/hclsyntax/spec.md#structural-elements)\n\n- [x] Body\n- [x] Attributes\n- [x] Blocks\n- [x] One-line blocks\n\n### [Expression language](https://github.com/hashicorp/hcl/blob/main/hclsyntax/spec.md#expressions)\n\n- [x] Expressions\n  - [x] Expr term\n    - [x] Literal Value\n    - [x] Collection Value\n    - [x] Template Expr\n    - [x] Variable Expr\n    - [x] Function Call\n    - [x] For Expr\n    - [x] ExprTerm Index\n    - [x] ExprTerm GetAttr\n    - [x] ExprTerm Splat\n    - [x] \"(\" Expression \")\"\n  - [x] Operation\n  - [x] Conditional\n\n### [Template Language](https://github.com/hashicorp/hcl/blob/main/hclsyntax/spec.md#templates)\n- [] TemplateLiteral\n- [] TemplateInterpolation\n- [] TemplateDirective\n\n### Representations\n - [x] HCL Native syntax\n - [ ] JSON\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrowzy%2Fhxl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrowzy%2Fhxl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrowzy%2Fhxl/lists"}