Skip to main content

Environment variable validator and manager

Project description

envaudit

Environment variable validator and manager.

Check, validate, compare, and manage environment variables from the command line.

Installation

pip install envaudit-cli

Usage

Validate a .env file

envaudit validate .env
# ✓ .env is valid (12 variables)

envaudit validate broken.env
# ✗ broken.env has 2 error(s):
#   • Line 3: Missing '=' in 'INVALID_LINE'
#   • Line 7: Invalid variable name '123BAD'

Check required variables

envaudit required DATABASE_URL API_KEY SECRET
# ✗ Missing 1 required variable(s):
#   • SECRET

# Also check a .env file
envaudit required DATABASE_URL -f .env

Compare .env against template

envaudit compare .env.example .env
# ✗ Missing 2 variable(s) from .env.example:
#   • NEW_FEATURE_FLAG
#   • ANALYTICS_KEY
# ⚠ 1 extra variable(s) not in .env.example:
#   • DEBUG

Generate export statements

# For bash/zsh
eval "$(envaudit export .env)"

# For fish
envaudit export .env --shell fish | source

# For PowerShell
envaudit export .env --shell powershell | Invoke-Expression

Show .env contents (with masking)

envaudit show .env
# DATABASE_URL=postgres://localhost:5432/myapp
# API_KEY=sk-1***************
# DEBUG=true

Get a single variable

envaudit get DATABASE_URL
# postgres://localhost:5432/myapp

envaudit get MISSING --default "fallback"
# fallback

Dump environment variables

# All variables
envaudit dump

# Filter by pattern
envaudit dump -f "AWS|AZURE"

# Show without masking
envaudit dump --no-mask

Security audit

envaudit audit .env
# Auditing: .env (12 variables)
#
# [WARNING] 2 variable(s) have empty values
#   • OPTIONAL_KEY
#   • LEGACY_TOKEN
#
# [WARNING] 1 variable(s) appear to have placeholder values
#   • API_URL
#
# [INFO] 4 variable(s) appear to contain sensitive data
#   • API_KEY
#   • SECRET_TOKEN
#   • DATABASE_PASSWORD
#   • JWT_SECRET

JSON Output

All commands support --json for machine-readable output:

envaudit validate .env --json
{
  "file": ".env",
  "valid": true,
  "variables": 12,
  "errors": []
}

For AI Agents

See SKILL.md for agent-optimized documentation.

License

MIT

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

envaudit-0.1.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

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

envaudit-0.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for envaudit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ae248a8b7ae00fc09c427cf4ee39b5bae37cd93468ae308be98585e008a52e11
MD5 d099b45860c30a4da6b750a5c4657821
BLAKE2b-256 d24119fb943e94c90fa34bef85cd9646cdcb842a22eabeb88d009643c605ac64

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for envaudit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3f8a503a73af3c222f39430b4435490949ef90b1c0fb9f98ec423ad3c4a796f7
MD5 be9fc2e6ae65941e976c33ea2eef1413
BLAKE2b-256 c15752b839b5b21faa5f4bb1cabd4916a56cf36b615ec63d98c53cb5a078027f

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