Skip to main content

A beautiful TUI for managing .env files — like lazygit for environment variables

Project description

lazyenv

A beautiful, lazygit-inspired TUI for managing .env files.

PyPI version Python 3.10+ CI License: MIT Downloads

┌──────────────────────────────────────────────────────────────────────┐
│ lazyenv                                              12:34:56        │
├─────────────────────┬────────────────────────────────────────────────┤
│ 📁 ENV FILES        │  KEY                 = VALUE                   │
│ ✓ .env              │                                                │
│ ⚠ .env.local        │  # Database                                    │
│ · .env.example      │  DATABASE_URL        = postgres://localhost/db  │
│ ✓ services/api/.env │  DB_PASSWORD         = ••••••••••••            │
│                     │                                                │
│                     │  # API Keys                                    │
│                     │  STRIPE_SECRET_KEY   = ••••••••••••            │
│                     │  OPENAI_API_KEY      = ••••••••••••            │
│                     │                                                │
│                     │  # App config                                  │
│                     │  APP_ENV             = development             │
│                     │  APP_PORT            = 3000                    │
│                     │  DEBUG               = false                   │
├─────────────────────┴────────────────────────────────────────────────┤
│ lazyenv  .env  │  4 files  │  MASK ON  │                            │
│  q Quit  d Diff  m Mask  c Copy  e Edit  / Filter  ? Help           │
└──────────────────────────────────────────────────────────────────────┘

Stop guessing which keys are missing. lazyenv gives you a real-time, searchable, side-by-side view of all your .env files — with instant diff against .env.example and secrets masked by default.

Why lazyenv?

Every developer has been there:

  • 😤 Cloned a repo, spent 20 minutes figuring out which env vars to set
  • 😤 Deployed to staging and got a cryptic error because one key was missing
  • 😤 Shared your .env with a teammate and accidentally included a secret
  • 😤 Lost track of which keys are in .env vs .env.local vs .env.production

lazyenv fixes all of this.

Features

  • Beautiful TUI — keyboard-driven interface inspired by lazygit
  • Auto-discovery — finds all .env* files recursively in your project
  • Secrets masking — sensitive keys (API_KEY, SECRET, PASSWORD, etc.) are masked by default
  • Side-by-side diff — instantly compare any two .env files
  • Validation — highlights missing/extra/changed keys vs .env.example
  • Live search — filter keys in real-time with /
  • Copy to clipboardc copies the selected value
  • Open in editore opens the file in your $EDITOR
  • CLI mode — non-interactive --diff and --validate commands for CI pipelines
  • Cross-platform — Windows, macOS, Linux

Installation

# pip
pip install lazyenv

# uv (recommended)
uv tool install lazyenv

# pipx
pipx install lazyenv

One-liner (no install)

uvx lazyenv

Pre-built binaries

Download from the latest release — no Python required.

Usage

# Open TUI in current directory
lazyenv

# Open TUI in a specific project
lazyenv /path/to/my/project

# Short alias
le

# List all .env files (no TUI)
lazyenv --list

# Diff two files (CI-friendly, exits 1 if different)
lazyenv --diff .env .env.example

# Validate .env against .env.example
lazyenv --validate .env .env.example

Keyboard Reference

Key Action
↑/↓ Navigate
Tab Switch panel (file list ↔ content)
d Toggle diff view
m Toggle secret masking
/ or f Filter keys
c Copy selected value to clipboard
e Open in $EDITOR
r Reload all files
? Help
q Quit

Diff View

Press d to enter diff mode. lazyenv automatically selects .env.example (or .env.sample) as the reference.

┌──────────────────┬─────────────────────────┬─────────────────────────┐
│ KEY              │ REFERENCE (.env.example)│ CURRENT (.env)          │
├──────────────────┼─────────────────────────┼─────────────────────────┤
│   DATABASE_URL   │ postgres://localhost/db  │ postgres://localhost/db  │
│ ✗ STRIPE_KEY     │ (empty)                 │ (absent)                │
│ ~ APP_PORT       │ 3000                    │ 8080                    │
│ + INTERNAL_FLAG  │ (absent)                │ true                    │
└──────────────────┴─────────────────────────┴─────────────────────────┘
  ✗ 1 missing  ~ 1 changed  + 1 extra  ✓ 8 matching

CLI Mode (CI Integration)

# In your CI pipeline — exits with code 1 if .env is missing keys
lazyenv --validate .env .env.example

# In a Makefile
check-env:
    lazyenv --validate .env .env.example

Contributing

lazyenv is actively looking for contributors! Great first issues:

  • Add support for additional secret key patterns
  • Shell completion (bash, zsh, fish)
  • Theme support (light mode)
  • Integration with Doppler / Infisical
  • .env schema definition files (type validation)
  • Export to Docker --env-file format

See CONTRIBUTING.md for setup instructions.

Roadmap

See ROADMAP.md.

License

MIT — see LICENSE.


Made with ♥ by the lazyenv community · Report a bug · Discussions

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lazyenv_tui-0.1.0.tar.gz (39.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lazyenv_tui-0.1.0-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file lazyenv_tui-0.1.0.tar.gz.

File metadata

  • Download URL: lazyenv_tui-0.1.0.tar.gz
  • Upload date:
  • Size: 39.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for lazyenv_tui-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9b4481a5dc493e975fc18bd413cb1145ee4536e2124feccdcfcffc2b25fb2431
MD5 6e19b21690347b83331b52f9ef31df03
BLAKE2b-256 8403aeb766d81f775317a6072d84b53ffbd6c25e790af91ba8596fc129c5e427

See more details on using hashes here.

File details

Details for the file lazyenv_tui-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: lazyenv_tui-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for lazyenv_tui-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 58650011edeb1c50a578c05db14138aae5f8f9fabe9eeb659b3f376b5bcf2a57
MD5 ddc0e691ee98ee066d6479bcea9c6d5f
BLAKE2b-256 e2a745336122954e52dc5409f20924be380ced85fbe4c794350744f84439690a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page