Environments

Manage different environments like development, staging, and production.

Redenv supports multiple environments to keep your secrets organized and secure.

Default Environments#

By default, Redenv creates these environments:

  • development - Local development secrets
  • staging - Pre-production testing
  • production - Live application secrets

Using Environments#

Setting Secrets#

# Development (default)
redenv set API_KEY "dev-key"

# Production
redenv set API_KEY "prod-key" --env production

Listing Secrets#

# List development secrets
redenv list

# List production secrets
redenv list --env production

Running with Environments#

# Run with production secrets
redenv run --env production -- node app.js

Custom Environments#

Create custom environments as needed:

redenv set API_KEY "test-key" --env testing
redenv set API_KEY "demo-key" --env demo

Best Practices#

  • Keep production secrets separate from development
  • Use staging to test with production-like data
  • Never commit environment-specific secrets to version control