minitest CLI start runs and read results without a person signing in, which is what your CI needs. This page covers creating a key, using it in a pipeline, and revoking it.
mtk_. Owners and admins manage them in Settings → API keys.
Create a key
1
Open the API keys page
Go to Settings → API keys and click Create key.
2
Name it
Give the key a name you’ll recognize later, like
GitHub Actions or Nightly Jenkins, up to 80 characters. Click Create key.3
Copy it now
The dialog shows the key once. Click Copy API key, or Copy export command for a ready-to-paste
export MINITEST_API_KEY=... line, and store it in your CI’s secret store. After you click Done, the full key can’t be shown again.Use a key in CI
The CLI reads the key from theMINITEST_API_KEY environment variable. Store the key as a secret in your CI and expose it under that name:
minitest auth login signs you in through the browser.
The GitHub Action needs no API key. It signs in with the workflow’s GitHub OIDC token, so the only thing to set is
id-token: write in the workflow’s permissions.Revoke a key
In Settings → API keys, click the revoke button on the key’s row, then Revoke key. Anything using that key stops working right away, and this can’t be undone. To rotate a key without downtime, create the new key first, update the secret in your CI, check that a pipeline runs, then revoke the old key. The CLI can manage keys too, for scripts. It needs a signed-in session, so run it afterminitest auth login:
auth api-key in the CLI reference.
Next steps
Run in CI
Start runs from your pipeline and act on the verdict.
CLI commands
Every
minitest command and flag.Members and roles
Who can create and revoke keys.
