porter auth contains commands for authenticating with Porter.
porter auth login
Authenticate with your Porter account. By default, this opens your browser to complete authentication.
Usage:
| Flag | Description |
|---|---|
--token | Log in using an existing token |
After logging in, Porter automatically sets your default project and cluster if you have access to any. You can view these with
porter config.Default login method (v2)
New CLI installs default to the v2 login method, which uses a refreshable session and stores credentials in your operating system’s keyring instead of~/.porter/porter.yaml. Sessions refresh automatically while you use the CLI, so you no longer need to re-run porter auth login as often.
- First-time users: no action required —
porter auth loginuses v2 automatically. - Existing users upgrading: your config is migrated to v2 on the next CLI run. Any legacy plaintext token in
porter.yamlis cleared and replaced by a session stored in the keyring. - Legacy hosts: set
login_method: v1in~/.porter/porter.yamlto keep the previous JWT-based flow.
Token and environment overrides
Explicit token authentication still takes precedence over the v2 default — useful for CI/CD pipelines and service accounts:- The
--tokenflag on any command - The
PORTER_TOKENenvironment variable
PORTER_TOKEN is set but the server rejects it, the CLI tells you to unset PORTER_TOKEN before retrying.
CI/CD example

