envrizz
v2.0.2
Published
Give your .env files that rizz - sync them with AWS Secrets Manager
Maintainers
Readme
EnvRizz 🔥
Give your .env files that rizz! Sync them with AWS Secrets Manager and never lose your environment variables again. Your env files deserve better than being gitignored into oblivion.
Installation
npm install envrizzQuick Start
1. Initialize your project
npx envrizz init --project "my-project-name"2. Push your .env files to AWS
npx envrizz pushThis will upload all your .env files to AWS Secrets Manager.
3. Pull .env files from AWS (on another machine or for a teammate)
npx envrizz pullCommands
envrizz push
Upload all .env files to AWS Secrets Manager
npx envrizz push [options]
Options:
-p, --project <name> Project name for the secret
-r, --region <region> AWS region (default: us-east-1)
--profile <profile> AWS SSO profileenvrizz pull
Download .env files from AWS Secrets Manager
npx envrizz pull [options]
Options:
-p, --project <name> Project name for the secret
-o, --overwrite Overwrite existing .env files
-r, --region <region> AWS region
--profile <profile> AWS SSO profileenvrizz list
Preview what variables would be synced
npx envrizz listenvrizz install-hook
Install git pre-push hook to auto-sync before pushing
npx envrizz install-hookConfiguration
Create a .envrizz.json file in your project root:
{
"projectName": "my-project",
"awsRegion": "us-east-1",
"awsProfile": "your-aws-profile",
"awsAccountId": "your-account-id",
"exclude": [".env.example", ".env.sample"],
"include": [".env", ".env.*"]
}How It Works
- The tool scans for all
.envfiles in your project root - It parses each file and creates a mapping like:
.env.PORT=3000,.env.local.API_URL=https://api.example.com - These are stored as a single JSON secret in AWS Secrets Manager with your project name
- When pulling, it recreates the original file structure from the stored mappings
AWS Setup
Make sure you have:
- AWS CLI configured
- AWS credentials with permissions to read/write Secrets Manager
# For SSO profiles:
aws sso login --profile your-profile
# Or configure AWS credentials:
aws configureExample
For a project "catfish" with:
.envcontainingPORT=3333.env.localcontainingURL=www.cnn.com
The AWS Secret "catfish" will store:
{
".env.PORT": "3333",
".env.local.URL": "www.cnn.com"
}