dotenv-vscode
Official Dotenv Extension – from the creator of
auto-cloaking
auto-completion
secret peeking
syntax highlighting
decryption peeking
FAQDoes it automatically cloak my secrets? Yes.By default, open a Click Toggle auto-cloaking at the top of the file or run Dotenv: Toggle auto-cloaking from the Command Palette to reveal or hide them. Switching tabs hides them again in the Dotenv Editor when auto-cloaking is enabled.
Set
Does it support .env variants? Yes.
Can I autocomplete environment variables? Yes.Start typing Suggestions come from your dotenv files, with values masked and source filenames shown.
Can I reveal a value inside an autocomplete popup? Yes.Open a suggestion's details and click Reveal value. Click Hide value to mask it again. Only that source's value is revealed. The suggestion row stays masked, and your secret-peeking setting stays unchanged.
Can I peek at secrets without opening my .env file? Yes.Hover over a reference such as Every new hover or expanded autocomplete peek starts cloaked. Click Reveal value to reveal that popup, or Hide value to cloak it again. Editor cloaking toggles never reveal peek values. Uncheck Dotenv: Enable Secretpeeking to disable dotenv hovers and in-code Reveal actions, including the expanded value details in autocomplete. Completion suggestions remain available with masked values.
Can I peek at encrypted values with dotenvx? Yes.In the Dotenv Editor, hover over an Click Hide value, leave the popup, or switch tabs to clear the displayed plaintext. You'll need a saved file, a trusted workspace, and the dotenvx CLI installed locally. The CLI isn't bundled with this extension. Install it using the dotenvx installation instructions. dotenvx finds the matching private key through its usual lookup, such as
If dotenvx isn't on your PATH, set
Does it highlight .env syntax? Yes.Variable names, values, comments, and quoted strings have syntax highlighting. The Dotenv Editor also highlights numeric values.
Does it support languages other than JavaScript? Yes.Auto-completion and secret peeking support JavaScript, TypeScript, Ruby, Python, PHP, Go, Java, .NET (C#, F#, Visual Basic), C/C++, Julia, Erlang, Perl, Swift, Clojure, Rust, Dart, Kotlin, and Elixir. Values come from your dotenv files, rather than the running application's environment.
Does it support importing env from node:process? Yes.Both
Does it support .NET? Yes.C#, F#, and Visual Basic support Type
Values come from dotenv files. The extension doesn't read Windows registry values,
Does it support C and C++? Yes.Complete and hover over names in
Does it support Julia and Erlang? Yes.Complete and hover over names in these expressions:
Erlang files need the
Does it support Perl? Yes.Suggestions preserve bare keys, single quotes, or double quotes. Hover over a name to peek at its value.
Does it support Swift and Clojure? Yes.Complete names inside quotes and hover over them to peek at their values.
Swift also supports
Does it work with monorepos? Yes.Completion and secret peeking look in the source file's directory and each parent directory up to its workspace root. Sibling projects and other workspace folders stay separate. Your project doesn't
need to install the
Can I see values from multiple .env files? Yes.Each key appears once in completion, with its source filenames. Hover and completion details show the values with their filenames, nearest directories first. The extension doesn't guess which environment your application runs. Unsaved dotenv edits appear immediately in completion and secret peeking.
Can I use custom dotenv filenames? Yes.Associate them with the
This enables syntax highlighting, cloaking, and the toggle in the native editor, and includes those files in completion and secret-peeking discovery. Open files with Dotenv selected as their language are included too.
Can I edit and copy values while they're cloaked? Yes.Cloaking is visual: copied text contains the actual value. The Dotenv Editor supports line numbers, multiple cursors, find/replace, folding, comments, and normal editing. Save, undo, and redo use the usual shortcuts and update the underlying document. If another edit conflicts with yours, your draft stays available to copy instead of overwriting the other edit.
Does the Dotenv Editor prevent secrets from flashing when I switch tabs? Yes.With auto-cloaking enabled, values are masked before the editor becomes visible, and masking updates locally as you type. Each view starts masked and hides values again on tab switches. The minimap and general hover previews are disabled; encrypted values have their own explicit Decrypt value action.
Does the Dotenv Editor follow my editor settings? Yes.Fonts and basic editor settings follow VS Code. It uses Monaco, the editor component behind VS Code.
Custom theme token rules, arbitrary user keybindings, and other extensions don't automatically carry into the embedded editor.
Can I use the native VS Code text editor? Yes.Choose Reopen Editor With → Text Editor. Cloaking there uses temporary decorations, so values can briefly flash during file opens or tab switches. The toggle is remembered in extension storage, and
Does it preserve my syntax-color settings? Yes.Cloaking no longer writes syntax-color settings. On upgrade, the extension removes only the exact invisible TextMate rules inserted
by older versions from
Can I cloak environment values in YAML? Yes.In the normal YAML editor, values under This includes Docker Compose maps and lists and Kubernetes Values can briefly flash on file opens or tab switches. Invalid YAML is handled on a best-effort basis. YAML isn't a source for completion or secret peeking.
Related Tools
CHANGELOGSee CHANGELOG
Thank you for using dotenv-vscode. |