Skip to main content

dotvet 🛡️

Zero-config environment variable security scanner & quality gate.

Validate presence, ban dangerous placeholders, and enforce secret entropy before deploying to production.

npm version PyPI version License: MIT Zero Dependencies


⚡ The Problem: dotenv-safe Is Not Safe

Most tools (dotenv-safe, envalid, zod) only verify that a variable exists:

# Passes dotenv-safe with flying colors:
JWT_SECRET=changeme
API_KEY=your-secret-here

In production, a weak secret is worse than a missing secret. Undersized JWT secrets (< 32 characters) allow attackers to forge tokens with HS256 brute-force dictionaries in seconds.

dotvet does what other linters don't:

  1. 🔍 Zero config: Auto-scans your codebase (process.env.X, os.environ.get('X'), os.getenv('X'), import.meta.env.X, etc.) to find every environment variable you actually reference.
  2. 🚫 Placeholder eradication: Detects and bans dummy defaults like "changeme", "your-secret-here", "dummy", "admin", or "123456".
  3. 🔐 JWT-aware strictness: Any secret matching JWT or JWT_SECRET must be at least 32 characters (256-bit) or dotvet halts the build.
  4. 🎲 Entropy calculation: Audits sensitive keys using Shannon entropy to catch repetitive and trivial strings.
  5. 📜 Schema generation: Generates .env.schema.json and .env.example in a single command.
  6. 🌐 Dual-ecosystem & zero dependencies: Works natively across Node.js (npx dotvet) and Python (pip install dotvet) with zero third-party dependencies.

🚀 Quickstart

In Node.js / TypeScript Projects

Run immediately without installing:

npx dotvet

Or install as a dev dependency:

npm install --save-dev dotvet
# or
pnpm add -D dotvet
# or
yarn add -D dotvet

In Python Projects

pip install dotvet
dotvet

💻 CLI Commands

1. dotvet / dotvet check (Default)

Audits .env against variables referenced in your code:

npx dotvet
# or
dotvet check --env .env.production

Example Output:

dotvet v0.1.1 — Auditing environment variables in /projects/my-app
Environment file: .env (found) | Found 4 vars in code

 WARN  .env (GITIGNORE_MISSING)
  .env is present but not explicitly listed in .gitignore. Risk of committing secrets to Git!
  Fix: Add ".env" to your .gitignore file.

 FAIL  JWT_SECRET (JWT_UNDERSIZED)
  JWT secret JWT_SECRET length is only 18 chars (minimum 32 characters required for HMAC-SHA256). Weak JWT secrets can be forged in seconds!
  Referenced at:
    • src/auth.ts:12 → const token = jwt.sign(payload, process.env.JWT_SECRET);
  Fix: Generate a 32+ char secret: "openssl rand -base64 32"

 FAIL  DATABASE_URL (PLACEHOLDER_SECRET)
  Variable DATABASE_URL is set to placeholder "changeme". This is dangerous for production!
  Referenced at:
    • src/db.ts:4 → const pool = new Pool({ connectionString: process.env.DATABASE_URL });
  Fix: Replace the placeholder with a secure, generated value.

PASSED CHECKS (2):
  ✔ PORT
  ✔ REDIS_URL

 FAILURE  Found 2 errors and 1 warning.

2. dotvet scan

Inspects your entire codebase and maps out where every environment variable is used:

npx dotvet scan

Output:

dotvet scan — Discovered 3 environment variables:

  DATABASE_URL (2 usages)
    ↳ src/db.ts:4
    ↳ src/migrate.ts:10
  JWT_SECRET (1 usage)
    ↳ src/auth.ts:12
  PORT (1 usage)
    ↳ src/server.ts:8

3. dotvet generate

Automatically generates a .env.example file and .env.schema.json contract based on variables discovered across your codebase:

npx dotvet generate

🛡️ Security Rules

Rule Severity Description
MISSING_ENV_VAR FAIL Variable referenced in code is absent from .env and environment.
EMPTY_ENV_VAR FAIL Variable is defined in .env but has an empty string value.
PLACEHOLDER_SECRET FAIL Value matches known placeholder strings ("changeme", "your-secret-here", "dummy").
JWT_UNDERSIZED FAIL JWT secret is under 32 characters (violates minimum 256-bit requirement for HS256).
LOW_ENTROPY_SECRET WARN / FAIL Sensitive key has Shannon entropy < 2.5 bits/char (repeating or sequential keys).
GITIGNORE_MISSING WARN .env exists in directory but is not tracked in .gitignore.

⚙️ Options & Flags

Flag Default Description
--env <path> .env Path to environment file to audit
--strict false Treat warnings as hard errors (non-zero exit)
--ci false Emits GitHub Actions annotations (::error file=...)
--json false Emits machine-readable JSON output
-h, --help Show usage help
-v, --version Display version

🤖 CI / CD Integration (GitHub Actions)

Add dotvet as a gate in your pull request workflow:

name: Security & Env Quality Gate

on: [push, pull_request]

jobs:
  env-audit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      
      # Runs zero-config audit; fails PR if secrets are weak, missing, or placeholders
      - name: Run dotvet
        run: npx dotvet --ci --strict
        env:
          # Provide your mock test secrets
          JWT_SECRET: "ci_valid_32_character_long_secret_key_12345"
          DATABASE_URL: "postgresql://ci:ci@localhost:5432/test"
          PORT: "3000"

🔒 Why Zero Dependencies?

Recent attacks on the open-source supply chain demonstrated how deeply nested dependencies can introduce backdoors into developer tooling.

dotvet is designed from the ground up with 0 runtime dependencies in both Node.js and Python. It runs exclusively using native standard libraries, guaranteeing:

  • Sub-200ms cold startup in CI.
  • Zero transitive supply chain attack surface.
  • Full immunity to third-party package vulnerabilities.

🏢 Created by EthicCode Technologies

dotvet is an open-source initiative designed, built, and maintained by EthicCode Technologies.


📄 License

MIT © 2026 EthicCode Technologies

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dotvet-0.1.4.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dotvet-0.1.4-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file dotvet-0.1.4.tar.gz.

File metadata

  • Download URL: dotvet-0.1.4.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for dotvet-0.1.4.tar.gz
Algorithm Hash digest
SHA256 3849678f0914bed8f0941f4cbbfd2a85e351df9b7f2c3c839da5a62676a17ef9
MD5 c19c1892c569f535d24c833ac653ee6a
BLAKE2b-256 8ddac1fa8354622e28484ba650f1349fa3ebd9213f549fde145afb55fcbf3dc9

See more details on using hashes here.

File details

Details for the file dotvet-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: dotvet-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for dotvet-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 724068eecfe1b8e6a608262d14d12549d4b36879f60abf53ad9cf11aca38d33a
MD5 bfd0e22b7637fb9430141243b60c3444
BLAKE2b-256 5b3414a6cf6c74e900b10a4920608ded564bc2ef128be97411491748f7cf5ff4

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

This release

0.1.4 This release

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page