Variables
Manage environment variables at the environment or service level.
Variables are key-value pairs injected into services at runtime. They can be scoped at two levels:
| Scope | Description |
|---|---|
| Environment-level | Available to all services in the environment. The default when --service is omitted. |
| Service-level | Scoped to a single service, taking precedence over environment-level variables with the same name. Pass --service <slug> to operate at this level. |
The variables command can be shortened to vars or var:
edge vars list
edge var set KEY=VALUEAll variable commands require a workspace, project, and environment.
list
List variables. Defaults to environment-level; use --service for service-level.
edge variables list
edge variables list --service api
edge variables list --jsonExample output
NAME VALUE
DATABASE_URL postgres://...
REDIS_URL redis://...
NODE_ENV productionset
Set one or more variables. Pass multiple KEY=VALUE pairs in a single command.
edge variables set KEY=VALUE [KEY=VALUE ...]
edge variables set KEY=VALUE --service <svc-slug>Flags
| Flag | Description |
|---|---|
--service | Service slug. If omitted, the variable is set at the environment level. |
Examples
# Set multiple env-level variables
edge variables set \
DATABASE_URL=postgres://user:pass@host/db \
REDIS_URL=redis://host:6379 \
NODE_ENV=production
# Set a service-level variable
edge variables set API_SECRET=hunter2 --service apiVariable changes take effect on the next deployment. Run edge deploy up <svc-slug> after setting variables to apply them.
delete
Delete a variable by name.
edge variables delete <name>
edge variables delete <name> --service <svc-slug>Flags
| Flag | Description |
|---|---|
--service | Service slug. If omitted, deletes the environment-level variable. |
Example
# Delete an env-level variable
edge variables delete OLD_SECRET
# Delete a service-level variable
edge variables delete API_KEY --service api