Convert TOML to ENV

Turn TOML files into Dotenv. Each top-level key becomes a KEY=value line, with characters a variable name cannot hold turned into underscores, and a top-level list numbers its entries from 0 under items, so the name of the first entry becomes items_0_name.

Converted in an isolated sandbox on our serversDeleted after 24 hours

Drop TOML files on the dialor turn it to pick what to do

TOML settings as KEY=value lines.Each top-level key becomes one line in a single ENV file.

  1. What you get

    One ENV file with a KEY=value line for each top-level key. Characters that a variable name cannot hold are turned into underscores in the key.

    Text with spaces or symbols is double-quoted with escapes. A null value leaves the value empty.

  2. Lists and nested tables

    A top-level list numbers its entries from 0 under items. The name of the first entry becomes items_0_name.

    Nested objects and lists become quoted JSON text on one line.

  3. What it leaves behind

    Comments are dropped. Dates and times become ISO 8601 text.

    To go the other way, use ENV to TOML.

TOML and ENV.What each format is.

The formats

From · TOML

TOML

TOML configuration files, the format of Cargo and pyproject.

Extensions
.toml
MIME type
application/toml
Kind
Text and data
To · ENV

Dotenv

KEY=value lines that hold environment variables for an app.

Extensions
.env
MIME type
text/x-env
Kind
Text and data

In your code.The same TOML to ENV conversion through the API, for your app or your agent.

terminal
$ cv convert report.toml report.env
$ cv convert report.toml report.env

Questions.What people ask about TOML to ENV.

01OF 04

Each top-level key becomes a KEY. Characters a variable name cannot hold are turned into underscores.

Nested objects and lists become quoted JSON text as the value of the line.

No. Comments in the TOML file are dropped.

It stops with input_corrupted when the TOML file could not be parsed.

More conversions.Other ways in and out of TOML and ENV.