Skip to content

feat: add check, lint, and init commands for drift detection and template generation #2

Description

@hammadmajid

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions