Skip to content
The docs are now organized by product area. Old links still work. Report a broken link

Authenticate with qf login

Sign the Qualflare CLI in with qf login: approve it in your browser, or use a project access token from QF_TOKEN or a hidden prompt in CI and scripts.

Last updated

To sign the Qualflare CLI in, run qf login <identifier> in a terminal. qf opens your browser, you pick a project and approve, and the CLI saves the sign-in under that local identifier. Every project command then runs as qf <identifier> <command>. The project you approve, not the identifier, decides which project receives your results.

In CI and scripts there is no browser: use a project access token instead (below).

Before you begin

  • qf installed (Install the CLI).
  • The Editor role or higher on the project Editor+ · project (requires the Editor role or higher in the project), or uploads fail with exit code 4 (The token lacks access).

Sign in with your browser

qf login myapp
  1. qf opens the Qualflare sign-in page in your browser.
  2. Sign in to app.qualflare.com, choose the project and approve. Only Editors and above can approve. For read-only access, uncheck Allow changes.
  3. Back in the terminal, qf prints Signed in. Saved identifier "myapp". Use it as the first arg, e.g. qf myapp cases. Upload with qf myapp collect results.xml.

The CLI refreshes the sign-in by itself. When one ends (you revoked it, or its owner lost access), the CLI says so: run qf login <identifier> again.

On a remote machine

Over SSH, in a container or anywhere that can't open a browser, add --no-browser. qf prints a link: open it on any device, approve, and paste the code the page shows at the hidden prompt. Never paste a code that someone else sends you: it could connect your CLI to someone else's project.

qf login myapp --no-browser

Log in in CI and scripts

A pipeline can't open a browser, so it uses a project access token (qfp_…). Create one under Project Settings > Access Tokens > Create Access Token and copy it right away: it is shown only once. Access Tokens covers expiry and access levels.

Outside the browser flow, qf login <identifier> takes the token from the first of these that is set:

  1. The [token] argument (qf login <identifier> [token]). Avoid it: the token ends up in your shell history and the process list.
  2. The QF_TOKEN environment variable.
  3. A hidden prompt, when you pass --with-token in a terminal.
  4. Standard input, when you pipe the token in.

In CI, store the token as a secret named QF_TOKEN and run qf login ci --force at the start of the job:

# In CI: qf login reads the token from the QF_TOKEN secret
qf login ci --force
qf ci collect test-results/*.xml

Run qf login ci --force in every job that uploads: each job starts with no saved login, and without a terminal qf can't ask before replacing an identifier. collect and the read commands use the saved login, not QF_TOKEN. CI/CD Integration has the setup for GitHub Actions, GitLab CI, Jenkins and Azure DevOps. On your own machine, qf login myapp --with-token takes a token at a hidden prompt.

Check the login

Run qf projects: it prints each saved identifier on its own line. Then run a real request, such as qf myapp launches list; --dry-run never contacts Qualflare, so it can't test a login. The read commands list what launches list returns.

Identifier rules

An identifier uses lowercase letters, digits, hyphens and underscores; 1–63 characters; must start with a letter or digit (e.g., my-app, ci, prod). These names are reserved: login, logout, projects, version, list-formats, formats, lf, help, completion and __complete.

The identifier is only a local name: you can save the same token under two identifiers, or tokens of different projects under different identifiers.

Manage saved identifiers

List identifiers with qf projects

qf projects

Lists all saved project identifiers, one per line. Useful for confirming what is currently configured. With none saved, it prints No projects configured. Run 'qf login <identifier>' to sign in.

Remove one with qf logout

qf logout <identifier>

Removes saved credentials for <identifier>. For a browser sign-in, qf also revokes it on the server. The identifier subcommand will no longer be available until you qf login again. An identifier that isn't saved fails with identifier "x" not found (run `qf projects` to list).

Revoke a browser sign-in in the app

Each browser sign-in appears as Qualflare CLI in the project under Project Settings > Access Tokens > Connected apps. Revoke it there to end it from another device, for example when a laptop is lost. The CLI on that machine then asks you to run qf login <identifier> again.

Credentials file

Sign-ins and tokens are stored in:

  • Linux: ~/.config/qualflare/config.toml, or $XDG_CONFIG_HOME/qualflare/config.toml when XDG_CONFIG_HOME is set
  • macOS: ~/Library/Application Support/qualflare/config.toml
  • Windows: %AppData%\qualflare\config.toml

The file is created with permissions 0600, and qf warns you when other users can read it. Treat it like an SSH private key: do not commit it or share it. The warning reads:

warning: <path> is group/world-accessible (mode 0644); run `chmod 600 <path>` to protect your credentials

Migrate an old CI setup

If your CI still sets QF_API_KEY, qf ignores it, and collect prints Note: QF_API_KEY is no longer read. Run 'qf login <identifier> $QF_API_KEY' to migrate. Rename the CI secret to QF_TOKEN and run qf login ci --force instead of passing the token on the command line.

Commands without an identifier, such as qf collect results.xml, no longer work: qf reads collect as an identifier and answers no identifier "collect" configured.

Troubleshoot

  • Sign-in timed out: nobody approved in time. Run qf login <identifier> again.
  • --no-browser needs a terminal to paste the sign-in code into: run it in an interactive terminal. In CI, use a token.
  • token cannot be empty: qf login found no token in the argument, QF_TOKEN, the prompt or standard input. In CI, expose the secret to the job as QF_TOKEN.
  • identifier "ci" already exists; cannot prompt because stdin is not a terminal — use --force to overwrite: add --force.
  • identifier "My-App" is invalid: … or identifier "login" is reserved: choose a name that follows the identifier rules.
  • no identifier "myapp" configured: run qf login myapp first, in the same CI job as the upload.
  • invalid or expired access token (status: 401), exit code 3: run qf login <identifier> --force to sign in again, or save a new token in CI (Troubleshoot qf and CI uploads).

Next steps