{"_id":"@amtstack/envmaster","_rev":"5-b0a4f429abc4bb4b0bbcd49ff83612c4","name":"@amtstack/envmaster","dist-tags":{"latest":"0.1.4"},"versions":{"0.1.0":{"name":"@amtstack/envmaster","version":"0.1.0","keywords":["env","environment","dotenv","env-variables","environment-variables","env-example","env-validation","env-sync","env-generator","env-scanner","env-management","developer-tools","cli","devops","configuration"],"author":{"url":"https://mubin.amtstack.com","name":"Abdullah Al Mubin"},"license":"MIT","_id":"@amtstack/envmaster@0.1.0","maintainers":[{"name":"amttawsik","email":"amttawsik.cse@gmail.com"}],"homepage":"https://amtstack.com","bugs":{"url":"https://github.com/mubin/envmaster/issues"},"bin":{"envmaster":"dist/cli/index.js"},"dist":{"shasum":"3452f5232ba9c5830fbb0adbbc67d6ab2f4cc76e","tarball":"https://registry.npmjs.org/@amtstack/envmaster/-/envmaster-0.1.0.tgz","fileCount":12,"integrity":"sha512-HJVLnYAJcBNFmw7kEqoK5KAu05dx95Mb1TPklEd8Jb+eevUBb/bJcqLw7HOe6ZM3GKKrjCi4+1LGrIYKnVTUrw==","signatures":[{"sig":"MEUCIQCBqikks1Ek37EYJ+wztag7tE36XjlW0Yq1v1VXo06/TQIgVoiLHOFXvLLBaqJSaxLGNeUxPHVWzcxqKmgXrGz4AKk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1050313},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"295a2575c2e88842d8f6663045af117f9f2b7dee","scripts":{"dev":"tsup --watch","lint":"eslint src/ tests/","test":"vitest run","build":"tsup","clean":"rimraf dist","format":"prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"","lint:fix":"eslint src/ tests/ --fix","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"prettier --check \"src/**/*.ts\" \"tests/**/*.ts\"","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build"},"_npmUser":{"name":"amttawsik","email":"amttawsik.cse@gmail.com"},"publisher":"AmtStack","repository":{"url":"git+https://github.com/mubin/envmaster.git","type":"git"},"_npmVersion":"10.8.2","description":"The ultimate environment variable discovery, generation, validation, synchronization, and management toolkit for modern JavaScript applications.","directories":{},"_nodeVersion":"20.19.0","dependencies":{"ora":"^8.2.0","jiti":"^2.4.0","chalk":"^5.4.0","dotenv":"^16.5.0","js-yaml":"^4.2.0","chokidar":"^4.0.0","commander":"^13.1.0","fast-glob":"^3.3.0","@iarna/toml":"^2.2.5","@babel/types":"^7.27.0","@babel/parser":"^7.27.0","@babel/traverse":"^7.27.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","eslint":"^9.0.0","rimraf":"^6.0.0","vitest":"^3.0.0","prettier":"^3.4.0","typescript":"^5.7.0","@types/node":"^22.0.0","@types/js-yaml":"^4.0.9","@vitest/coverage-v8":"^3.0.0","@types/babel__traverse":"^7.20.0"},"_npmOperationalInternal":{"tmp":"tmp/envmaster_0.1.0_1780472343695_0.27165435955678974","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@amtstack/envmaster","version":"0.1.1","keywords":["env","environment","dotenv","env-variables","environment-variables","env-example","env-validation","env-sync","env-generator","env-scanner","env-management","developer-tools","cli","devops","configuration"],"author":{"url":"https://mubin.amtstack.com","name":"Abdullah Al Mubin"},"license":"MIT","_id":"@amtstack/envmaster@0.1.1","maintainers":[{"name":"amttawsik","email":"amttawsik.cse@gmail.com"}],"homepage":"https://amtstack.com","bugs":{"url":"https://github.com/mubin/envmaster/issues"},"bin":{"envmaster":"dist/cli/index.js"},"dist":{"shasum":"3459208daeef806ad6276e4c4ff987e607571e8f","tarball":"https://registry.npmjs.org/@amtstack/envmaster/-/envmaster-0.1.1.tgz","fileCount":12,"integrity":"sha512-vbx5P0nt00uyYnL22izyfrREJ9zAjTHpkUCH2L9rGIOgr55AwMcCtFf5QuGVwLVbtQ7Oz9A5llpiWxY2Htxvag==","signatures":[{"sig":"MEUCIQDYDndLJBKXNkDp5mqVUgmZvwq1dyCJGw2qEKLorfsdEgIgTE5zYRKqUaxa+jgqmgdvnpq1LILGKOOeEAkCvc9LHEk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1050381},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"295a2575c2e88842d8f6663045af117f9f2b7dee","scripts":{"dev":"tsup --watch","lint":"eslint src/ tests/","test":"vitest run","build":"tsup","clean":"rimraf dist","format":"prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"","lint:fix":"eslint src/ tests/ --fix","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"prettier --check \"src/**/*.ts\" \"tests/**/*.ts\"","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build"},"_npmUser":{"name":"amttawsik","email":"amttawsik.cse@gmail.com"},"publisher":"AmtStack","repository":{"url":"git+https://github.com/mubin/envmaster.git","type":"git"},"_npmVersion":"10.8.2","description":"The ultimate environment variable discovery, generation, validation, synchronization, and management toolkit for modern JavaScript applications.","directories":{},"_nodeVersion":"20.19.0","dependencies":{"ora":"^8.2.0","jiti":"^2.4.0","chalk":"^5.4.0","dotenv":"^16.5.0","js-yaml":"^4.2.0","chokidar":"^4.0.0","commander":"^13.1.0","fast-glob":"^3.3.0","@iarna/toml":"^2.2.5","@babel/types":"^7.27.0","@babel/parser":"^7.27.0","@babel/traverse":"^7.27.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","eslint":"^9.0.0","rimraf":"^6.0.0","vitest":"^3.0.0","prettier":"^3.4.0","typescript":"^5.7.0","@types/node":"^22.0.0","@types/js-yaml":"^4.0.9","@vitest/coverage-v8":"^3.0.0","@types/babel__traverse":"^7.20.0"},"_npmOperationalInternal":{"tmp":"tmp/envmaster_0.1.1_1780473242041_0.6477988567794197","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@amtstack/envmaster","version":"0.1.2","keywords":["env","environment","dotenv","env-variables","environment-variables","env-example","env-validation","env-sync","env-generator","env-scanner","env-management","developer-tools","cli","devops","configuration"],"author":{"url":"https://mubin.amtstack.com","name":"Abdullah Al Mubin"},"license":"MIT","_id":"@amtstack/envmaster@0.1.2","maintainers":[{"name":"amttawsik","email":"amttawsik.cse@gmail.com"}],"homepage":"https://amtstack.com","bugs":{"url":"https://github.com/mubin/envmaster/issues"},"bin":{"envmaster":"dist/cli/index.js"},"dist":{"shasum":"b240a1b2842a12d3d4de3b4aed86973557a95ddd","tarball":"https://registry.npmjs.org/@amtstack/envmaster/-/envmaster-0.1.2.tgz","fileCount":12,"integrity":"sha512-kNdnpX9gMkYzBPFBrOlyXUTA5v/dPtForeiR7X/DGJyvNsCUYdFz38KiY3qD1hjHARrnqEQzJCLO1YyHan33Dg==","signatures":[{"sig":"MEYCIQCa7zr/cEt912gt7M7bC4xranP8o86riJ895GlaL/c9mAIhAOKdUHcwckgOPXXP1GZb5m9ZaIDxa/kWzltbTFobcH4E","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1050501},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"27d41732a4754b58c86600064ded06a1e58bf258","scripts":{"dev":"tsup --watch","lint":"eslint src/ tests/","test":"vitest run","build":"tsup","clean":"rimraf dist","format":"prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"","lint:fix":"eslint src/ tests/ --fix","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"prettier --check \"src/**/*.ts\" \"tests/**/*.ts\"","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build"},"_npmUser":{"name":"amttawsik","email":"amttawsik.cse@gmail.com"},"publisher":"AmtStack","repository":{"url":"git+https://github.com/mubin/envmaster.git","type":"git"},"_npmVersion":"10.8.2","description":"The ultimate environment variable discovery, generation, validation, synchronization, and management toolkit for modern JavaScript applications.","directories":{},"_nodeVersion":"20.19.0","dependencies":{"ora":"^8.2.0","jiti":"^2.4.0","chalk":"^5.4.0","dotenv":"^16.5.0","js-yaml":"^4.2.0","chokidar":"^4.0.0","commander":"^13.1.0","fast-glob":"^3.3.0","@iarna/toml":"^2.2.5","@babel/types":"^7.27.0","@babel/parser":"^7.27.0","@babel/traverse":"^7.27.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","eslint":"^9.0.0","rimraf":"^6.0.0","vitest":"^3.0.0","prettier":"^3.4.0","typescript":"^5.7.0","@types/node":"^22.0.0","@types/js-yaml":"^4.0.9","@vitest/coverage-v8":"^3.0.0","@types/babel__traverse":"^7.20.0"},"_npmOperationalInternal":{"tmp":"tmp/envmaster_0.1.2_1780474215846_0.12164224523261669","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@amtstack/envmaster","version":"0.1.3","keywords":["env","environment","dotenv","env-variables","environment-variables","env-example","env-validation","env-sync","env-generator","env-scanner","env-management","developer-tools","cli","devops","configuration"],"author":{"url":"https://mubin.amtstack.com","name":"Abdullah Al Mubin"},"license":"MIT","_id":"@amtstack/envmaster@0.1.3","maintainers":[{"name":"amttawsik","email":"amttawsik.cse@gmail.com"}],"homepage":"https://amtstack.com","bugs":{"url":"https://github.com/mubin/envmaster/issues"},"bin":{"envmaster":"dist/cli/index.js"},"dist":{"shasum":"f6ff9fda16deae03cee59874b668eaa72cc99ae7","tarball":"https://registry.npmjs.org/@amtstack/envmaster/-/envmaster-0.1.3.tgz","fileCount":12,"integrity":"sha512-4z1Bn0YjSkKSNDhtVNpe2dfPsFd1ceZuXWr54ixbT5wszZj6+BU1s22KrWwsYETGv180cgvTVR3Hy73Aj4cJCw==","signatures":[{"sig":"MEYCIQCbJ/KHvUkekdLivMNTXAknSJR3iJndjXb59BGfKhIKHgIhAMMveQ6t9UPWQFonZjK2xABjgHzYp3vqOi03s6Aux8Gq","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1050501},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"440a528ad85e1e85ea58143d93534e0ccb8dda6a","scripts":{"dev":"tsup --watch","lint":"eslint src/ tests/","test":"vitest run","build":"tsup","clean":"rimraf dist","format":"prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"","lint:fix":"eslint src/ tests/ --fix","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"prettier --check \"src/**/*.ts\" \"tests/**/*.ts\"","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build"},"_npmUser":{"name":"amttawsik","email":"amttawsik.cse@gmail.com"},"publisher":"AmtStack","repository":{"url":"git+https://github.com/mubin/envmaster.git","type":"git"},"_npmVersion":"10.8.2","description":"The ultimate environment variable discovery, generation, validation, synchronization, and management toolkit for modern JavaScript applications.","directories":{},"_nodeVersion":"20.19.0","dependencies":{"ora":"^8.2.0","jiti":"^2.4.0","chalk":"^5.4.0","dotenv":"^16.5.0","js-yaml":"^4.2.0","chokidar":"^4.0.0","commander":"^13.1.0","fast-glob":"^3.3.0","@iarna/toml":"^2.2.5","@babel/types":"^7.27.0","@babel/parser":"^7.27.0","@babel/traverse":"^7.27.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","eslint":"^9.0.0","rimraf":"^6.0.0","vitest":"^3.0.0","prettier":"^3.4.0","typescript":"^5.7.0","@types/node":"^22.0.0","@types/js-yaml":"^4.0.9","@vitest/coverage-v8":"^3.0.0","@types/babel__traverse":"^7.20.0"},"_npmOperationalInternal":{"tmp":"tmp/envmaster_0.1.3_1780474341662_0.20015051190858557","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@amtstack/envmaster","version":"0.1.4","description":"The ultimate environment variable discovery, generation, validation, synchronization, and management toolkit for modern JavaScript applications.","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"bin":{"envmaster":"dist/cli/index.js"},"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","typecheck":"tsc --noEmit","lint":"eslint src/ tests/","lint:fix":"eslint src/ tests/ --fix","format":"prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"","format:check":"prettier --check \"src/**/*.ts\" \"tests/**/*.ts\"","prepublishOnly":"npm run build","clean":"rimraf dist"},"keywords":["env","environment","dotenv","env-variables","environment-variables","env-example","env-validation","env-sync","env-generator","env-scanner","env-management","developer-tools","cli","devops","configuration"],"author":{"name":"Abdullah Al Mubin","url":"https://mubin.amtstack.com"},"publisher":"AmtStack","license":"MIT","repository":{"type":"git","url":"git+https://github.com/AmtTawsik/envmaster-homepage.git"},"bugs":{"url":"https://github.com/AmtTawsik/envmaster-homepage/issues"},"homepage":"https://envmaster.amtstack.com","engines":{"node":">=18.0.0"},"dependencies":{"@babel/parser":"^7.27.0","@babel/traverse":"^7.27.0","@babel/types":"^7.27.0","@iarna/toml":"^2.2.5","chalk":"^5.4.0","chokidar":"^4.0.0","commander":"^13.1.0","dotenv":"^16.5.0","fast-glob":"^3.3.0","jiti":"^2.4.0","js-yaml":"^4.2.0","ora":"^8.2.0"},"devDependencies":{"@types/babel__traverse":"^7.20.0","@types/js-yaml":"^4.0.9","@types/node":"^22.0.0","@vitest/coverage-v8":"^3.0.0","eslint":"^9.0.0","prettier":"^3.4.0","rimraf":"^6.0.0","tsup":"^8.4.0","typescript":"^5.7.0","vitest":"^3.0.0"},"_id":"@amtstack/envmaster@0.1.4","gitHead":"440a528ad85e1e85ea58143d93534e0ccb8dda6a","_nodeVersion":"20.19.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-eT2bqIIX4IyctBmZyJF6ROz0gTrzP4S3u6ia5zV0INVMUh5/Mw5VsdpaN85MrqmgtBQwrPn8ptdtkFPDhKx2ew==","shasum":"925e95c4517c4be3b5c54a66b9b4b3b2a0789197","tarball":"https://registry.npmjs.org/@amtstack/envmaster/-/envmaster-0.1.4.tgz","fileCount":12,"unpackedSize":1050537,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIA3u0ERcuhADwSXFGFW/Fm4yoF/KcZuNyYHMS89RDBEAAiEAn5DxkC4BHcjh8Sq/9JscXj1mdUKzNP/zpqVtZDSsGXo="}]},"_npmUser":{"name":"amttawsik","email":"amttawsik.cse@gmail.com"},"directories":{},"maintainers":[{"name":"amttawsik","email":"amttawsik.cse@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/envmaster_0.1.4_1780481703915_0.35709198193751535"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-03T07:39:03.546Z","modified":"2026-06-03T10:15:04.222Z","0.1.0":"2026-06-03T07:39:03.874Z","0.1.1":"2026-06-03T07:54:02.202Z","0.1.2":"2026-06-03T08:10:16.077Z","0.1.3":"2026-06-03T08:12:21.830Z","0.1.4":"2026-06-03T10:15:04.102Z"},"bugs":{"url":"https://github.com/AmtTawsik/envmaster-homepage/issues"},"author":{"name":"Abdullah Al Mubin","url":"https://mubin.amtstack.com"},"license":"MIT","homepage":"https://envmaster.amtstack.com","keywords":["env","environment","dotenv","env-variables","environment-variables","env-example","env-validation","env-sync","env-generator","env-scanner","env-management","developer-tools","cli","devops","configuration"],"repository":{"type":"git","url":"git+https://github.com/AmtTawsik/envmaster-homepage.git"},"description":"The ultimate environment variable discovery, generation, validation, synchronization, and management toolkit for modern JavaScript applications.","maintainers":[{"name":"amttawsik","email":"amttawsik.cse@gmail.com"}],"readme":"<div align=\"center\">\n  <h1>🌌 EnvMaster</h1>\n  <p><strong>The ultimate environment variable discovery, validation, synchronization, and management toolkit for modern JavaScript applications.</strong></p>\n  <p><em>Created by <a href=\"https://mubin.amtstack.com\">Abdullah Al Mubin</a> • Published by <a href=\"https://amtstack.com\">AmtStack</a></em></p>\n\n  [![npm version](https://img.shields.io/npm/v/%40amtstack%2Fenvmaster.svg?style=flat-square&color=blue)](https://npmjs.org/package/@amtstack/envmaster)\n  [![Build Status](https://img.shields.io/github/actions/workflow/status/AmtTawsik/envmaster/ci.yml?branch=main&style=flat-square)](https://github.com/AmtTawsik/envmaster/actions)\n  [![License](https://img.shields.io/npm/l/%40amtstack%2Fenvmaster.svg?style=flat-square&color=green)](https://github.com/AmtTawsik/envmaster/blob/main/LICENSE)\n  [![Types](https://img.shields.io/npm/types/%40amtstack%2Fenvmaster.svg?style=flat-square)](https://github.com/AmtTawsik/envmaster)\n</div>\n\n<br />\n\n**EnvMaster** is a next-generation CLI and SDK that statically analyzes your codebase to find exactly what environment variables are required, automatically generates and synchronizes `.env.example` files, validates your local `.env`, and audits your secrets for security vulnerabilities.\n\nUnlike traditional tools that rely on fragile and error-prone regular expressions, EnvMaster parses your code into **Abstract Syntax Trees (ASTs)** using Babel. This means it understands your code exactly like a compiler does, guaranteeing 100% accuracy even in complex nested structures, destructuring patterns, and dynamic setups.\n\n---\n\n## ✨ Key Features\n\n- 🔍 **AST-Powered Scanning**: Intelligently and reliably finds `process.env.X` and `import.meta.env.X` usage across JavaScript, TypeScript, JSX, and TSX files.\n- 🏗️ **Smart Generator**: Creates beautiful `.env.example` files. It automatically categorizes variables, adds context-aware comments, and preserves your custom dummy values.\n- ✅ **Strict Validation**: Instantly flags missing variables by comparing your local `.env` file directly to your actual codebase usage. Never deploy broken code again.\n- 🛡️ **Security Analyzer**: Scans your local `.env` for weak secrets, placeholder strings, and accidentally exposed private keys (like PEM headers or base64 keys).\n- 🔌 **Auto-Detect Plugins**: 11 built-in presets for frameworks and services (Prisma, NextAuth, Stripe, PostgreSQL, MongoDB, Redis, etc.) that automatically validate formats and API keys.\n- 👁️ **Watch Mode (`chokidar`)**: A background daemon that updates your `.env.example` in real-time as you code.\n- 🤖 **CI/CD Integration**: Strict pipeline validation that natively outputs GitHub Action annotations on PRs for missing variables.\n- 📦 **Monorepo Ready**: Detects Turborepo, Nx, and standard workspaces (npm, yarn, pnpm, lerna) out of the box.\n- 🔀 **Universal Exporters**: Export your environment into JSON, YAML, or TOML programmatically.\n\n---\n\n## 🚀 Installation & Quick Start\n\nYou can use EnvMaster instantly via `npx` without installing it:\n\n```bash\n# Run a comprehensive health check on your project\nnpx @amtstack/envmaster doctor\n\n# Generate an accurate .env.example file based on your code\nnpx @amtstack/envmaster generate\n\n# Validate your local .env against the codebase requirements\nnpx @amtstack/envmaster validate\n```\n\nIf you prefer to install it locally in your project:\n\n```bash\nnpm install --save-dev @amtstack/envmaster\n# or\nyarn add -D @amtstack/envmaster\n# or\npnpm add -D @amtstack/envmaster\n```\n\nOnce installed, you can initialize a config file and add scripts to your `package.json`:\n\n```json\n{\n  \"scripts\": {\n    \"env:check\": \"envmaster validate\",\n    \"env:sync\": \"envmaster sync\",\n    \"env:watch\": \"envmaster watch\"\n  }\n}\n```\n\n---\n\n## 💻 CLI Commands Reference\n\n### `envmaster init`\nInitializes a new `envmaster.config.ts` (or `.js`) configuration file in your project root with sensible, framework-detected defaults.\n\n### `envmaster doctor`\nRuns a comprehensive project audit. It detects your framework, scans the codebase for environment variable usage, validates your local `.env` against those variables, detects unused environment variables, and performs a deep security analysis on your secrets.\n\n**Options:**\n- `--root <dir>`: Specify the root directory to run the doctor check on (default: current directory).\n- `--json`: Output the entire report in JSON format for programmatic ingestion.\n- `--verbose`: Enable detailed log output.\n\n**Sample Output:**\n```\n🌌 EnvMaster Doctor - Project Audit\n-------------------------------------\n✓ Framework Detected: Next.js\n✓ Codebase Scanned: 42 files found with 18 environment variables.\n\nValidation Report:\n✗ API_KEY is missing from .env\n✓ DATABASE_URL is present and valid\n\nSecurity Audit:\n⚠ STRIPE_SECRET_KEY is too short (< 16 chars)\n⚠ GOOGLE_CLIENT_SECRET contains placeholder value (\"your-secret-here\")\n\nRecommendations:\n- Add API_KEY to your local .env file.\n- Update GOOGLE_CLIENT_SECRET with a real secret value.\n```\n\n### `envmaster generate` (alias `g`)\nScans your entire codebase and generates a fresh `.env.example` file. It groups variables logically by category (e.g. database, auth, frameworks) and preserves existing dummy values if the file already exists.\n\n**Options:**\n- `-o, --output <path>`: Custom output file path (default: `.env.example`).\n- `-f, --force`: Overwrite the existing file entirely instead of preserving values.\n- `--no-sort`: Disable alphabetical sorting of variables.\n- `--no-group`: Disable category-based grouping.\n\n### `envmaster validate`\nCompares your local `.env` file against the variables actually found in your source code. It fails with a non-zero exit code (exit 1) if required variables are missing, ensuring you never push broken code to production.\n\n**Options:**\n- `-e, --env-file <path>`: Path to a specific `.env` file to validate (default: `.env`).\n- `--strict`: Fail the command even if there are only warnings (e.g., security warnings or plugin format warnings).\n\n### `envmaster sync` (alias `s`)\nSafely updates your `.env.example` file based on a fresh codebase scan. Unlike `generate`, it *only* adds newly discovered variables and guarantees it will never overwrite your existing values, custom placeholders, or comments.\n\n### `envmaster watch` (alias `w`)\nStarts a persistent background watcher using `chokidar`. As you write code and add new environment variables, EnvMaster automatically detects them and syncs them to your `.env.example` in real-time.\n\n### `envmaster compare`\nVisualizes the differences between multiple environment files (e.g., `.env` vs `.env.production` vs `.env.example`) using a clean matrix in the terminal.\n\n**Options:**\n- `-f, --files <paths>`: Comma-separated paths to the files to compare.\n\n**Usage:**\n```bash\nnpx envmaster compare --files .env,.env.example,.env.production\n```\n\n### `envmaster ci`\nDesigned specifically for CI/CD pipelines. It runs in strict mode, disables interactive elements (spinners and colors if colors are not supported), and generates machine-readable output or PR annotations if a variable is missing.\n\n---\n\n## ⚙️ Configuration Reference\n\nCustomize EnvMaster by creating an `envmaster.config.ts` (or `.js`, `.json`) file. You can import the `defineConfig` helper to get complete autocompletion and type-safety:\n\n```typescript\nimport { defineConfig } from '@amtstack/envmaster';\n\nexport default defineConfig({\n  // Directories or files to ignore during the AST scan\n  ignore: ['**/*.test.ts', '**/*.spec.ts', 'dist/**', 'node_modules/**'],\n  \n  // Output path for generate/sync commands\n  output: '.env.example',\n  \n  // File extensions to scan\n  extensions: ['.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs'],\n  \n  // Scan mode: 'ast' (highly accurate), 'regex' (fastest), or 'hybrid' (uses both)\n  scanMode: 'hybrid',\n  \n  // Files to consider during validation / comparison\n  envFiles: ['.env', '.env.local', '.env.development'],\n  \n  security: {\n    enabled: true,\n    minSecretLength: 16,\n    detectWeakSecrets: true,\n    detectPlaceholders: true,  // Flags \"your-api-key-here\" or \"TODO\"\n    detectExposedKeys: true,   // Flags PEM headers and raw private keys\n    secretPatterns: ['API_KEY', 'SECRET', 'TOKEN', 'PASSWORD'],\n  },\n  \n  ci: {\n    enabled: false,            // Auto-enabled when using `envmaster ci`\n    platform: 'auto',          // 'github-actions' | 'gitlab-ci' | 'jenkins' | 'circleci' | 'azure-devops' | 'auto'\n    failOnWarnings: true,\n    outputFormat: 'annotations',\n  }\n});\n```\n\n### Configuration Options\n\n| Property | Type | Default | Description |\n|---|---|---|---|\n| `ignore` | `string[]` | `['**/node_modules/**', '**/dist/**', '**/.git/**']` | Glob patterns to ignore during scanning |\n| `output` | `string` | `'.env.example'` | Output path for the generated/synced example file |\n| `extensions` | `string[]` | `['.js', '.jsx', '.ts', '.tsx', '.mjs', '.cjs']` | File extensions to parse |\n| `scanMode` | `'ast' \\| 'regex' \\| 'hybrid'` | `'hybrid'` | Engine mode to use for environment variable discovery |\n| `sortVariables` | `boolean` | `true` | Sort variables alphabetically |\n| `groupByCategory`| `boolean` | `true` | Group variables into sections with comment headers |\n| `detectUnused` | `boolean` | `true` | Flag variables declared in env files but never used in code |\n| `envFiles` | `string[]` | `['.env']` | Env files to load for validation and comparing |\n| `security` | `SecurityConfig` | (Strict rules enabled) | Settings for local security audits |\n| `ci` | `CIConfig` | (Platform-aware config) | Config for CI pipeline running |\n\n---\n\n## 🔌 Plugin System & Presets\n\nEnvMaster automatically detects which services and frameworks your project uses by analyzing your `package.json` dependencies and root configuration files. It then applies specific validation rules and auto-injects required variable definitions.\n\n### Built-in Presets\nEnvMaster comes with 11 built-in plugins out of the box:\n- **Frameworks**: Next.js, Vite, Nuxt, Astro, SvelteKit, Remix, Express.\n- **Databases**: Prisma (`DATABASE_URL`), PostgreSQL, MySQL, MongoDB, Redis.\n- **Authentication**: NextAuth.js (`NEXTAUTH_URL`, `NEXTAUTH_SECRET`), Supabase, Firebase, Clerk.\n- **Third-Party Services**: Stripe (`STRIPE_SECRET_KEY`), Resend.\n\n*Example: If `stripe` is found in your `package.json` dependencies, EnvMaster will automatically validate that your `STRIPE_SECRET_KEY` actually begins with the `sk_` prefix in your `.env`.*\n\n### Writing Custom Plugins\nYou can write your own plugins and inject them via the configuration file or the programmatic API. Custom plugins allow you to enforce rules specific to your internal company infrastructure:\n\n```typescript\nimport { defineConfig } from '@amtstack/envmaster';\nimport type { EnvMasterPlugin } from '@amtstack/envmaster';\n\nconst companyApiPlugin: EnvMasterPlugin = {\n  name: 'my-company-api',\n  version: '1.0.0',\n  variables: [\n    { name: 'COMPANY_API_URL', required: true, validation: 'url', category: 'Third Party' },\n    { name: 'COMPANY_API_TOKEN', required: true, category: 'Third Party' }\n  ],\n  detect: (context) => {\n    // Enable this plugin if the corporate API SDK is installed\n    return !!context.packageJson?.dependencies?.['@mycompany/api-sdk'];\n  },\n  validate: (context, envValues) => {\n    const results = [];\n    if (envValues.COMPANY_API_TOKEN) {\n      if (!envValues.COMPANY_API_TOKEN.startsWith('co_')) {\n        results.push({\n          variable: 'COMPANY_API_TOKEN',\n          status: 'fail',\n          message: 'Company API token must start with prefix \"co_\"',\n          plugin: 'my-company-api'\n        });\n      }\n    }\n    return results;\n  }\n};\n\nexport default defineConfig({\n  plugins: [companyApiPlugin]\n});\n```\n\n---\n\n## 📦 Monorepo Integration\n\nEnvMaster natively understands and resolves monorepos. It automatically detects configurations from:\n- **Turborepo** (`turbo.json`)\n- **Nx** (`nx.json`)\n- **Lerna** (`lerna.json`)\n- **Workspaces** (npm, pnpm, yarn workspaces)\n\nWhen running inside a monorepo root, EnvMaster resolves all packages and allows you to either output a combined workspace report or run isolated env validations per package, ensuring that your microservices maintain independent `.env.example` definitions flawlessly.\n\n```typescript\nexport default defineConfig({\n  monorepo: {\n    enabled: true,\n    type: 'auto',        // Autodetects Turborepo, Nx, pnpm, etc.\n    perPackage: true,    // Generates a separate .env.example inside each workspace package\n    rootReport: true,    // Generates a consolidated check report at the root level\n    packages: []         // Specific workspaces to target (leave empty for all)\n  }\n});\n```\n\n---\n\n## 🤖 CI/CD Orchestration\n\nYou can integrate EnvMaster into your CI pipeline to block pull requests that introduce new environment variables without updating `.env.example`, or to verify production environments contain all required keys.\n\n### GitHub Actions Integration\nAdd the following step to your `.github/workflows/ci.yml`. Because EnvMaster natively detects GitHub Actions, it automatically formats errors as workflow annotations:\n\n```yaml\nname: CI\n\non:\n  pull_request:\n    branches: [ main, master ]\n\njobs:\n  validate-env:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      \n      - name: Setup Node.js\n        uses: actions/setup-node@v4\n        with:\n          node-version: 20\n          \n      - name: Install dependencies\n        run: npm ci\n        \n      - name: Verify Environment Variables\n        run: npx @amtstack/envmaster ci\n```\n\n### GitLab CI Integration\n```yaml\nvalidate_env:\n  stage: test\n  image: node:20\n  script:\n    - npm ci\n    - npx @amtstack/envmaster ci\n```\n\n---\n\n## 🔀 Programmatic API\n\nEnvMaster exposes its underlying engines for use in custom scripts, build tools, or server side processes.\n\n```typescript\nimport { scan, validate, parseEnvFile, exportEnv } from '@amtstack/envmaster';\n\nasync function runCustomTool() {\n  // 1. Scan the project files for environment variables\n  const scanResult = await scan({\n    rootDir: process.cwd(),\n    scanMode: 'ast'\n  });\n  console.log(`Found ${scanResult.variables.length} environment variables.`);\n\n  // 2. Parse a local env file\n  const envFile = await parseEnvFile('.env');\n\n  // 3. Programmatically export env values into JSON, YAML, or TOML\n  await exportEnv(envFile, 'json', './dist/config.json');\n  await exportEnv(envFile, 'yaml', './dist/config.yaml');\n  await exportEnv(envFile, 'toml', './dist/config.toml');\n\n  // 4. Validate the env values against scanned variables\n  const validationReport = await validate(scanResult.variables, envFile.variables);\n  console.log(`Passed: ${validationReport.passed}, Failed: ${validationReport.failed}`);\n}\n\nrunCustomTool();\n```\n\n---\n\n## 🛡️ Security Audit Rules\n\nWhen running `envmaster doctor` or when `security.enabled` is set to `true`, your env files are audited against these default rules:\n\n1. **Length Check**: Any key matched as a secret (containing `API_KEY`, `SECRET`, `TOKEN`, `PASSWORD` etc.) must be at least 16 characters long.\n2. **Entropy & Weak Secrets**: Flags common values like `123456`, `password`, `secret`, `admin`, or keys matching the variable name.\n3. **Placeholder Check**: Detects common placeholder text such as `your-key-here`, `TODO`, `xxx`, `<insert-here>`.\n4. **Accidental Exposure Check**: Flags files containing private key headers (such as `-----BEGIN PRIVATE KEY-----`) or long un-hashed keys that might have been copied by mistake.\n\n---\n\n## 📄 License & Attribution\n\nEnvMaster is open-source software licensed under the [MIT License](LICENSE).\n\nDeveloped with ❤️ by **[Abdullah Al Mubin](https://mubin.amtstack.com)** at **[AmtStack](https://amtstack.com)**.\n","readmeFilename":"README.md"}