Envy — Visual .env Editor
A visual editor for .env files that understands what is inside the values: JSON objects and arrays, lists, numbers, booleans and 0/1 flags, and shows the comments that document them.
The file stays plain text. Every change is a small edit to the original lines, so quotes, spacing, comments and blank lines are kept, git diffs stay minimal, and VS Code's undo, redo and save work as usual.


Features
Readable overview
- Every entry is shown as
KEY = value on one line, with its comments underneath. Long values fade out at the end; hovering shows the full value.
- Banner comments such as
# ---- Database ---- become collapsible group headings.
- Each value gets a type label: string, number, boolean, 0/1, list, URL, connection, JSON object, JSON array, invalid JSON.
- Search filters keys, values and comments and highlights the matches. Results stay under their group headings, and searching for a group name shows the whole group.
- The toolbar stays at the top: search, sort, go to group, mask, open as text and add entry. A small floating toolbar at the bottom has undo and redo; Ctrl+Z, Ctrl+Y and Ctrl+S work as usual.

Editing by type
Click an entry to edit it. The entry opens above a dimmed overlay; Add comment shows the comment fields when the entry has none yet. Press Enter or click outside to apply the change, or press Escape to cancel. Click a key to rename it. Changes go into the open document like normal typing: they can be undone, and the file is written only when you save.

| Value |
Editor |
| Text, numbers |
Text field |
true / false, 0 / 1 |
Checkbox (writes back the same form) |
| Comma-separated list, JSON array of plain values |
Chips: add, remove, double-click to edit |
| URL, connection string |
Fields: user, password, host, port, ... |
| Object of objects (e.g. per-region settings), array of objects |
Grid with checkboxes and text fields |
| Any JSON |
Tree view, or formatted raw JSON |
| Invalid JSON |
Raw text with a warning |
JSON edits change only the edited part of the value, and single-line JSON stays on one line in the file. Repeated values in lists are allowed but marked.
For JSON values, one button cycles through the grid, tree and raw JSON views, and another opens the editor full screen for large values. In the grid, the header row and the key column stay visible while scrolling. The key line of the edited entry stays at the top while you scroll through its editor.
Text fields edit the value as the application reads it: quotes typed around a value become part of the value, and the editor says so. Quotes in the file are added automatically when a value needs them.
Connection strings and URLs
URLs and connection strings are edited as separate fields, and a button switches to a plain text field:
| Format |
Example |
| URL |
postgres://app:s3cr%40t@db.internal:5432/orders?sslmode=require |
Key=Value;… (ADO.NET, Azure) |
Server=tcp:sql.example.com,1433;Database=orders;Password=… |
key=value … (PostgreSQL libpq) |
host=localhost port=5432 dbname=orders password='pa ss' |
- URLs show scheme, user, password, host, port, database or path, and the query parameters. Several hosts (
mongodb://h1:27017,h2:27017/db) are edited as one field.
- Values are decoded for editing and encoded when written: a password typed as
p@ss is written as p%40ss in a URL, and a value containing ; is quoted in a Key=Value; string.
- Only the edited part changes; the rest of the value is kept as written.
- Parameters can be added and removed.
- With secret values hidden, passwords and settings such as
Password, AccountKey or SharedAccessKey are masked in the list and in the fields, even when the key name doesn't look secret.
- Values with
${VAR} or $VAR references are edited as text.
Managing entries
- Add, rename, delete, copy, and comment out / re-enable entries (
# KEY=value).
- Every entry has an Actions (
…) button at the end of its line; it opens the same menu as a right-click on the entry:
- copy the value,
KEY=value, or PowerShell $env:KEY = '…';
- for values containing
", copy them escaped for the Windows PowerShell command line ('{\"a\":1}', JSON compacted to one line);
- move the entry to another group or to a new one;
- comment it out / re-enable it, or delete it.
- When adding an entry, paste a whole
KEY=value line into the key prompt to skip typing the value separately.
- Edit the comment above an entry and the inline comment after it.
- Standalone comments are shown as notes: click one to edit it, or use its Actions (
…) button or right-click menu to delete it.
- Duplicate keys are flagged: dotenv uses the first definition.
- Unclosed quotes and text after a closing quote are flagged. Like dotenv, such a line is read as unquoted text, quotes included.
- Secret-looking values (
*TOKEN*, *SECRET*, *PASSWORD*, *_KEY, …, but not *PUBLIC*) and passwords in connection strings are masked by default; one toggle shows them. Editing or copying a masked value uses the real value.
Groups
Banner comments such as # === Database === or a title between # ----- lines are shown as group headings; further text lines of the banner are shown as a description below the heading. Groups stay plain comments in the file. Entries above the first group heading are shown under Ungrouped, which exists only in the editor.
- Click a group heading to collapse or expand it; collapsed groups keep their description and show their entry count. The collapsed groups are remembered.
- Go to group in the toolbar lists the groups with their entry counts.
- Move to Group… in an entry's menu moves it, with its comments, to the end of another group or of Ungrouped.
- Move to New Group… in an entry's menu moves just that entry into a new group placed after its current group. The heading follows the style of the file's existing headings (
# --- Name --- if there are none).
- Hovering a group heading shows an Actions (
…) button next to its name; it opens the same menu as a right-click on the heading: add an entry, edit, move up / down, delete.
- Add Entry to Group adds the new entry at the end of the group; Ungrouped has it too, and so do empty groups as an Add one link. Add entry in the toolbar adds to Ungrouped.
- Edit Group, or a click on the description, edits the name and description; rule lines and decorations such as
# ----- are kept.
- Move Group Up / Down in a group's right-click menu swaps it with its neighbour.
- Delete Group removes the heading and moves the group's entries to Ungrouped instead of merging them into the previous group.
- A group whose last entry was moved away stays, with a hint, until it is deleted.
- Sort entries A–Z within each group; commented-out entries go last.
Keyboard
| Key |
Action |
| Ctrl+F |
Focus the search box (Escape clears it) |
| ↑ / ↓ |
Move between entries |
| Enter |
Edit the entry; in a text field, apply and close; on a group heading, collapse or expand it |
| Escape |
Cancel editing |
| Delete |
Delete the entry (undo restores it) |
Layered files
Frameworks load several .env files on top of each other. With layering enabled, the editor shows:
- Inherited values from lower-priority files, with one-click "override in this file" and "open source file".
- overrides .env on entries that replace a value from a lower file.
- overridden by .env.local on entries that have no effect because a higher file wins.
- The layer chain, where each existing file can be opened with a click.
Supported load orders:
| Preset |
Order (lowest → highest priority) |
next |
.env, .env.[mode], .env.local (not in test), .env.[mode].local |
vite |
.env, .env.local, .env.[mode], .env.[mode].local |
dotenv-flow |
.env, .env.local (not in test), .env.[mode], .env.[mode].local |
symfony |
.env, .env.local (not in test), .env.[APP_ENV], .env.[APP_ENV].local |
| custom list |
e.g. [".env", ".env.${mode}", ".env.local"] |
The mode (development, production, test, or dev/prod/test for Symfony) can be switched in the editor; the choice is remembered per workspace without changing settings.
Privacy and security
Everything stays on your machine. .env files often hold secrets, so the extension is built to keep them local:
- No network access. The extension makes no network requests and has no telemetry, analytics or accounts. The editor view runs with a Content Security Policy that blocks all network access (
default-src 'none') and loads only the extension's own bundled scripts, styles and icons.
- Only the files it needs. It reads the open file and, when layering is enabled, the other
.env files of the configured load order in the same folder. With the auto preset it also reads the nearest package.json / composer.json to detect the framework. Nothing else is read.
- No hidden writes. Changes go into the open document through VS Code, like typing. The file is written only when you save, and every change can be undone.
- Clipboard only on request. A value is copied only when you choose a copy command in an entry's menu.
- Secrets masked on screen. Secret-looking values are hidden in the editor by default. This only affects the display; the file is unchanged.
The source repository is not public yet; a public repository will be added later. Until then, the shipped code is not minified, so you can review it: a .vsix is a zip file, and the extension's code is in extension/dist/.
Getting started
- Open a
.env, .env.* or *.env file.
- Click Open in Envy Visual Editor in the editor title bar, or right-click the file in the Explorer.
- Use Open as Text in the title bar or the editor's toolbar to switch back.
To always open .env files visually, run View: Reopen Editor With… and choose Configure default editor for '.env'….
Settings
| Setting |
Default |
Description |
envy.layering.enabled |
false |
Show inherited and overridden values from other .env files in the same folder. |
envy.layering.preset |
auto |
auto (detect from composer.json / package.json), next, vite, dotenv-flow, symfony, or a list of file names. |
envy.layering.mode |
empty |
Default mode for ${mode}. Empty means development (dev for Symfony). The mode button overrides it per workspace. |
Example for a Next.js project (.vscode/settings.json):
{
"envy.layering.enabled": true,
"envy.layering.preset": "next"
}
Supported syntax
KEY=value, export KEY=value, spaces around =
- Unquoted,
"double", 'single' and `backtick` quoted values, including values spanning multiple lines
- Escape sequences
\n and \r in double quotes
- Comments above entries, inline comments after values,
# inside quoted values
- CRLF and LF line endings
Known limitations
${VAR} references are shown as written, not resolved.
- Environment variables set outside the files are not considered for layering.
- A comment like
# WORD=… is treated as a commented-out entry.
- Symfony's
.env.dist fallback is not part of the Symfony preset.
Development
npm install
npm run build # bundle extension and webview into dist/
npm run watch # rebuild on changes
npm test # unit tests (vitest)
npm run typecheck
npm run format # prettier
npm run package # create a .vsix with vsce
npm run publish # publish to the Marketplace (after `npx vsce login rolandtoth`)
Use Run Extension in the Run and Debug view to start an Extension Development Host with the sample/ folder.
| |