Tool Index
get_env_map
Complete variable inventory
get_env_risk
Risk analysis
get_missing_envs
Missing variables
get_duplicates
Duplicate finder
get_undocumented
Undocumented variables
get_env_usage
Variable deep dive
get_env_graph
Dependency graph
validate_env_file
File validation
generate_env_template
Template generation
get_env_map
Returns the complete environment variable map for the project, with optional filtering.Input Schema
projectPath— Path to project directory. Defaults to current working directory.filter— Filter variables by status:all(default) — All variablesmissing— Used in code but not definedunused— Defined but never usedrisky— Critical or high risk levelundocumented— Not in.env.example
Output Schema
Example Usage
Ask your AI:“Show me all environment variables in my project”
“What variables are missing?”
“Which variables are defined but never used?“
get_env_risk
Returns environment variables sorted by risk level with detailed issue explanations.Input Schema
projectPath— Path to project directory. Defaults to current working directory.minRisk— Minimum risk level to include. Defaults toinfo(shows all).
Output Schema
Risk Levels
| Level | Description |
|---|---|
| critical | Used but never defined, no default. Will cause runtime crashes. |
| high | Secret-like names in committed files, or multiple usages with no default |
| medium | Used without definition but has default value |
| low | Undocumented or minor issues |
| info | Fully configured, no issues |
Example Usage
“Are there any critical environment variable issues?”
“Show me variables with high security risk”
“What are the most dangerous variables in my project?“
get_missing_envs
Returns environment variables used in code but never defined anywhere, with no default value. These will cause runtime crashes.Input Schema
Output Schema
Danger Levels
- critical — Used in 3+ places. Guaranteed production crash.
- high — Used in 1-2 places. Will crash when that code path executes.
Example Usage
“What environment variables am I missing?”
“Will my app crash due to missing env vars?”
“Show me undefined environment variables”
get_duplicates
Finds environment variables with conflicting definitions across multiple.env files, and similar variable names that might represent the same concept.
Input Schema
Output Schema
Duplicate Types
- value_conflict — Same variable defined with different values in multiple files
- similar_name — Variables with similar names (e.g.,
DB_URLvsDATABASE_URL)
Example Usage
“Are there any conflicting environment variable definitions?”
“Do I have duplicate or similar variable names?”
“Check for environment variable name inconsistencies”
get_undocumented
Returns environment variables not present in.env.example or lacking documentation.
Input Schema
Output Schema
Example Usage
“What environment variables are missing from .env.example?”
“Which variables need documentation?”
“Show me undocumented environment variables”
get_env_usage
Deep dive into a specific environment variable — shows every usage, risk profile, and recommendations.Input Schema
variableName— Name of the environment variable to analyze (required)projectPath— Path to project directory. Defaults to current working directory.
Output Schema
Example Usage
“Show me everywhere DATABASE_URL is used”
“What does the JWT_SECRET variable do?”
“Analyze the API_KEY environment variable”
get_env_graph
Returns the dependency graph of environment variables — shows which ones cluster together, which are load-bearing, and which are isolated.Input Schema
Output Schema
Graph Concepts
- Node — An environment variable
- Edge — Connection between variables (used in same files)
- Cluster — Group of related variables (e.g., all database config)
- Load-bearing — Variables used in many files (critical infrastructure)
- Isolated — Variables with no connections to others
Example Usage
“Show me the dependency graph of environment variables”
“Which variables are most critical to my app?”
“How are my environment variables related?“
validate_env_file
Validates a.env file against codebase requirements. Finds variables in the file that code never uses, variables code needs that aren’t in the file, and variables with empty or placeholder values.
Input Schema
envFilePath— Path to the.envfile to validate (relative to project or absolute)projectPath— Path to project directory. Defaults to current working directory.
Output Schema
Validation Statuses
| Status | Description |
|---|---|
| pass | Variable is properly defined and used |
| warning | Non-critical issue (e.g., unused variable) |
| fail | Critical issue (e.g., placeholder value, missing variable) |
Example Usage
“Validate my .env file”
“Is my .env.production file correct?”
“Check if .env has all required variables”
generate_env_template
Scans the entire codebase and generates a complete.env.example file from scratch. Groups variables by cluster, adds inferred descriptions, and marks which are required vs optional.
Input Schema
projectPath— Path to project directory. Defaults to current working directory.outputPath— Path to write the generated file. If not provided, only returns content without writing.
Output Schema
Generated Content Example
.env.example (generated)
Example Usage
“Generate a .env.example file for my project”
“Create an environment template”
“What should my .env.example look like?”
Common Parameters
All tools support these optional parameters:projectPath
- Type:
string - Default: Current working directory
- Description: Path to the project to analyze
Metadata Response
All tools return ametadata object with:
projectPath— Resolved absolute path to the projectscannedFiles— Number of files scannedcacheHit— Whether results were loaded from cacheduration— Time taken in milliseconds
Error Handling
All tools return errors in this format:Project not found— InvalidprojectPathPermission denied— Can’t read project filesInvalid parameter— Missing required parameter or invalid value
Performance Tips
Use caching
Use caching
Envark automatically caches scan results in
.envark/cache.json. The cache is invalidated when:- Any source file changes (checked via mtime)
- Any
.envfile changes - Cache is older than 1 hour
Filter early
Filter early
When you only need specific variables, use the
filter parameter in get_env_map rather than retrieving all variables and filtering in the AI.Configure .gitignore properly
Configure .gitignore properly
Ensure your Envark respects
.gitignore excludes large directories:.gitignore by default.Next Steps
Setup Guide
Configure Envark in your IDE
Usage Examples
See real conversations using these tools