porter env contains commands for managing environment variables and secrets.
Prerequisites
- You’ve logged in to the Porter CLI after running porter auth login
- You’re connected to the correct project by running porter config set-project
- You’re connected to the correct cluster by running porter config set-cluster
Global Flags
These flags are available on allporter env subcommands:
| Flag | Short | Description |
|---|---|---|
--app | -a | Target application |
--group | -g | Target environment group |
--target | -x | Deployment 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:
| Flag | Short | Description |
|---|---|---|
--file | -f | Output file path (writes to stdout if not specified) |
--variables | -v | Output only variables (excludes secrets) |
--secrets | -s | Output only secrets (excludes variables) |
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:
| Flag | Short | Description |
|---|---|---|
--variables | -v | Variables to set as key=value pairs |
--secrets | -s | Secrets to set as key=value pairs |
--skip-redeploys | Skip re-deploying apps linked to the environment group |
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:
| Flag | Short | Description |
|---|---|---|
--variables | -v | Comma-separated list of variable names to remove |
--secrets | -s | Comma-separated list of secret names to remove |
--skip-redeploys | Skip re-deploying apps linked to the environment group |
When updating an environment group, all apps linked to the group will be re-deployed unless you use
--skip-redeploys.Related Commands
- porter app update - Update app configuration
- porter apply - Deploy with environment variables in porter.yaml

