Reference
pier vars
Environment variables
pier vars <command>Environment variables.
Subcommands
pier vars ls
pier vars lsList environment variables.
pier vars set
pier vars set [<key>] [<value>] [flags]Set a variable (plain, secret or linked); KEY=VALUE or KEY VALUE.
| Argument | Required | Description |
|---|---|---|
<key> | no | Variable name (or KEY=VALUE) |
<value> | no | Variable value |
| Flag | Value | Default | Description |
|---|---|---|---|
-s, --secret | Store as secret | ||
--secret-value | STRING | Secret value (use '-' for stdin) | |
--from | STRING | Link to resource reference (e.g. postgres.main.url) | |
--app | STRING | Scope to an app (slug or slug/target) | |
--site | STRING | Scope to a site (slug or slug/target) | |
--stage | Write the change to pier.yaml only — apply later with 'pier deploy' |
pier vars rm
pier vars rm [<key>] [flags]Remove a variable.
| Argument | Required | Description |
|---|---|---|
<key> | no | Variable name to remove |
| Flag | Value | Default | Description |
|---|---|---|---|
--app | STRING | Scope to an app (slug or slug/target) | |
--site | STRING | Scope to a site (slug or slug/target) | |
-y, --yes | Skip confirmation prompt | ||
--stage | Write the change to pier.yaml only — apply later with 'pier deploy' |
pier vars import
pier vars import [flags]Import variables from a .env file.
| Flag | Value | Default | Description |
|---|---|---|---|
--file | STRING | Path to .env file (use '-' for stdin) | |
--secret | Treat all imported vars as secrets | ||
-y, --yes | Skip confirmation prompt |
pier vars reveal
pier vars reveal [<key>]Reveal the value of a secret variable.
| Argument | Required | Description |
|---|---|---|
<key> | no | Variable name to reveal |
Global flags apply to every command.
Examples
pier vars # every variable, every scope
pier vars set LOG_LEVEL=info --app api # plain, app scope
pier vars set API_KEY --secret --secret-value - --app api < key.txt
pier vars set DATABASE_URL --from postgres.main.url --app api
pier vars import --file .env --secret # many at once
pier vars reveal API_KEY
pier vars rm LOG_LEVEL --app api
pier deploy api # release the new environment version (no rebuild)Behaviour
set,rmandimportrecord the change as a new environment version and write the declaration topier.yaml; they do not roll anything.pier deploy <ref>releases it without a build;pier deployreleases every target that is behind.- A secret's value goes to the platform's vault;
pier.yamlcarries onlysecret: true.revealprints the value for your role.
See also
Environment variables · Set environment variables ·
pier deploy