env-pro
Smart Environment Variable Manager CLI - Manage environment variables with multi-profile support, encryption, validation, and template generation.
Features
- Multi-profile Management: Create, switch, and manage multiple environment profiles (dev, staging, prod)
- AES-256 Encryption: Encrypt sensitive values using AES-256-GCM encryption with secure key derivation
- Schema Validation: Validate environment variables against JSON Schema or Pydantic models
- Template Generation: Generate .env files for new projects
from templates with scaffolding- Profile Commands: Commands to scaffold, list, switch, and diff environment profiles
- Encrypt/Decrypt Operations: Encrypt and decrypt individual values or entire files with key management
- Interactive Editor: Interactive mode for adding/editing variables with prompts and validation
- GitOps Integration: Generate .gitignore entries and SOPS/age integration for secrets
Installation
From PyPI (recommended)
From source
Quick Start
Initialize a project
Create a profile
Add variables
List variables
Commands
Core Commands
| Command |
Description |
env-pro init |
Initialize env-pro in current directory |
env-pro add KEY VALUE |
Add a new environment variable |
env-pro set KEY VALUE |
Set or update a variable |
env-pro get KEY |
Get a variable value |
env-pro list |
List all variables |
env-pro delete KEY |
Delete a variable |
Profile Commands
| Command |
Description |
env-pro profile create NAME |
Create a new profile |
env-pro profile list |
List all profiles |
env-pro profile use NAME |
Set active profile |
env-pro profile switch NAME |
Switch to a profile |
env-pro profile delete NAME |
Delete a profile |
env-pro profile diff PROFILE1 PROFILE2 |
Compare two profiles |
Encryption Commands
| Command |
Description |
env-pro key generate |
Generate a new encryption key |
env-pro key rotate |
Rotate the encryption key |
env-pro key show |
Show key status |
env-pro encrypt value VALUE |
Encrypt a value |
env-pro decrypt VALUE |
Decrypt a value |
Template Commands
| Command |
Description |
env-pro template list |
List available templates |
env-pro template show NAME |
Show template details |
env-pro template apply NAME |
Apply a template |
env-pro template create NAME |
Create a custom template |
Validation Commands
| Command |
Description |
env-pro validate |
Validate against schema |
env-pro check |
Check required variables |
Utility Commands
| Command |
Description |
env-pro gitignore |
Generate .gitignore entries |
env-pro example |
Generate .env.example |
env-pro export |
Export variables |
env-pro sops |
Show SOPS integration info |
Configuration
Environment Variables
| Variable |
Description |
ENV_PRO_KEY |
Override encryption key (not recommended) |
ENV_PRO_HOME |
Custom config home directory |
ENV_PRO_PROFILE |
Override active profile |
EDITOR |
Editor for interactive editing |
Configuration Files
| File |
Purpose |
~/.config/env-pro/config.yaml |
Global configuration |
.env-profiles/{profile}/.env |
Environment variables per profile |
.env-profiles/.active |
Active profile tracking |
.env.schema.yaml |
Schema validation file |
Templates
Built-in templates:
fastapi - FastAPI Python application
django - Django Python application
nodejs - Node.js application
python - Generic Python application
golang - Go application
minimal - Minimal .env template
Encryption
env-pro uses AES-256-GCM encryption with PBKDF2 key derivation:
- Generate a key:
env-pro key generate
- Encrypt values:
env-pro add SECRET value --encrypt
- Key is stored securely in system keyring
Schema Validation
Create .env.schema.yaml in your project root:
Then validate with env-pro validate.
GitOps Integration
For GitOps workflows with encrypted secrets:
Examples
Development Setup
Production Deployment
Profile Comparison
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
pytest tests/ -v
- Submit a pull request
License
MIT License - see LICENSE file for details.