Skip to content

@env-spec VS Code extension

The @env-spec VS Code and Open VSX extensions provide language support for @env-spec enabled .env files.

The extension is available on the VS Code Marketplace and Open VSX Registry for those who use VS Code forks like Cursor and Windsurf.

  • Syntax highlighting
  • IntelliSense for decorators, @type values, type options, resolver functions, and $KEY references
  • Enum value completion for item values below @type=enum(...)
  • Inline validation for invalid enum values, incompatible decorators, and obvious static @type mismatches
  • Hover info for common @decorators
  • Comment continuation - automatically continue comment blocks when you hit enter within one

The extension suggests decorators and built-in @type= values directly inside comment blocks.

Decorator and type completion

Built-in types surface context-aware option completions like email(normalize=...), ip(version=..., normalize=...), and url(prependHttps=...).

Type option completion

Type-specific completions also work for focused cases like email(normalize=...), with boolean choice values suggested inline.

Email option completion

When an item is declared as @type=enum(...), the allowed values are suggested directly on the item value line below.

Enum value completion

Typing $ inside values and decorator expressions suggests config keys from the current file.

Key reference completion

Decorator and validation workflows also support prefix-related configuration scenarios while editing schema comments.

Prefix-related completion or validation

Autocomplete filters out incompatible decorators like @required and @optional, and inline diagnostics catch invalid combinations if they still appear in the file.

Incompatible decorator diagnostics

The extension also highlights obvious static validation issues, such as invalid enum values or incorrect prependHttps URL usage.

Inline validation

The new @env-spec language mode should be enabled automatically for any .env and .env.* files, but you can always set it via the Language Mode selector in the bottom right of your editor.