envy is a CLI tool that simplifies environment variable management by syncing between local .env files and AWS Parameter Store/Secrets Manager.
- Bidirectional Sync: Push local
.envfiles to AWS or pull from AWS to local - Multi-Environment Support: Seamlessly manage development, staging, and production environments
- Secure Storage: Leverage AWS Parameter Store and Secrets Manager for secure variable storage
- Smart Path Mapping: Automatically map
.envfile types to AWS parameter hierarchies - Easy to Use: Intuitive interface and simple commands
- Flexible Configuration: Configure once with
.envyrc, use anywhere - High Performance: Fast upload/download with parallel processing
- Security First: Automatic file permission settings and secure communication
- Visual Feedback: Color output and progress bars to track progress
- Interactive Mode: Interactive prompts with arrow key navigation
brew tap drapon/tap
brew install envygo install github.com/drapon/envy@latestDownload the latest version from the releases page.
docker pull drapon/envy:latest-
Initialize your project
envy init
Automatically detects existing
.envfiles and initializes the project. -
Push to AWS
envy push
Uploads variables from the default environment to AWS. First time use includes interactive overwrite confirmation.
-
Pull from AWS
envy pull
Downloads environment variables from AWS and saves them to local files.
-
Work with other environments
envy push --env prod envy pull --env staging
envy init- Initialize a new projectenvy configure- Interactive configuration wizardenvy push- Upload local .env files to AWSenvy pull- Download environment variables from AWSenvy list- List available environment variablesenvy diff- Show differences between local and remoteenvy run- Run commands with injected environment variablesenvy validate- Validate environment variablesenvy export- Export environment variables in various formatsenvy cache- Manage cache
# Initialize project with automatic .env file detection
envy init
# Push with interactive overwrite confirmation
envy push
# Push all environments at once
envy push --all
# Push with progress bar (force overwrite)
envy push --env prod --force
# Pull with automatic environment detection
envy pull
# Pull with backup
envy pull --env prod --backup
# Show differences between local and remote
envy diff --env staging
# List variables with color coding
envy list --env dev
# Run command with environment variables
envy run --env dev npm start
# Export as shell script
envy export --env prod --format shell > prod.sh
# Validate configuration
envy validate- Color Output: Success in green, errors in red, warnings in yellow
- Progress Bars: Real-time progress display during push/pull operations
- Interactive Overwrite Confirmation: Select individually with arrow keys
- Clean Log Output: Show detailed logs with
--verboseflag - Existing File Detection:
initcommand automatically detects existing.envfiles - Duplicate and Empty Value Checks: Automatically detect and handle issues appropriately
Create a .envyrc file in your project root:
project: myapp
default_environment: dev
aws:
service: parameter_store # or secrets_manager
region: ap-northeast-1
profile: default
environments:
dev:
files:
- .env.dev
- .env.dev.local
path: /myapp/dev/
staging:
files:
- .env.staging
path: /myapp/staging/
prod:
files:
- .env.prod
path: /myapp/prod/
use_secrets_manager: true
production.local: # Supports environment names with dots
files:
- .env.production.local
path: /myapp/production.local/Ensure your AWS credentials have the following permissions:
ssm:GetParameterssm:GetParametersssm:GetParametersByPathssm:PutParameterssm:DeleteParameter
secretsmanager:GetSecretValuesecretsmanager:CreateSecretsecretsmanager:UpdateSecretsecretsmanager:DeleteSecretsecretsmanager:ListSecrets
kms:Decryptkms:GenerateDataKey
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ssm:GetParameter*",
"ssm:PutParameter",
"ssm:DeleteParameter",
"secretsmanager:GetSecretValue",
"secretsmanager:CreateSecret",
"secretsmanager:UpdateSecret"
],
"Resource": "*"
}
]
}Contributions are welcome! Please read our Contributing Guidelines for details.
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Cobra for CLI framework
- Configuration management by Viper
- AWS integration using AWS SDK for Go v2
-
Cache Error:
invalid cached config typerm -rf ~/.envy/cache/*
-
Environment Name Not Recognized: Environment names with dots (e.g.,
production.local) are supported -
Permission Error: Grant execute permission
chmod +x envy