EnvifyThe Support Further DevelopmentFeaturesConvert
|
| Command | Description |
|---|---|
Envify: Convert .env to JSON |
Replace current content with JSON |
Envify: Convert JSON to .env |
Replace current content with .env |
Envify: Convert .env to JSON (New File) |
Open JSON result in a new tab |
Envify: Convert JSON to .env (New File) |
Open .env result in a new tab |
Envify: Convert .env to… |
Pick YAML, shell, docker-compose, Kubernetes ConfigMap / Secret or .env.example |
Envify: Copy .env as JSON |
Copy the JSON result to the clipboard |
Envify: Copy JSON as .env |
Copy the .env result to the clipboard |
Envify: Generate .env.example |
Write .env.example next to the current .env |
Envify: Compare with .env.example |
Report missing / empty / extra keys |
Envify: Compare .env Files… |
Diff two env files key by key (e.g. .env.local vs .env.production) |
Envify: Format .env Document |
Clean up the current .env file |
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Ctrl+Shift+J / Cmd+Shift+J |
Convert .env → JSON |
Ctrl+Alt+E / Cmd+Alt+E |
Convert JSON → .env |
Shift+Alt+F / Shift+Option+F |
Format .env document |
Right-Click Menu
Right-click in the editor and open the Envify submenu for every command. In the Explorer, right-click a .env file for Generate .env.example, Compare with .env.example and Compare .env Files… — select two files first to compare them directly.
Examples
.env → JSON
# Database
DATABASE_URL=postgres://localhost:5432/mydb
export API_KEY=sk-1234567890 # inline comments are dropped
DEBUG=true
APP_NAME="My App"
PRIVATE_KEY="-----BEGIN KEY-----
abc
-----END KEY-----"
{
"DATABASE_URL": "postgres://localhost:5432/mydb",
"API_KEY": "sk-1234567890",
"DEBUG": "true",
"APP_NAME": "My App",
"PRIVATE_KEY": "-----BEGIN KEY-----\nabc\n-----END KEY-----"
}
With envify.json.inferTypes on, DEBUG becomes true (a boolean) and PORT=3000 becomes 3000. Quoted values always stay strings.
Nested keys
With envify.nestedSeparator set to __:
DB__HOST=localhost
DB__PORT=5432
{ "DB": { "HOST": "localhost", "PORT": "5432" } }
Converting nested JSON back to .env flattens it the same way. With the separator left empty, nested objects are stringified: CONFIG='{"a":1}'.
Variable expansion
With envify.expandVariables on:
HOST=db
URL=postgres://${HOST}:5432
FALLBACK=${MISSING:-default}
LITERAL='${HOST}'
{ "HOST": "db", "URL": "postgres://db:5432", "FALLBACK": "default", "LITERAL": "${HOST}" }
Supports ${VAR}, $VAR, ${VAR:-default}, ${VAR-default} and \$ for a literal dollar. Single-quoted values are never expanded. Only keys in the same file are used — the process environment is not consulted.
Other targets
Envify: Convert .env to… opens the result in a new tab:
# docker-compose
environment:
DATABASE_URL: postgres://localhost:5432/mydb
DEBUG: "true"
# Kubernetes Secret
apiVersion: v1
kind: Secret
metadata:
name: app-secret
type: Opaque
data:
DATABASE_URL: cG9zdGdyZXM6Ly9sb2NhbGhvc3Q6NTQzMi9teWRi
# Shell
export DATABASE_URL='postgres://localhost:5432/mydb'
Compare .env files
Envify: Compare .env Files… lists the other .env* files in the same folder (or lets you browse), then opens a diff where both sides are normalised:
# .env.local # .env.production
API_URL=http://localhost:3000 API_URL=https://api.example.com
DEBUG=true
SENTRY_DSN="" SENTRY_DSN=https://abc@sentry.io/1
Comments, export, ordering and quoting style are ignored. The diff updates while you edit either file.
.env.example
# Database
DATABASE_URL=
export API_KEY= # inline comments are dropped
DEBUG=
APP_NAME=
PRIVATE_KEY=
Settings
| Setting | Default | Description |
|---|---|---|
envify.json.indent |
2 |
Indent size for JSON output |
envify.json.inferTypes |
false |
Turn unquoted true/false/null/numbers into JSON types |
envify.json.sortKeys |
false |
Sort keys when converting to JSON |
envify.env.quoteStyle |
auto |
auto quotes only when needed, always quotes every value |
envify.env.sortKeys |
false |
Sort keys when converting to .env |
envify.nestedSeparator |
"" |
Separator for nested keys, e.g. __ |
envify.expandVariables |
false |
Resolve ${VAR} references during conversion |
envify.example.fileName |
.env.example |
Name of the example file |
envify.example.placeholder |
"" |
Value written after = in generated examples |
envify.diagnostics.enabled |
true |
Show problems in .env files |
envify.diagnostics.compareWithExample |
true |
Warn about keys missing from .env.example |
envify.codeLens.enabled |
true |
Show the "keys missing from .env.example | Add" code lens |
envify.showNotifications |
true |
Show a toast after each conversion |
Parsing rules
- Blank lines and
#comments are skipped;export KEY=valueis accepted - Unquoted values end at
#(a#preceded by whitespace), soCOLOR=#ff0000keeps its value - Double-quoted values resolve
\n,\r,\t,\"and\\; single-quoted values are literal - Quoted values may span multiple lines
- When a key is defined twice, the last value wins (and a warning is shown)
- Keys must match
[A-Za-z_][A-Za-z0-9_]*; other lines are reported and skipped
Privacy & Security
Envify works 100% offline. Your .env secrets never leave your machine.
- No network requests — no data is sent to any server
- No telemetry or analytics
- No file writes except
.env.examplewhen you ask for it - Besides the open editor, the only files read are the sibling
.env.exampleand the files you pick in Compare .env Files (which lists the.env*file names in the same folder to offer them) - Zero runtime dependencies — no third-party code runs behind the scenes
- Source code is open and auditable on GitHub
License
MIT