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:
| Priority | Method | Best for | Access scope |
|---|---|---|---|
| 1 | Access Token | Non-GitHub CI providers | Read & upload for one project |
| 2 | Device OAuth | Local development | Same as the logged-in user |
| 3 | GitHub OIDC | GitHub Actions — no secrets to manage | Read & upload for one project |
Access Token
Section titled “Access Token”Pass a token explicitly via --access-token flag or the FLAKINESS_ACCESS_TOKEN environment variable.
# Via flagflakiness upload ./flakiness-report --access-token <token>
# Via environment variableexport FLAKINESS_ACCESS_TOKEN=<token>flakiness upload ./flakiness-reportAn access token grants read and upload access to a single project. This is the best option for non-GitHub CI providers (GitLab CI, CircleCI, Jenkins, etc.) where OIDC is not available.
Device OAuth
Section titled “Device OAuth”Log in interactively from your terminal. The CLI opens your browser for authorization and stores the session locally.
flakiness auth loginDevice 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.
GitHub OIDC
Section titled “GitHub OIDC”When running inside GitHub Actions with id-token: write permission, the CLI authenticates automatically — 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.
Auth Commands
Section titled “Auth Commands”auth login
Section titled “auth login”Log in to Flakiness.io via Device OAuth. Opens your browser for authorization.
flakiness auth loginOptions:
-e, --endpoint <url>— Service endpoint (default:https://flakiness.io, env:FLAKINESS_ENDPOINT)
auth logout
Section titled “auth logout”Log out from the current session.
flakiness auth logoutauth whoami
Section titled “auth whoami”Show the currently logged-in user. Exits with code 1 if not logged in.
flakiness auth whoami