Skip to content

Authentication

Some CLI commands (upload, download, access, list tests) require authentication. Each authentication method also determines what you’re authorized to do.

The CLI resolves credentials in the following priority order:

PriorityMethodBest forAccess scope
1Access TokenCI providers without OIDC supportRead & upload for one project
2Device OAuthLocal developmentSame as the logged-in user
3GitHub OIDCGitHub Actions, with no secrets to manageRead & upload for one project
4GitLab OIDCGitLab CI/CD on gitlab.com, with no secrets to manageRead & upload for one project

Pass a token explicitly via --access-token flag or the FLAKINESS_ACCESS_TOKEN environment variable.

Terminal window
# Via flag
flakiness upload ./flakiness-report --access-token <token>
# Via environment variable
export FLAKINESS_ACCESS_TOKEN=<token>
flakiness upload ./flakiness-report

An access token grants read and upload access to a single project. Use it on CI providers where OIDC is not available: CircleCI, Jenkins, Azure Pipelines, Buildkite, and self-managed GitLab instances.

Log in interactively from your terminal. The CLI opens your browser for authorization and stores the session locally.

Terminal window
flakiness auth login

Device OAuth grants the same access as your user account — all projects and organizations you have access to on Flakiness.io.

Sessions are stored in the platform-specific config directory:

  • macOS: ~/Library/Application Support/flakiness/config.json
  • Linux: ~/.config/flakiness/config.json
  • Windows: ~/AppData/Roaming/flakiness/config.json

This is the best option for local development.

When running inside GitHub Actions with id-token: write permission, the CLI requests an OIDC token from GitHub and exchanges it for a Flakiness access token. There are no secrets to create or rotate.

permissions:
id-token: write
steps:
- run: flakiness upload ./flakiness-report --project myorg/myproject

--project (or FLAKINESS_PROJECT) is required for OIDC authentication. Like an access token, GitHub OIDC grants read and upload access to the specified project.

GitLab mints an ID token when the job starts and exposes it as an environment variable. Declare one named FLAKINESS_ID_TOKEN in .gitlab-ci.yml and the CLI uses it to authenticate:

test:
id_tokens:
FLAKINESS_ID_TOKEN:
aud: myorg/myproject
script:
- flakiness upload ./flakiness-report --project myorg/myproject

The aud claim is fixed when the token is minted, so it must name the same project you pass to --project. The CLI rejects a mismatched token before contacting Flakiness.io. On GitLab 16.1 and later aud expands CI/CD variables, so a shared pipeline template can use aud: $FLAKINESS_PROJECT.

Like an access token, GitLab OIDC grants read and upload access to the specified project.

Your Flakiness.io project must be linked to the GitLab project running the pipeline. Flakiness.io checks the token’s project_path claim against that link and rejects the upload when they differ.

Log in to Flakiness.io via Device OAuth. Opens your browser for authorization.

Terminal window
flakiness auth login

Options:

  • -e, --endpoint <url> — Service endpoint (default: https://flakiness.io, env: FLAKINESS_ENDPOINT)

Log out from the current session.

Terminal window
flakiness auth logout

Show the currently logged-in user. Exits with code 1 if not logged in.

Terminal window
flakiness auth status