CLI
Environment Variables
Manage environment variables for your Buildspace apps.
List Variables
buildspace env list
buildspace env list --env prod
buildspace env list --jsonShows all environment variables grouped by source (Buildspace system keys and custom variables). Values are masked by default.
Set a Variable
buildspace env set KEY=VALUE
buildspace env set STRIPE_SECRET_KEY=sk_test_...
buildspace env set NEXT_PUBLIC_API_URL=https://api.example.comKeys are automatically uppercased. Variables starting with NEXT_PUBLIC_ default to non-secret.
Options
| Flag | Description |
|---|---|
--env dev|prod | Target environment (default: dev) |
--secret | Mark the variable as secret |
--no-secret | Mark the variable as non-secret |
Remove a Variable
buildspace env unset KEY
buildspace env unset STRIPE_SECRET_KEY --env prodSystem-managed variables cannot be removed.
Pull to Local File
buildspace env pull
buildspace env pull --env prod --output .env.localWrites non-secret environment variables and system keys to a local .env file. Defaults to .env.local.
Options
| Flag | Description |
|---|---|
--env dev|prod | Source environment (default: dev) |
--output <file> | Output file path (default: .env.local) |
--app <slug> | Target app |