env
Read and change the environment variables of an app.
lly env [SLUG|ID] [list]
lly env [SLUG|ID] get <NAME>
lly env [SLUG|ID] set <KEY=VALUE>...
lly env [SLUG|ID] unset <NAME>...
lly env [SLUG|ID] pull [--out <FILE>]
lly env [SLUG|ID] push <FILE> [--prune]
lly env [SLUG|ID] editChanges take effect with the next deploy of the app. Run redeploy to apply them:
lly env copperfox set LOG_LEVEL=debug FEATURE_X=on
lly redeploy copperfoxSee Environment Variables for detection, secrets and generations.
list
Environment Variables
Key Value
LOG_LEVEL debug
API_TOKEN •••••• · src/api.tsLists all variables. Secret values are masked. Detected variables show the file they were found in.
get
lly env copperfox get LOG_LEVELPrints the value only. Secret values cannot be read.
set
lly env copperfox set KEY=VALUE [KEY=VALUE ...]Adds or changes variables. The value starts after the first =. New variables are not secret. An existing secret cannot be changed: unset it, then set it again.
unset
lly env copperfox unset FEATURE_XRemoves variables after confirmation.
pull
lly env copperfox pull
lly env copperfox pull --out .env.localWrites the variables to a .env file readable only by your user. Default file: .env.lily. Secrets are written as comments without a value.
push
lly env copperfox push .env.production
lly env copperfox push .env.production --pruneReads a .env file into the variables. Supports KEY=VALUE, export KEY=VALUE, quoted values and comments. --prune removes variables that are not in the file. Secrets are not changed; secrets in the file are skipped with a warning.
edit
Opens the variables in $VISUAL or $EDITOR. Change or add lines, or delete a line to remove the variable. Secrets are shown as comments and kept.
Options
| Option | Description |
|---|---|
--out <FILE> | pull: target file. Default: .env.lily. |
--prune | push: remove variables that are not in the file |
Exit codes
| Code | Cause |
|---|---|
2 | get on a secret, set on an existing secret, request larger than 64 KB, or edit without $EDITOR |
4 | Variable not found |
JSON output
list: {"appId", "variables": [{"name", "secret", "value", "origin", "foundIn"}], "generation", "deployedGeneration", "applied"}. get: {"name", "value"}. pull: {"path", "variables"}. set, unset, push, edit: {"app", "generation", "deployed_generation", "applied", "changed"}. applied shows whether the running app uses the new generation.
See also
- Set environment variables: the same task step by step