Metadata-Version: 2.4
Name: envaudit
Version: 0.1.0
Summary: Environment variable validator and manager
Project-URL: Homepage, https://github.com/marcusbuildsthings-droid/envaudit
Project-URL: Repository, https://github.com/marcusbuildsthings-droid/envaudit
Author-email: Marcus <marcus.builds.things@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: cli,devops,dotenv,env,environment,validation
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.9
Requires-Dist: click>=8.0
Description-Content-Type: text/markdown

# envaudit

Environment variable validator and manager.

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

## Installation

```bash
pip install envaudit-cli
```

## Usage

### Validate a .env file

```bash
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

```bash
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

```bash
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

```bash
# 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)

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

### Get a single variable

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

envaudit get MISSING --default "fallback"
# fallback
```

### Dump environment variables

```bash
# All variables
envaudit dump

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

# Show without masking
envaudit dump --no-mask
```

### Security audit

```bash
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:

```bash
envaudit validate .env --json
```

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

## For AI Agents

See [SKILL.md](SKILL.md) for agent-optimized documentation.

## License

MIT
