Token resolution order
The CLI checks for an API token in this order:--api-tokenflag on the commandDEVHELM_API_TOKENenvironment variable- Saved context in
~/.devhelm/contexts.json
4 (validation — missing precondition).
API URL resolution order
The base URL the CLI talks to is resolved in the same precedence order:--api-urlflag on the commandDEVHELM_API_URLenvironment variable- Saved context
apiUrlfield - Built-in default (
https://api.devhelm.io)
--api-url for ephemeral overrides; use a context for persistent multi-environment setups.
Environment variable (recommended for CI)
Interactive login
Log in from your terminal to save credentials locally:~/.devhelm/contexts.json under a named context (default name: default; override with --name). If the API rejects the token, nothing is saved and the command exits with code 11.
To skip the interactive prompt:
Verify your identity
--output json for machine-readable output.
Named contexts
Contexts let you switch between multiple accounts or environments without re-entering credentials.Create a context
--set-current defaults to true and cannot currently be disabled — create the context, then devhelm auth context use <previous-name> to switch back.)
List contexts
Switch context
Delete a context
Log out
Remove the active context (its token and API URL) from~/.devhelm/contexts.json. If other contexts remain, the first one becomes active:
Display the current token
Useful for piping into other tools:Precedence override
Even with a saved context, you can override on a per-command basis:Next steps
Global flags
Output format, verbosity, and other global options.
Auth commands
Full reference for all auth subcommands.