{"_id":"@alexdruk/envguard-cli","name":"@alexdruk/envguard-cli","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@alexdruk/envguard-cli","version":"0.1.0","description":"ESLint for environment variables — enforce .env.schema documentation in your codebase","main":"src/index.js","bin":{"envguard":"src/index.js"},"scripts":{"test":"node --test tests/*.test.js","test:watch":"node --test --watch tests/*.test.js","prepublishOnly":"npm test"},"keywords":["env","environment-variables","dotenv","linter","cli","ci","github-actions","devtools","documentation","schema"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/alexdruk/envguard.git","directory":"packages/cli"},"homepage":"https://github.com/alexdruk/envguard#readme","bugs":{"url":"https://github.com/alexdruk/envguard/issues"},"dependencies":{"commander":"^12.0.0","glob":"^10.3.0","js-yaml":"^4.1.0"},"devDependencies":{"@types/node":"^20.0.0"},"engines":{"node":">=18.0.0"},"_id":"@alexdruk/envguard-cli@0.1.0","gitHead":"3dc869bc24c0b79e7568d6e444a91cd3ea5eadc1","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-l+KBtRc1wqPukTMhYKsuWEuENHCd+BUZzbvXMA8hpqkbuh6JwFLoeT4GfdqZgW5iXkEOVofe8XAmKnpUr3Z0Iw==","shasum":"1ae43c9affb3521176bdafc847b115399a50f843","tarball":"https://registry.npmjs.org/@alexdruk/envguard-cli/-/envguard-cli-0.1.0.tgz","fileCount":11,"unpackedSize":35969,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEQr0F+RiUdTsZCOGBZolnVGOMlBuvztCHdSV4Z4L5mWAiEAzOc0rT6SGWMpXN5S0z4sbe1yCg2JZ2PDbSlfM8QJZLo="}]},"_npmUser":{"name":"alexdruk","email":"alex.druk@gmail.com"},"directories":{},"maintainers":[{"name":"alexdruk","email":"alex.druk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/envguard-cli_0.1.0_1778316747777_0.7805293990841284"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-09T08:52:27.684Z","0.1.0":"2026-05-09T08:52:27.923Z","modified":"2026-05-09T08:52:28.104Z"},"maintainers":[{"name":"alexdruk","email":"alex.druk@gmail.com"}],"description":"ESLint for environment variables — enforce .env.schema documentation in your codebase","homepage":"https://github.com/alexdruk/envguard#readme","keywords":["env","environment-variables","dotenv","linter","cli","ci","github-actions","devtools","documentation","schema"],"repository":{"type":"git","url":"git+https://github.com/alexdruk/envguard.git","directory":"packages/cli"},"bugs":{"url":"https://github.com/alexdruk/envguard/issues"},"license":"MIT","readme":"# @envguard/cli\n\n> **ESLint for environment variables.** Catches undocumented `process.env` references before they ship.\n\n[![npm version](https://img.shields.io/npm/v/@envguard/cli.svg)](https://www.npmjs.com/package/@envguard/cli)\n[![CI](https://github.com/alexdruk/envguard/actions/workflows/ci.yml/badge.svg)](https://github.com/alexdruk/envguard/actions/workflows/ci.yml)\n[![node](https://img.shields.io/node/v/@envguard/cli.svg)](https://www.npmjs.com/package/@envguard/cli)\n[![license](https://img.shields.io/npm/l/@envguard/cli.svg)](https://github.com/alexdruk/envguard/blob/main/LICENSE)\n\n---\n\n## The problem\n\nA developer adds `process.env.PAYMENT_WEBHOOK_SECRET` to the codebase. It works on their machine. It silently breaks in staging because nobody documented it, nobody added it to `.env.example`, and the next person to set up the project has no idea it exists.\n\nEnvGuard makes this impossible to merge.\n\n---\n\n## How it works\n\nYou commit a `.env.schema` file — one entry per environment variable your app uses:\n\n```yaml\n# .env.schema\nDATABASE_URL:\n  description: PostgreSQL connection string\n  required: true\n  example: postgres://user:pass@host:5432/dbname\n\nSTRIPE_SECRET_KEY:\n  description: Stripe secret key for payment processing\n  required: true\n  example: sk_test_...\n\nREDIS_URL:\n  description: Redis connection string for caching\n  required: false\n  example: redis://localhost:6379\n```\n\nEnvGuard scans your source code for `process.env.VAR` references and fails if any are missing from `.env.schema`.\n\n---\n\n## Quickstart\n\n```bash\n# Step 1: scan your codebase and generate .env.schema\nnpx @envguard/cli init\n\n# Step 2: fill in the descriptions, then check everything is documented\nnpx @envguard/cli check\n```\n\n`init` takes ~2 seconds. It scans every `.js`, `.ts`, `.py`, and `.rb` file and generates `.env.schema` with an entry for every variable it finds. You fill in the descriptions and commit the file.\n\nFrom that point on, `check` exits with code `1` if any new reference appears without a schema entry — which means you can drop it directly into any CI pipeline.\n\n---\n\n## CLI reference\n\n### `npx @envguard/cli init`\n\nScans the codebase. Generates or updates `.env.schema`. Existing entries are preserved — only new variables are added.\n\n```\nOptions:\n  -d, --dir <path>   Directory to scan (default: current directory)\n```\n\n### `npx @envguard/cli check`\n\nReads `.env.schema`. Scans the codebase. Reports undocumented references. Exits `1` on violations.\n\n```\nOptions:\n  -d, --dir <path>   Directory to check (default: current directory)\n  --strict           Also flag entries with missing descriptions or examples\n```\n\n---\n\n## Use in CI\n\n### GitHub Actions\n\n```yaml\n# .github/workflows/envguard.yml\nname: EnvGuard\non: [pull_request]\njobs:\n  check:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - run: npx @envguard/cli check\n```\n\n### Any other CI (GitLab, CircleCI, Bitbucket Pipelines...)\n\n```bash\nnpx @envguard/cli check   # exit 0 = pass, exit 1 = violations\n```\n\n---\n\n## Supported languages\n\n| Language | Patterns detected |\n|---|---|\n| JavaScript / TypeScript | `process.env.VAR`, `process.env['VAR']`, `import.meta.env.VAR` |\n| Python | `os.environ['VAR']`, `os.environ.get('VAR')`, `os.getenv('VAR')` |\n| Ruby | `ENV['VAR']`, `ENV.fetch('VAR')`, `ENV.dig('VAR')` |\n\n---\n\n## What gets published to npm\n\nOnly the runtime files:\n\n```\n@envguard/cli\n├── src/\n│   ├── index.js          ← CLI entry point\n│   ├── schema.js         ← .env.schema parser/writer\n│   ├── colours.js        ← terminal output\n│   ├── commands/\n│   │   ├── init.js\n│   │   └── check.js\n│   └── scanner/\n│       ├── index.js      ← orchestrator + diff scanner\n│       ├── js.js         ← JavaScript/TypeScript\n│       ├── python.js     ← Python\n│       └── ruby.js       ← Ruby\n└── README.md\n```\n\nTests and fixtures are not included in the published package.\n\n---\n\n## Links\n\n- **GitHub:** https://github.com/alexdruk/envguard\n- **Issues:** https://github.com/alexdruk/envguard/issues\n- **Changelog:** https://github.com/alexdruk/envguard/blob/main/CHANGELOG.md\n\n---\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-6a1d71f74e1b38678af37f3a56a2ea4d"}