What is Envark?
Envark is a powerful environment variable guardian that combines static code analysis, risk assessment, and interactive tooling to catch configuration issues before they hit production. It works both as a standalone CLI tool with a beautiful terminal interface and as an MCP (Model Context Protocol) server that integrates with AI-powered IDEs.Envark performs pure static analysis - no data ever leaves your machine. All scanning, parsing, and risk analysis happens locally.
The Problem
Environment variables are the silent killers of production deployments:- Runtime crashes from undefined variables with no defaults
- Security leaks from secrets committed in the wrong files
- Configuration drift when .env files diverge across environments
- Onboarding friction when new developers don’t know which variables to set
- Dead code from variables defined but never used
Key Benefits
Multi-Language Support
Parse JavaScript, TypeScript, Python, Go, Rust, Shell scripts, and Docker files with language-specific patterns
Risk Scoring
Automatic risk classification: Critical, High, Medium, Low, and Info levels with actionable recommendations
Fast & Cached
Targets under 2 seconds for 500-file projects with intelligent caching to
.envark/cache.jsonAI Integration
Works as an MCP server with Claude, Cursor, VS Code, and Windsurf - plus built-in AI assistant
Core Features
Static Analysis
Envark recursively scans your codebase to:- Map all variables - Track every environment variable usage and definition
- Detect missing vars - Find variables used in code but never defined
- Find duplicates - Identify conflicting definitions across .env files
- Validate files - Check .env files against actual code requirements
- Generate templates - Auto-create .env.example from your codebase
Risk Analysis
Every variable gets a risk score based on:Interactive TUI
Envark includes a beautiful terminal interface inspired by modern security tools:- Command menu with
/prefix for all operations - Real-time scanning with progress indicators
- Color-coded output for risk levels
- Dropdown navigation with keyboard shortcuts
- AI assistant for smart analysis and recommendations
MCP Server Mode
When integrated with AI-powered IDEs, Envark exposes 9 powerful tools:| Tool | Purpose |
|---|---|
get_env_map | Complete environment variable map with filtering |
get_env_risk | Risk analysis sorted by severity |
get_missing_envs | Variables that will cause runtime crashes |
get_duplicates | Conflicting definitions across files |
get_undocumented | Variables missing from .env.example |
get_env_usage | Detailed usage tracking for specific variables |
get_env_graph | Dependency graph visualization |
validate_env_file | Validate .env against code requirements |
generate_env_template | Auto-generate .env.example |
Supported Languages
Envark understands environment variable patterns across multiple languages:How It Works
Envark uses a multi-stage pipeline:Scanning
Recursively walks your project with intelligent filtering - respects
.gitignore, skips node_modules, and uses smart depth limitsParsing
Extracts environment variable usages using language-specific regex patterns for JavaScript, Python, Go, Rust, Shell, Docker, and .env files
Resolution
Links definitions (.env files) with usages (code) and documentation (.env.example) to build a complete variable map
Risk Analysis
Assigns risk scores based on usage patterns, missing definitions, secret detection, and documentation status
Use Cases
Pre-Deployment Checks
Runenvark risk critical in your CI pipeline to catch missing variables before they cause production crashes.
Onboarding New Developers
Generate an up-to-date.env.example with envark generate so new team members know exactly which variables to configure.
Security Audits
Find hardcoded secrets and sensitive variables in committed files withenvark risk high.
Environment Validation
Validate your production .env file against code requirements:envark validate .env.production.
Refactoring Safety
Before removing code, check if environment variables become dead:envark scan unused.
What’s Next?
Installation
Install Envark with npm, yarn, pnpm, or run instantly with npx
Quickstart
Complete getting started guide from installation to your first scan