The lua env command provides an interactive interface for managing environment variables in both sandbox (development) and production environments.
Copy
lua env # Interactive: choose environmentlua env sandbox # Direct: manage .env filelua env staging # Direct: alias for sandboxlua env production # Direct: manage production API vars
New in v2.6.0: Direct environment access lets you skip the selection prompt for faster workflows!
? What would you like to do? β Add new variable? Variable name: STRIPE_API_KEY? Variable value: sk_test_abc123π Saving...β Variable "STRIPE_API_KEY" added successfully
? What would you like to do? βοΈ Update existing variable? Select variable to update: STRIPE_API_KEY? New value for STRIPE_API_KEY: sk_test_xyz789π Saving...β Variable "STRIPE_API_KEY" updated successfully
? What would you like to do? ποΈ Delete variable? Select variable to delete: OLD_KEY? Are you sure you want to delete "OLD_KEY"? Yesπ Saving...β Variable "OLD_KEY" deleted successfully
Deletion requires confirmation to prevent accidents. Default is βNoβ.
? What would you like to do? ποΈ View variable value? Select variable to view: STRIPE_API_KEY============================================================Variable: STRIPE_API_KEY============================================================sk_test_abc123xyz789============================================================Press Enter to continue...
# Set up sandbox environment variableslua env sandbox# Add: DATABASE_URL, API_KEY, STRIPE_SECRET, etc.# Set up production environment variableslua env production# Add production API keys and URLs
$ lua env sandbox# Or interactive: lua env β Choose Sandbox============================================================π Environment Variables (Sandbox)============================================================βΉοΈ No environment variables configured.? What would you like to do? β Add new variable? Variable name: DATABASE_URL? Variable value: postgresql://localhost:5432/myappπ Saving...β Variable "DATABASE_URL" added successfully============================================================π Environment Variables (Sandbox)============================================================1. DATABASE_URL = post**********************? What would you like to do? β Add new variable? Variable name: STRIPE_KEY? Variable value: sk_test_abc123π Saving...β Variable "STRIPE_KEY" added successfully============================================================π Environment Variables (Sandbox)============================================================1. DATABASE_URL = post**********************2. STRIPE_KEY = sk-t**********************? What would you like to do? β Exitπ Goodbye!