Buildspace
CLI

Environment Variables

Manage environment variables for your Buildspace apps.

List Variables

buildspace env list
buildspace env list --env prod
buildspace env list --json

Shows 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.com

Keys are automatically uppercased. Variables starting with NEXT_PUBLIC_ default to non-secret.

Options

FlagDescription
--env dev|prodTarget environment (default: dev)
--secretMark the variable as secret
--no-secretMark the variable as non-secret

Remove a Variable

buildspace env unset KEY
buildspace env unset STRIPE_SECRET_KEY --env prod

System-managed variables cannot be removed.

Pull to Local File

buildspace env pull
buildspace env pull --env prod --output .env.local

Writes non-secret environment variables and system keys to a local .env file. Defaults to .env.local.

Options

FlagDescription
--env dev|prodSource environment (default: dev)
--output <file>Output file path (default: .env.local)
--app <slug>Target app

On this page