CLI reference
Run Outqube tests from your terminal or CI with npx outqube. Install, sign in, every command and option, exit codes and JSON output.
The CLI is a thin client over the API. It starts a run, waits, and gives you the result and the failure reports. It needs Node 22 or newer and has no other dependencies.
Install
npx outqube --help # no install
npm install -g outqube # or globalSign in
In CI, create an API key with the trigger scope in Settings, API keys and store it as the secret OUTQUBE_API_KEY. See Authentication.
On your machine, run outqube login. It asks for the key without showing it, checks it and saves it for your user. outqube whoami shows the last four characters of the key, its app and the API address, and outqube logout removes the saved key. The key is never printed.
For Outqube on your own domain, use --api-url or OUTQUBE_API_URL. The default is https://app.outqube.com.
Commands
| Command | What it does |
|---|---|
run (--suite X | --test ID... | --tag T) | Start a run. |
status RUN | State and counts. |
results RUN | Every test with its result. |
report RUN [--test ID] | The failure report, as Markdown, of each test that did not pass. |
cancel RUN | Cancel a run. Cancelling a finished run changes nothing. |
rerun RUN [--failed] | A new run of the same tests, linked to the old one. --failed reruns only those that did not pass. Takes the run wait options. |
tests list [--tag T] | List the app's tests. |
suites list | List the app's suites. |
login, logout, whoami | Save, remove and show the API key. |
Run outqube COMMAND --help for the options of a command. --json works on every read command: stdout holds one JSON document and progress goes to stderr.
Options for run and rerun
| Option | Meaning |
|---|---|
--suite <name|id> | Run a suite. |
--test <id> | Run these tests. Repeat the option or separate ids with commas. |
--tag <tag> | Run every test with this tag. |
--url <url> | Test this base URL instead of the environment's. |
--env <name|id> | Use this environment. |
--commit <sha>, --branch <name>, --pr <number>, --repo <owner/name> | Override what the CI provides. |
--wait | Wait for the run and print the result. |
--timeout <time> | Stop waiting after this long. Default 30 minutes. Examples: 90s, 30m, 1h30m. |
--cancel-on-timeout | Cancel the run when --timeout passes. Default: leave it running. |
--junit <file> | Write a JUnit XML report. |
--fail-on <failed|any> | any (default) exits 2 on errors too. failed makes errors exit 0. |
--json | Print JSON instead of text. |
--fail-on, --timeout, --cancel-on-timeout and --junit need --wait.
Waiting for a run
With --wait the CLI polls with a growing delay (2 to 15 seconds), prints one line per change, then a summary and the summary of each failure report.
- Ctrl-C or SIGTERM cancels the run and exits 130 or 143. A second signal exits at once.
- After
--timeoutit stops waiting and exits 4. The run keeps going unless you also pass--cancel-on-timeout. --junit out.xmlwrites one test case per test, with the report summary as the failure message. It is also written on a timeout or a signal.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Passed. |
| 1 | A test failed. |
| 2 | The run errored, was cancelled, or the API is down. Also an outcome this CLI does not know. |
| 3 | Usage or auth error: bad arguments, a missing or refused key, an unknown run. |
| 4 | Timed out waiting. |
| 130, 143 | Stopped by SIGINT or SIGTERM. The run was cancelled. |
--fail-on failed ignores run errors: only failed tests exit 1.
CI metadata
The commit, branch, pull request and repo come from GitHub Actions, GitLab CI and Azure Pipelines automatically and are sent with source: cli. For a pull request the commit is the head commit, not the merge commit. --commit, --branch, --pr and --repo override them. With the GitHub App, runs that carry the repo and commit show up on the pull request's Outqube check.
Pull requests from forks get no secrets in GitHub Actions, so the key is empty there and the CLI exits 3.
CI examples
- name: Outqube
run: npx outqube run --suite smoke --url ${{ vars.STAGING_URL }} --wait --junit out.xml
env:
OUTQUBE_API_KEY: ${{ secrets.OUTQUBE_API_KEY }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: outqube-junit
path: out.xmlThe CI guide explains each of these.
JSON output
With --json, run --wait prints { run, failures: [{ test_run_id, name, outcome, summary, report_markdown }] }. An error is one line on stderr: {"error":{"message","exit_code","code","request_id"}}. The shapes of runs, tests and reports are those of the API. Write scripts the way the CLI does: treat an outcome you do not know as not passed.
Output safety
Everything the CLI prints passes through a filter that replaces the API key, removes escape sequences and control characters, and changes a line that starts with :: or ## so a CI system does not run it as a command. Text from pages and reports cannot affect your terminal or your build.
Client header
Every request carries an x-outqube-client header with the CLI version and the OS, plus the CI system and repo in CI, or the machine's name outside it. Organisation admins see it under each key in Settings, API keys, to tell where a key is used. It never holds the key or your command. To cut a machine off, revoke its key.
Next steps
- Run Outqube from CI: a full nightly workflow.
- Authentication: keys and scopes.
- GitHub App: get the result on the pull request too.
Event webhooks
Get a signed HTTPS request when a run starts, needs attention or finishes. Event types, payload, signing, retries and when an endpoint is switched off.
MCP server
Connect Claude Code, Cursor, VS Code or Codex to the Outqube MCP server so your coding agent can start runs and read failure reports.