pier_
Reference

pier vars

Environment variables

pier vars <command>

Environment variables.

Subcommands

pier vars ls

pier vars ls

List environment variables.

pier vars set

pier vars set [<key>] [<value>] [flags]

Set a variable (plain, secret or linked); KEY=VALUE or KEY VALUE.

ArgumentRequiredDescription
<key>noVariable name (or KEY=VALUE)
<value>noVariable value
FlagValueDefaultDescription
-s, --secretStore as secret
--secret-valueSTRINGSecret value (use '-' for stdin)
--fromSTRINGLink to resource reference (e.g. postgres.main.url)
--appSTRINGScope to an app (slug or slug/target)
--siteSTRINGScope to a site (slug or slug/target)
--stageWrite the change to pier.yaml only — apply later with 'pier deploy'

pier vars rm

pier vars rm [<key>] [flags]

Remove a variable.

ArgumentRequiredDescription
<key>noVariable name to remove
FlagValueDefaultDescription
--appSTRINGScope to an app (slug or slug/target)
--siteSTRINGScope to a site (slug or slug/target)
-y, --yesSkip confirmation prompt
--stageWrite the change to pier.yaml only — apply later with 'pier deploy'

pier vars import

pier vars import [flags]

Import variables from a .env file.

FlagValueDefaultDescription
--fileSTRINGPath to .env file (use '-' for stdin)
--secretTreat all imported vars as secrets
-y, --yesSkip confirmation prompt

pier vars reveal

pier vars reveal [<key>]

Reveal the value of a secret variable.

ArgumentRequiredDescription
<key>noVariable 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, rm and import record the change as a new environment version and write the declaration to pier.yaml; they do not roll anything. pier deploy <ref> releases it without a build; pier deploy releases every target that is behind.
  • A secret's value goes to the platform's vault; pier.yaml carries only secret: true. reveal prints the value for your role.

See also

Environment variables · Set environment variables · pier deploy

On this page