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.productionSetting 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 listOutput:
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_KEYAutomatically Injected Variables
When you link a database or storage bucket to a project, environment variables are injected automatically:
| Service | Variable | Example |
|---|---|---|
| PostgreSQL | DATABASE_URL | postgresql://u_mydb:pass@host:5432/db_mydb |
| Redis | REDIS_URL | redis://:pass@host:6379 |
| MongoDB | MONGODB_URL | mongodb://u_mydb:pass@host:27017/db_mydb |
| Storage | S3_ENDPOINT | https://s3.espace-tech.com |
| Storage | S3_ACCESS_KEY | GK... |
| Storage | S3_SECRET_KEY | ... |
| Storage | S3_BUCKET | bucket-name |