Problem
In team environments, codebase updates frequently introduce new environment variables into .env.example that teammates do not realize are missing from their local .env. Additionally, creating a .env.example from an existing .env manually is error-prone and risks leaking secrets.
Proposed Solution
Add subcommands to validate synchronization (exenv check), lint template syntax (exenv lint), and generate sanitized example files from existing .env files (exenv init).
Expected Behavior
exenv check: Compares .env against the template file. Returns non-zero exit code if required variables are missing or unconfigured (ideal for git pre-commit hooks and CI).
exenv lint: Validates template files for duplicate keys, syntax errors, and malformed annotations.
exenv init: Reads an existing .env file, sanitizes secret values into empty placeholders, detects obvious secret keys, and outputs a clean .env.example.
Acceptance Criteria
exenv check produces clear human-readable output of missing vs present variables and supports silent exit codes (--quiet).
exenv init never outputs sensitive plaintext secret values into the generated template.
- Commands run fast without interactive prompts unless explicitly requested.
Problem
In team environments, codebase updates frequently introduce new environment variables into
.env.examplethat teammates do not realize are missing from their local.env. Additionally, creating a.env.examplefrom an existing.envmanually is error-prone and risks leaking secrets.Proposed Solution
Add subcommands to validate synchronization (
exenv check), lint template syntax (exenv lint), and generate sanitized example files from existing.envfiles (exenv init).Expected Behavior
exenv check: Compares.envagainst the template file. Returns non-zero exit code if required variables are missing or unconfigured (ideal for git pre-commit hooks and CI).exenv lint: Validates template files for duplicate keys, syntax errors, and malformed annotations.exenv init: Reads an existing.envfile, sanitizes secret values into empty placeholders, detects obvious secret keys, and outputs a clean.env.example.Acceptance Criteria
exenv checkproduces clear human-readable output of missing vs present variables and supports silent exit codes (--quiet).exenv initnever outputs sensitive plaintext secret values into the generated template.