EnvScope is an offline-first, zero-dependency VS Code extension designed to catch environment drift, malformed configurations, and credential leaks directly inside your editor in real time.
Built natively on the VS Code Extension API using only Node.js runtime primitives, EnvScope guarantees that your secret tokens never leave your local workspace—zero telemetry, zero external APIs, and zero background analytics.
Key Features
Shannon Entropy Leak Detection: Computes character randomness scores in real time to flag high-entropy credentials (AWS keys, OpenAI/Gemini tokens, private keys) before they get committed to public repositories or template files.
Schema Drift & Missing Key Alerts: Compares your active .env file against .env.example (or template schemas) and triggers native VS Code Diagnostics for missing or extra variables.
Type & Contract Inference: Automatically infers basic types (number, boolean, url, string) from schemas and underlines mismatched values.
Offline-First Security: Complete functional isolation. No external npm libraries, no outbound HTTP calls, and no analytics collection.
Interactive Dashboard: Press Cmd+Shift+P (macOS) or Ctrl+Shift+P (Windows/Linux) and run EnvScope: Open Dashboard to inspect your workspace environment health in a clean, sandboxed Webview interface.
How It Works
Local Diagnostic Scanner: When you open any .env* file, EnvScope registers an active diagnostic collection using vscode.languages.createDiagnosticCollection.
Entropy Analysis: Each variable value is evaluated using Shannon's entropy formula:
$$H(X) = -\sum_{i=1}^{n} P(x_i) \log_2 P(x_i)$$
Values scoring above the threshold (typically > 4.2 bits/char) are immediately underlined with actionable warnings in your editor and the Problems tray.
Workspace Cross-Referencing: EnvScope reads neighboring .env.example definitions to ensure your local runtime matches team configurations.
Usage
Open any workspace containing environment files (.env, .env.example, .env.local).
Type in your .env file—diagnostics will update automatically as you edit.
Hover over variable names to view inferred types and entropy statistics.
Access commands via the Command Palette (Ctrl+Shift+P / Cmd+Shift+P):
EnvScope: Open Dashboard — View workspace environment parity and active issues.
Configuration
EnvScope runs out of the box with sensible defaults. You can customize behavior via VS Code Settings (settings.json):