ev scan

Usage

ev scan
ev scan --show-files

Description

Recursively scans your codebase for environment variable references and checks which ones exist in each remote environment. Also shows local .env coverage alongside remote environments so you can see gaps at a glance. Catches missing variables before they cause runtime errors.

Run from the repo root to scan all apps. Run from an app subdirectory to scope the scan to that app only.

Supported Languages

ev scan detects env var patterns in:

  • Node.jsprocess.env.VAR, process.env["VAR"]
  • Pythonos.environ["VAR"], os.environ.get("VAR")
  • Goos.Getenv("VAR")
  • RubyENV["VAR"]
  • PHPenv("VAR")
  • JavaSystem.getenv("VAR")
  • Ruststd::env::var("VAR")
  • Viteimport.meta.env.VAR

Flags

FlagDescription
--show-filesShow which files reference each variable

Example Output

  Variable        .env      dev       staging   prod
  ───────────────────────────────────────────────────
  DB_HOST         ✓         ✓         ✓         ✓
  DB_PORT         ✓         ✓         ✓         ✓
  STRIPE_KEY      ✓         ✓         ✗         ✗
  WEBHOOK_SECRET  ✗         ✗         ✗         ✗

  2 variables missing in at least one environment.

With --show-files:

  STRIPE_KEY      ✓         ✗         ✗
    → src/payments/stripe.ts
    → src/api/webhooks.ts

Use in CI

Add to your pipeline to block deploys with missing variables:

- run: ev scan
  env:
    EV_API_KEY: ${{ secrets.EV_API_KEY }}
    EV_API_URL: https://api.git-env.com

On this page