dotvet 🛡️
Zero-config environment variable security scanner & quality gate.
Validate presence, ban dangerous placeholders, and enforce secret entropy before deploying to production.
⚡ 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:
- 🔍 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. - 🚫 Placeholder eradication: Detects and bans dummy defaults like
"changeme","your-secret-here","dummy","admin", or"123456". - 🔐 JWT-aware strictness: Any secret matching
JWTorJWT_SECRETmust be at least 32 characters (256-bit) ordotvethalts the build. - 🎲 Entropy calculation: Audits sensitive keys using Shannon entropy to catch repetitive and trivial strings.
- 📜 Schema generation: Generates
.env.schema.jsonand.env.examplein a single command. - 🌐 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"
📦 Publishing Tonight
Publish to npm
npm publish --access public
Publish to PyPI
python3 -m pip install --upgrade build twine
python3 -m build
python3 -m twine upload dist/*
🔒 Why Zero Dependencies?
Recent attacks on the open-source supply chain (such as the ChainDrop worm) 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 language standard libraries, guaranteeing:
- Sub-200ms cold startup in CI.
- Zero transitive supply chain attack surface.
- Immunity to package manager lifecycle hook breaking changes (e.g. npm v12).
🏢 Created by EthicCode Technologies
dotvet is an open-source initiative designed, built, and maintained by EthicCode Technologies.
- Website: ethiccode.in/dotvet
- Contact: contact@ethiccode.in
📄 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dotvet-0.1.3.tar.gz.
File metadata
- Download URL: dotvet-0.1.3.tar.gz
- Upload date:
- Size: 20.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8f8bbe1dab0e7cbe63fe75d70ff75e91dc40a537373aab0f6e792402ba47d82
|
|
| MD5 |
0ef101610be0a667c73f1030d47f77e9
|
|
| BLAKE2b-256 |
811cc80b681fa0239eaf1ae9de745e75836fd9cd98fd708b18c4dc5cf00aaa69
|
File details
Details for the file dotvet-0.1.3-py3-none-any.whl.
File metadata
- Download URL: dotvet-0.1.3-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9517b549475246ba0b60c78bcbae315b99315769400bb551a5122cc79137c1ef
|
|
| MD5 |
5cfef5035cb9d17aed4c86a552dbaed2
|
|
| BLAKE2b-256 |
e314b545431d31b1f715ccf94dcae9cb71021ec21014dcea1dcb08873f0c5d7c
|