Turn messy key-value text into a clean .env file — from the command line or your JetBrains IDE.
You paste this:
API_KEY
a1b2c3d4e5f6g7h8i9j0
DATABASE_URL
postgres://user:password@localhost:5432/db
You get this:
API_KEY=a1b2c3d4e5f6g7h8i9j0
DATABASE_URL="postgres://user:password@localhost:5432/db"Keys are sorted, values that need quotes get quoted, and your existing .env is
backed up before anything is written.
npm install -g @webbies.dev/dotenvify
# or run it once, without installing:
npx @webbies.dev/dotenvify vars.txt -o .envdotenvify <source> [options]<source> is the file you want to convert.
| Option | Short | What it does |
|---|---|---|
--output <file> |
-o |
Where to write (default: .env) |
--export |
-e |
Add an export prefix to every line |
--overwrite |
-f |
Overwrite without making a backup |
--preserve <vars> |
-k |
Keep current values for these keys (comma-separated) |
--skip-sort |
Keep the original order instead of sorting | |
--skip-lower |
Drop keys that are entirely lowercase | |
--url-only |
Keep only values that are HTTP/HTTPS URLs |
You can mix any of these in one file — Dotenvify figures out each line. Lines
starting with # are left alone.
API_KEY=a1b2c3d4e5f6g7h8i9j0 # already KEY=VALUE
SECRET="my secret value" # quoted
export NODE_ENV=production # export prefix (removed)
REDIS_HOST localhost # separated by a space
DATABASE_URL # key on one line,
postgres://user:pass@localhost/db # value on the nextDo the same thing inside IntelliJ, WebStorm, PyCharm, GoLand, Rider, and other JetBrains IDEs — plus a couple of extras. Install it from the Marketplace.
- Convert — paste or convert a file/selection to
.envwith a live preview. - Azure DevOps — sign in with the Azure CLI (
az login), pick a variable group, and pull its variables into a.envfile. Secret values stay in Azure. Needs the Azure CLI. - Diagnostics — find keys your code uses but the
.envis missing, and keys in the.envthat nothing uses.
Building from source, the repo layout, and how releases work are in CONTRIBUTING.md.
MIT — see LICENSE.