`clienvy` is a lightweight CLI tool that **automatically detects hardcoded secrets**, replaces them with **environment variables**, and **generates `.env` and `.env.template` files** — all with a single command.
npm install clienvyclienvy is a lightweight CLI tool that automatically detects hardcoded secrets, replaces them with environment variables, and generates .env and .env.template files — all with a single command.
.env consistency before each commit.
process.env.KEY or import.meta.env.KEY.
.env and .env.template automatically.
bash
npm install -g clienvy
`
verify Installation
`bash
clienvy --version
`
---
🛠️ Commands
$3
Full setup: extract, replace, generate env files, and install Git hook.
$3
Checks if .env exists and verifies that all keys are present and used correctly.
$3
Extracts secrets from your code without replacing or generating files.
$3
Replaces hardcoded secrets in your code with environment variable references.
$3
Generates .env and .env.template files from extracted secrets.
---
RoadMap:
Run full setup once:
`bash
clienvy init
`
Later, when you add new secrets:
`bash
- clienvy extract
- clienvy generate
- clienvy replace
`
Use clienv check to verify .env correctness before commits (or rely on the Git hook):
`bash
clienvy check
``