Convert ENV to HCL
Turn ENV files into HCL. Each KEY=value line becomes a key in file order; export prefixes, quotes, escapes and trailing comments are handled, and unquoted numbers and booleans are typed.
Converted in an isolated sandbox on our serversDeleted after 24 hours
Drop ENV files on the dialor turn it to pick what to do
Dotenv lines as HCL attributes.Each KEY=value line becomes an attribute in the same order as the file.
What you get
One HCL file. Each line of the ENV file becomes a key, in file order. Export prefixes, quotes, escapes and trailing comments are handled.
Unquoted numbers and booleans are typed, so they are written as numbers and booleans, not as text.
How values are treated
A key with no value becomes null, and null stays null in the HCL. A repeated key becomes a list.
References such as ${VAR} stay as written. They are not looked up or filled in.
How the HCL is written
The output is written as HCL attributes. Keys at the top level must be identifiers. A top-level list becomes the attribute items, and nested keys are quoted.
To go the other way, use HCL to ENV.
ENV and HCL.What each format is.
The formats
Dotenv
KEY=value lines that hold environment variables for an app.
- Extensions
- .env
- MIME type
- text
/x -env - Kind
- Text and data
HCL
HashiCorp Configuration Language, what Terraform and Packer files are written in.
- Extensions
- .hcl .tf .tfvars
- MIME type
- application
/x -hcl - Kind
- Text and data
In your code.The same ENV to HCL conversion through the API, for your app or your agent.
$ cv convert report.env report.hcl$ cv convert report.env report.hclQuestions.What people ask about ENV to HCL.
Yes. Each key follows the order of the lines in the ENV file.
It becomes null, and it stays null in the HCL.
The repeated key becomes a list.
No. They stay as written.