Skip to content

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.

bash
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)

bash
python -m app.cli run <suite_path_or_glob> [--file-issues PROVIDER] [--out DIR] [--headed]
ArgumentDescription
suiteA suite file, or a glob like suites/*.tripwire.yaml (recursive ** works). A bare existing path is used as-is.
--file-issues PROVIDERFile failures via this provider — e.g. github (comma-separate for several). Needs the matching env (GITHUB_TOKEN, GITHUB_REPO, …).
--out DIRDirectory for report.json / junit.xml / report.html (default artifacts). Multiple suites land in per-suite subdirs.
--headedRun with a visible browser (default: headless — required for CI).
bash
ANTHROPIC_API_KEY=sk-ant-... python -m app.cli run "../examples/suites/*.tripwire.yaml" \
  --file-issues github --out artifacts

It 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=0

test-url — ad-hoc, no suite file

Open a URL and drive it through plain-English steps — the quick-test flow from the terminal.

bash
python -m app.cli test-url <url> "<instructions>" [--headed]

Steps are split on newlines, ;, or the word then:

bash
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):

CodeMeaning
0All cases passed.
1At least one case failed (an assertion didn't hold).
2At least one case is broken (the run couldn't be carried out).
3Spec / 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

Tripwire — AI-native, self-healing E2E testing. Terms · Privacy · Legal Notice