Skip to main content
The CLI stores a JWT access token in ~/.infraudit/config.yaml after you log in. All subsequent commands use that token automatically — you do not need to pass credentials on every invocation.

Commands

auth login

Log in with your email and password. If you omit the flags, the CLI prompts you interactively:
# Interactive
infraudit auth login

# Non-interactive (for scripts and CI)
infraudit auth login --email user@example.com --password mypassword
FlagDescription
--emailYour InfraAudit account email
--passwordYour account password

auth register

Create a new InfraAudit account. Prompts interactively if flags are not provided:
# Interactive
infraudit auth register

# Non-interactive
infraudit auth register --email user@example.com --name "Jane Smith" --password mypassword
FlagDescription
--emailEmail address for the new account
--nameFull name
--passwordAccount password

auth whoami

Display the currently authenticated user:
infraudit auth whoami

auth logout

Clear the stored credentials from the config file:
infraudit auth logout

Token refresh

The CLI refreshes the access token automatically using the stored refresh_token. If both tokens expire — for example, after a long period of inactivity — run infraudit auth login again.

API token authentication

For non-interactive environments where you need a stable, long-lived credential, use an API token:
infraudit auth login --token <your-api-token>
The token is stored in ~/.infraudit/config.yaml under auth.token and used as a Bearer credential on every request.
API tokens can be generated in the InfraAudit web platform under Settings → API Tokens.

CI/CD usage

For automated pipelines, pass credentials via flags sourced from CI secrets rather than committing credentials or copying config files:
infraudit auth login --email "$CI_EMAIL" --password "$CI_PASSWORD"
Alternatively, authenticate using an API token stored as a CI secret:
infraudit auth login --token "$INFRAUDIT_TOKEN"
See CI/CD usage for a complete GitHub Actions example.

Security notes

Do not commit ~/.infraudit/config.yaml to source control. It contains your access token.
  • Credentials are stored with 0600 file permissions (owner read/write only).
  • Each team member should maintain their own config file with their own credentials.
  • Rotate API tokens from the web platform if a token is compromised.