Skip to content

kareem2099/dotenvy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

dotenvy – VS Code Environment Manager

Version Codename Publisher License: Apache 2.0 VS Code Marketplace

DotEnvy Variable Manager

πŸš€ dotenvy makes it effortless to manage and switch between your .env files directly inside VS Code. No more manual renaming or copy-pastingβ€”just pick your environment and start coding immediately!

πŸ“₯ Install from VS Code Marketplace β€’ πŸ“– Documentation β€’ πŸ› Report Issues


✨ Features

πŸ”„ Environment Switching

Effortlessly switch between .env.development, .env.staging, .env.production, or any custom .env.* file with a single click.

πŸ“‚ Auto Detection & Sync

Automatically scans your workspace for .env files and syncs seamlessly across multi-workspace setups.

🌿 Git Branch Auto-Switching

Automatically switch environments based on Git branch changes (develop β†’ .env.development, staging β†’ .env.staging, etc.)

βœ… Environment Validation

Validate .env files for syntax errors, required variables, and type checking with custom regex patterns.

πŸ“„ Diff View

Compare environment files side-by-side before switching to preview changes and avoid surprises.

πŸ›‘οΈ Git Commit Security

Prevent committing sensitive data with pre-commit hooks that scan for secrets, validation errors, and block .env files.

☁️ Cloud Sync Support

Bidirectional cloud sync with Doppler Secrets Manager for team-based environment variable management.

πŸ’Ύ Backup & Recovery

Automatic backup creation before switching, with portable AES-256-GCM encrypted backups that work across any device.

πŸ“Š Status Bar Integration

Real-time environment indicator in status bar showing current configuration, validation status, and cloud sync state.

πŸš€ What's New in v2.0.0? (Nexus)

πŸ—‘οΈ Session Trash Bin (Lifesaver!)

Deleted a crucial variable by mistake? No worries. Restore it with a single click from the new Session Trash Bin. Trash Bin Demo

πŸ” Native VS Code Diff & History

Review your .env changes exactly like you review Git commits. Native Diff Demo

πŸ“Š Environment Analytics

Track your usage, stability metrics, and most active environments directly from your dashboard. Analytics Dashboard

βš™οΈ Compact Switcher & Settings

Manage all your environments seamlessly from a clean, native sidebar. Environment Switcher

🧠 AI Secrets Guard (Enterprise Grade) πŸ”’

Production-grade secret detection powered by a custom ML model with HMAC-secured communication and an interactive Secrets Panel.

Key Engine Features:

  • πŸ” OS-Encrypted Secret Storage β€” Shared secret stored in VS Code SecretStorage (Keychain / libsecret / Credential Manager), never in the compiled bundle
  • 35-Feature ML Model (fixed) β€” Feature count corrected from 31 β†’ 35, entropy normalization fixed to match Python backend exactly
  • πŸ“‹ Secrets Panel β€” Full WebviewPanel shows all detected secrets (no more 5-item cap) with filter by confidence, search, View / Move to .env / Not a Secret buttons
  • 🧠 AI Training Feedback β€” "Not a Secret" and "Move to .env" send labeled training samples to the Railway model β€” it learns from your corrections
  • 🚫 .dotenvyignore β€” New file (same syntax as .gitignore) lets you exclude files and folders from secret scanning
  • πŸ“ Centralized Logging β€” All extension logs visible in VS Code Output panel β†’ DotEnvy
  • πŸ”„ Smart Fallback β€” Local fallback analysis uses all 35 features including variable name signals (e.g. DB_PASS increases risk even with low entropy)

πŸ”’ Data Privacy & Security (Secrets Guard)

We take your code's security seriously. Here is exactly how DotEnvy handles your data during AI secret scanning:

  • Targeted Analysis: DotEnvy does NOT upload your entire workspace. Only the specific line containing a suspected secret (and its immediate surrounding context) is sent to our LLM engine for verification.
  • Zero Retention (Ephemeral Processing): The secret_value and context sent for analysis are processed exclusively in-memory. We do not store, log, or save your source code or secrets on our servers.
  • Opt-in Model Training: We only use data to train our ML models when you explicitly provide feedback (e.g., clicking "Not a Secret" or "Move to .env"). This sends 35 anonymized numerical features and your action label.
  • Secure Communication: All API requests are strictly authenticated using a unique X-Machine-ID and an HMAC X-Extension-Signature to prevent abuse and secure data in transit.

πŸ“‹ Commands

All commands are accessible via the Command Palette (Ctrl+Shift+P / ⌘+Shift+P).

πŸ”„ Environment Manager

  • DotEnvy: Switch Environment β€” Switch between .env files
  • DotEnvy: Open Variable Manager β€” Open the full-page variable editor tab
  • DotEnvy: Validate Environment Files β€” Validate for syntax errors and required variables

πŸ“Š Explorers & Analytics

  • DotEnvy: View Environment History β€” View the dense history table and slide-over advanced filters
  • DotEnvy: Open Trash Bin β€” Recover accidental deletions or changes in real-time
  • DotEnvy: Open Analytics Panel β€” View heatmap and stability metrics
  • DotEnvy: Open Timeline Panel β€” View the SVG timeline viewer tab

πŸ›‘οΈ Git Integration

  • DotEnvy: Install Git Commit Hook β€” Block commits containing secrets
  • DotEnvy: Remove Git Commit Hook β€” Remove the installed hook

☁️ Cloud Sync

  • DotEnvy: Pull Environment from Cloud β€” Pull from Doppler
  • DotEnvy: Push Environment to Cloud β€” Push to Doppler

πŸ” Security

  • DotEnvy: Scan for Secrets β€” Scan workspace with AI-powered detection; opens Secrets Panel with all findings
  • DotEnvy: Init .dotenvyignore β€” Create a pre-populated .dotenvyignore file
  • DotEnvy: Setup LLM Secret β€” Store the HMAC shared secret securely in OS vault

πŸ–±οΈ Right-Click (Explorer)

  • DotEnvy: Ignore this path β€” Right-click any file or folder β†’ add to .dotenvyignore instantly

πŸ’¬ Support

  • DotEnvy: Feedback & Support β€” Access feedback and support resources
  • DotEnvy: Show What's New β€” View changelog for current version

🚫 .dotenvyignore

Control which files DotEnvy skips when scanning for secrets β€” same syntax as .gitignore:

# .dotenvyignore

# DotEnvy's own data (always recommended)
.dotenvy/**
.dotenvy-backups/**

# Test files (often contain example secrets)
**/*.test.ts
**/*.spec.ts
tests/**

# Docs with example secrets
docs/**
README.md
SECURITY.md

# Specific files
k8s/secrets.yaml

Run DotEnvy: Init .dotenvyignore to create a default file, or right-click any file/folder in the Explorer and choose "DotEnvy: Ignore this path".


πŸ“¦ Installation

Quick Install

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X / ⌘+Shift+X)
  3. Search for "dotenvy"
  4. Click Install

Alternative Methods

Requirements

  • VS Code 1.90.0 or later

πŸš€ Usage

  1. Place your environment files in your project root:

    .env.development
    .env.staging
    .env.production
  2. Open the Command Palette (Ctrl+Shift+P).

  3. Run DotEnvy: Switch Environment and pick your environment.

  4. The selected file is copied to .env automatically.

βœ… The status bar updates to show the active environment.


βš™οΈ Configuration

// .dotenvy.json
{
  "environments": {
    "local": ".env.local",
    "qa": ".env.qa",
    "prod": ".env.production"
  },
  "gitBranchMapping": {
    "develop": "development",
    "staging": "staging",
    "main": "production"
  },
  "autoSwitchOnBranchChange": true,
  "validation": {
    "requiredVariables": ["API_KEY", "DATABASE_URL"],
    "variableTypes": {
      "PORT": "number",
      "DEBUG": "boolean",
      "API_URL": "url"
    }
  },
  "gitCommitHook": {
    "blockEnvFiles": true,
    "blockSecrets": true,
    "blockValidationErrors": true
  }
}

☁️ Cloud Sync Setup (Doppler)

{
  "cloudSync": {
    "provider": "doppler",
    "project": "your-project-name",
    "config": "development",
    "token": "dp.pt.your_token_here"
  }
}

πŸ—ΊοΈ Roadmap & Contributing

For upcoming features, see ROADMAP.md.
Issues and PRs are welcome! Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.


πŸ“œ License

This project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors