CLI
The Tripwire CLI runs E2E suites from a terminal or CI. It's the gate a CI job runs: it drives the cross-platform Playwright runner, writes reports, prints a concise summary, and exits with a code CI can act on.
cd backend
python -m app.cli <command> [args]It needs ANTHROPIC_API_KEY in the environment to drive the LLM (the engine and runtime deps — Playwright, the Anthropic SDK, PyYAML — are imported lazily, so --help works without them).
run — run suites (the CI gate)
python -m app.cli run <suite_path_or_glob> [--file-issues PROVIDER] [--out DIR] [--headed]| Argument | Description |
|---|---|
suite | A suite file, or a glob like suites/*.tripwire.yaml (recursive ** works). A bare existing path is used as-is. |
--file-issues PROVIDER | File failures via this provider — e.g. github (comma-separate for several). Needs the matching env (GITHUB_TOKEN, GITHUB_REPO, …). |
--out DIR | Directory for report.json / junit.xml / report.html (default artifacts). Multiple suites land in per-suite subdirs. |
--headed | Run with a visible browser (default: headless — required for CI). |
ANTHROPIC_API_KEY=sk-ant-... python -m app.cli run "../examples/suites/*.tripwire.yaml" \
--file-issues github --out artifactsIt prints a per-suite summary, a line per non-passing case, a TOTAL line, where reports were written, and a machine-readable line the GitHub Action scrapes:
::tripwire-output:: passed=3 failed=1 broken=0 skipped=0test-url — ad-hoc, no suite file
Open a URL and drive it through plain-English steps — the quick-test flow from the terminal.
python -m app.cli test-url <url> "<instructions>" [--headed]Steps are split on newlines, ;, or the word then:
ANTHROPIC_API_KEY=sk-ant-... python -m app.cli test-url \
https://app.example.com/login \
"Type your email and password; then click Sign in; then confirm the dashboard loads"It prints the agent's progress per step, the final URL, and the first 800 characters of the final page text. A step that can't be carried out exits 2 (broken).
Exit codes
The exit code is the gate — the same everywhere (CLI, GitHub Action):
| Code | Meaning |
|---|---|
0 | All cases passed. |
1 | At least one case failed (an assertion didn't hold). |
2 | At least one case is broken (the run couldn't be carried out). |
3 | Spec / config error (bad path, no suites matched, missing ANTHROPIC_API_KEY). |
Broken (2) outranks failed (1) outranks ok (0).
Issue-filing env
When --file-issues is set, the CLI reads tracker credentials from the environment (the same names as Settings). The GitHub Action also injects GIT_SHA and CI_RUN_URL so filed issues carry the commit and the run link.
Related: CI · Filing issues · Settings & env