Skip to main content
porter env contains commands for managing environment variables and secrets.

Prerequisites


Global Flags

These flags are available on all porter env subcommands:
FlagShortDescription
--app-aTarget application
--group-gTarget environment group
--target-xDeployment target name
You must specify either --app or --group, but not both.

porter env pull

Pull environment variables from an application or environment group to your local machine. Usage:
porter env pull [flags]
Options:
FlagShortDescription
--file-fOutput file path (writes to stdout if not specified)
--variables-vOutput only variables (excludes secrets)
--secrets-sOutput only secrets (excludes variables)
porter env pull -a my-app
By default, both variables and secrets are output together. Use -v or -s to filter. You cannot use both flags at the same time.

porter env set

Set environment variables and secrets for an application or environment group. Usage:
porter env set [flags]
Options:
FlagShortDescription
--variables-vVariables to set as key=value pairs
--secrets-sSecrets to set as key=value pairs
--skip-redeploysSkip re-deploying apps linked to the environment group
porter env set -a my-app -v KEY1=value1,KEY2=value2
Use -s/--secrets for sensitive values like API keys and passwords. These are encrypted and not visible in logs.
When updating an environment group, all apps linked to the group will be re-deployed unless you use --skip-redeploys.

porter env unset

Remove environment variables or secrets from an application or environment group. Usage:
porter env unset [flags]
Options:
FlagShortDescription
--variables-vComma-separated list of variable names to remove
--secrets-sComma-separated list of secret names to remove
--skip-redeploysSkip re-deploying apps linked to the environment group
porter env unset -a my-app -v KEY1,KEY2
When updating an environment group, all apps linked to the group will be re-deployed unless you use --skip-redeploys.