porter env contains commands for managing environment groups — project-wide sets of environment variables and secrets that can be shared across applications.
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
porter env list
List all environment groups in the current project.
Usage:
porter env create
Create a new environment group.
Usage:
| Flag | Description |
|---|---|
--name | Environment group name (prompted interactively if omitted) |
--variables, -v | Variables to set as key=value pairs |
--secrets, -s | Secrets to set as key=value pairs |
--no-input | Disable interactive prompts |
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:
| 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
Add or update variables and secrets in an environment group.
Usage:
| Flag | Short | Description |
|---|---|---|
--variables | -v | Variables to set as key=value pairs |
--secrets | -s | Secrets to set as key=value pairs |
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:
| Flag | Short | Description |
|---|---|---|
--variables | -v | Comma-separated list of variable names to remove |
--secrets | -s | Comma-separated list of secret names to remove |
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
| Flag | Short | Description |
|---|---|---|
--app | -a | Target application |
--group | -g | Target cluster environment group |
--target | -x | Deployment target name |
--skip-redeploys | Skip re-deploying apps linked to the cluster environment group |
You must specify either
--app or --group, but not both.Related
- Environment Groups — Overview of environment groups
- porter.yaml Reference —
envGroupsfield in porter.yaml - porter app — Application management commands
- porter apply — Deploy with porter.yaml

