Skip to Content
CLI ReferenceEnvironment Variables

Environment Variables

Manage environment variables for your projects. Variables are injected at runtime and encrypted at rest.

espacetech env set

Set one or more environment variables.

# Set a single variable espacetech env set DATABASE_URL=postgres://... # Set multiple variables espacetech env set API_KEY=sk-123 SECRET=my-secret # Set from a .env file espacetech env set --file .env.production

Setting environment variables triggers an automatic redeployment so your app picks up the changes.

espacetech env list

List all environment variables (values are masked).

espacetech env list

Output:

KEY VALUE DATABASE_URL postgres://u_my...**** API_KEY sk-123**** SECRET my-se****

espacetech env unset

Remove an environment variable.

espacetech env unset API_KEY

Automatically Injected Variables

When you link a database or storage bucket to a project, environment variables are injected automatically:

ServiceVariableExample
PostgreSQLDATABASE_URLpostgresql://u_mydb:pass@host:5432/db_mydb
RedisREDIS_URLredis://:pass@host:6379
MongoDBMONGODB_URLmongodb://u_mydb:pass@host:27017/db_mydb
StorageS3_ENDPOINThttps://s3.espace-tech.com
StorageS3_ACCESS_KEYGK...
StorageS3_SECRET_KEY...
StorageS3_BUCKETbucket-name