Skip to main content
porter env contains commands for managing environment groups — project-wide sets of environment variables and secrets that can be shared across applications.

Prerequisites


porter env list

List all environment groups in the current project. Usage:
porter env list
Displays a table with each group’s name, current version, and last updated time.

porter env create

Create a new environment group. Usage:
porter env create [flags]
Options:
FlagDescription
--nameEnvironment group name (prompted interactively if omitted)
--variables, -vVariables to set as key=value pairs
--secrets, -sSecrets to set as key=value pairs
--no-inputDisable interactive prompts
porter env create
If an environment group with the same name already exists, the command will fail. Use porter env set to update an existing group.

porter env pull

Pull environment variables from an environment group to your local machine. Usage:
porter env pull <env-group-name> [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 production-secrets
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

Add or update variables and secrets in an environment group. Usage:
porter env set <env-group-name> [flags]
Options:
FlagShortDescription
--variables-vVariables to set as key=value pairs
--secrets-sSecrets to set as key=value pairs
porter env set production-secrets -v LOG_LEVEL=debug,FEATURE_FLAG=true
Use -s/--secrets for sensitive values like API keys and passwords. Secrets are stored in your cloud provider’s secret manager and are not visible after creation.
When you update an environment group, all applications synced to it are automatically redeployed with the new values.

porter env unset

Remove variables or secrets from an environment group. Usage:
porter env unset <env-group-name> [flags]
Options:
FlagShortDescription
--variables-vComma-separated list of variable names to remove
--secrets-sComma-separated list of secret names to remove
porter env unset production-secrets -v OLD_KEY,UNUSED_VAR
When you update an environment group, all applications synced to it are automatically redeployed with the new values.

Legacy Commands

The following flag-based syntax is supported for managing app-level and cluster-level environment variables. These are legacy commands — for environment groups, use the positional argument syntax above.

Legacy Flags

FlagShortDescription
--app-aTarget application
--group-gTarget cluster environment group
--target-xDeployment target name
--skip-redeploysSkip re-deploying apps linked to the cluster environment group
You must specify either --app or --group, but not both.
porter env pull --app my-app