Authenticate the Dynamic CLI through your browser for interactive use, or with a token for CI and automation.
The CLI authenticates against the Dynamic developer console. Use browser login when you’re working interactively, and a token when you’re running in CI or any non-interactive context.
The CLI opens your browser, you approve the request from the developer console, and the token is stored locally. Login also auto-selects the first available environment so your next command works immediately.Check what you’re authenticated as and which environment is active:
dyn status
Log out to clear the stored token — do this on shared machines:
In CI there’s no browser to complete the login flow. Provide a token through the DYN_CLI_TOKEN environment variable instead:
export DYN_CLI_TOKEN=<your-token>dyn status
When DYN_CLI_TOKEN is set, the CLI uses it directly and skips the browser flow.
Treat DYN_CLI_TOKEN as a secret. Store it in your CI provider’s secret manager, never in source control, and scope it to the environment the pipeline needs.
Destructive commands (delete, revoke, disable, reset) prompt for confirmation by default. In CI there’s no one to answer the prompt, so pass -y/--yes:
dyn users delete <user-id> --yes
For dyn apply, the safety gates also require explicit opt-in flags when the plan includes risky changes — for example --allow-critical-changes or --allow-delete. Combine them with --yes for a fully non-interactive apply: