The local runner
The runner is the program that actually uses your product: it opens the browser, plays the people, replays the defects and asks the judge. The same program carries out hosted runs for the app, and it can run entirely on your own machine — no Trawler account, no Trawler server, and your product reachable wherever your machine can reach it: localhost, a VPN, staging behind a password.
It is trawler-runner, in the public repository. The command itself, in apps/runner, is licensed Apache-2.0; the engine it runs, in packages/core, is FSL-1.1-ALv2, which becomes Apache-2.0 two years after each release. It is not published as a package yet; you run it from a checkout, and the commands on this page run from its trawler directory. Outside that directory, or before npm ci, npx fetches trawler-runner from the npm registry, where that name holds only Trawler’s placeholder: it prints how to run the runner from a checkout and exits with code 1.
What you need
Section titled “What you need”- Node.js 24 or later.
- Chromium, installed through Playwright.
- An OpenRouter API key. The local runner calls models through OpenRouter only.
git clone https://github.com/usetrawler/trawler.gitcd trawlernpm cinpx playwright install chromiumexport OPENROUTER_API_KEY=sk-or-…On Linux, add --with-deps to the Playwright command so it installs the system libraries Chromium needs.
Setting up a project
Section titled “Setting up a project”npx trawler-runner setup https://staging.example.com --focus "the new team-invite flow"This reads the page and proposes a name, a description, up to four people, each with up to four goals of their own, the same way setup in the app does, and writes them to project.yaml. It prints what it wrote and what it cost, such as wrote project.yaml: 4 personas, 5 goals, $0.004.
| Option | Default | |
|---|---|---|
--docs <url> |
none | A documentation page to read as well. Its origin is added to the allowed origins, and the people are told where the documentation is. |
--focus <text> |
none | What to concentrate on. Anything past 500 characters is cut. |
--model <id> |
deepseek/deepseek-v4.1-flash |
The OpenRouter model that writes the proposal. |
--out <file> |
project.yaml |
Where to write it. |
--force |
Overwrite an existing file; without it setup refuses. |
Setup asks the model for the plan with room for up to 16,000 tokens of output, and asks once more if the answer is cut off or cannot be read as a plan, unless that first answer already used up setup’s budget of $0.25. A setup usually costs under a cent with the default model, more with an expensive --model. Unlike the app, the local runner fetches private and localhost addresses: it reads whatever your machine can reach. It also does not add the origin a redirect ended on; if your product redirects to another origin, list it under allowedOrigins.
The project file
Section titled “The project file”project.yaml is plain YAML you can edit — and it is where everything the app does not offer yet can be set. Because it holds passwords, setup writes it readable by you alone.
name: ExampletargetUrl: https://staging.example.com/description: What the product is and who it is for.allowedOrigins: - https://auth.example.compersonas: - id: ana name: Ana brief: You run a small bakery and have ten minutes between orders. You give up on anything that needs a manual. accountRef: ownergoals: - id: invite-teammate instruction: Invite a teammate to your workspace. personaId: anaaccounts: - ref: owner username: ana@example.com password: a-long-test-passwordhttpCredentials: username: staging password: the-staging-passwordextraHeaders: X-Test-Run: trawlersecretHeaders: CF-Access-Client-Secret: the-secret-value| Field | |
|---|---|
targetUrl |
Where the people start. http or https, with no username or password in it. |
allowedOrigins |
Other origins the browser may open, such as a sign-in provider. The target’s own origin is always allowed; at most 20 in all. |
docsUrl |
Optional. A documentation page the people are told about, to read if and when they would. If it is on another origin, list that origin under allowedOrigins too — setup --docs does this for you. |
personas |
1 to 12 people: an id of lowercase letters, digits and dashes, a name of up to 100 characters, a brief of up to 2,000, and optionally the accountRef of an account. |
goals |
Each an id, an instruction of up to 1,000 characters, and the personaId of the person it belongs to. A goal without personaId belongs to every person, as in files written before goals had owners. Every person needs 1 to 20 goals. |
accounts |
Up to 20 test accounts, each a ref, a username and a password of 1 to 1,000 characters; one shorter than 8 characters is hidden in its own field but not masked elsewhere. |
httpCredentials |
HTTP basic auth in front of the whole product. The username may not contain a colon; the password is 1 to 1,000 characters, and one shorter than 8 characters is not masked. |
extraHeaders |
Headers sent with every request. Their values are not treated as secrets. |
secretHeaders |
Headers sent with every request and treated as secrets — at most 20, with values of 8 characters or more, masked as ••• wherever they could surface. A value made of a scheme and a token, such as Bearer <token> or SSWS <token>, has the token masked on its own as well. A Basic one with a base64 token also has its decoded user:password masked, and the password alone — or the user, when the password is shorter than 8 characters, as with an API key sent as the user. Each of these parts is masked only when it is 8 characters or more. Use these for tokens such as an access-service secret. |
A misspelt field is an error, not something quietly ignored. A YAML syntax error is reported by line and column; any other error by the field’s path, such as personas.0.brief. Neither echoes a password or a header value.
Running it
Section titled “Running it”npx trawler-runner run --config project.yamlEvery person takes a session in turn, then every defect is replayed and judged — the same check as in the app, all under one budget. Reports of the same defect are first grouped into one, as in the app: with 2 to 60 defect reports the judge model reads them together as group, only the report that came first in each group is replayed and judged, and if its replay cannot get far enough to report, the next report of the group takes its place. If the grouping fails, or the budget is already spent, every report is replayed on its own. Unlike the app, the local runner does not look for findings marked not a bug. Nor does it replay friction on a goal the person did not reach; only what the people reported as defects is replayed.
| Option | Default | |
|---|---|---|
--config <file> |
required | The project file. |
--model <id> |
deepseek/deepseek-v4.1-flash |
The model that plays the people and carries out the replays. |
--judge-model <id> |
the same as --model |
The model that judges. |
--budget <usd> |
5 |
The cap for the whole run, in dollars. It is checked after every step, so the last step can take the total a little past it. |
--max-steps <n> |
120 |
Steps for each person’s session. |
--replay-steps <n> |
40 |
Steps for each replay. |
--second-round |
Experimental. After the people’s sessions, plan more goals from the pages they saw and have the same people play them: see A second round. | |
--headed |
Show the browser instead of running it hidden. |
Progress goes to the terminal as it happens — role:ana started, role:ana found a defect: …, judge:f1 confirmed — and the run is written to runs/<date and time, UTC>/ in the current directory:
report.md— the report: the cost against the budget, a table of the sessions, replays and judge calls, the addresses the browser itself could not load with the error and the sessions that met it, each person’s goals, then the defects grouped as confirmed, inconclusive, refuted and not judged, then friction; each finding with the full address of its page when one was recorded, masked as in A finding, and the person’s words when they gave them. A defect that needed another person’s earlier action names who did each step, such as 1. Priya: Submit a pitch, and its replay acts as each of them in their own browser. A defect whose judge gave no verdict is listed with the others not judged, with a line saying Judge: could not be judged. and why — unless the budget ran out first. The other reports of a grouped defect are listed under it, after Also reported, as the same defect:, with who reported each, on which goal and under what title.summary.json— the same results as data;sameAsmaps each grouped report to the one that stands for its group.events.jsonl— everything that happened, one event per line, written as it happens.
A local run takes no screen captures; findings in its report are text only.
A second round
Section titled “A second round”A plan written from a product’s first page gives the people outcomes to reach, and they reach them by the shortest way: past the search box, the cart’s controls and the settings page. With --second-round the run goes back for what they walked past.
npx trawler-runner run --config project.yaml --second-round- While the people play their goals, the runner keeps every page they saw as the browser described it to them, one per place: at most 30 places of 6,000 characters each, with who saw it. It also notes the links on those pages to places on the same origin that nobody opened.
- After their sessions the run’s model is asked, as
plan:second-round, for more goals. It gets the people, the first round’s goals and how each ended, what was already reported, those pages and the unopened places, and the project’ssetuptext when there is one. It answers with at most 12 goals, at most 4 for one person, each written as what to try to break and what must still hold. - The people it named play those goals in new sessions,
role:<person>#second-round, told what happened before. The model is told to give a person goals only for pages that person saw or places linked from them, and a person who saw no page gets none. - Every defect from both rounds is replayed and judged as usual, and everything stays under the one
--budget.
report.md gets a Second round section with what the first round passed by and the new goals, and marks them in the rest of the report: (second round) after a goal, second round on a finding’s line. summary.json holds the same under secondRound.
The round is left out, and the report says why under Second round, when the budget ran out before it, when nobody saw a page to plan it from, when one person’s turn ended in an error in a plan where people take several turns, or when the planning failed, for example because the model’s answer could not be read as a plan or gave no goal to anyone in the run. Goals that were planned but not started because the budget ran out are listed as not_attempted. A second-round session that breaks leaves the person’s first round as it ended.
The pages reach the model masked like everything else a run reads, and are marked as data it must not take instructions from. The goals it writes are played at once, without anyone reading them first, so start with a product whose pages you trust.
| Exit code | Means |
|---|---|
0 |
The run finished, and at least one person’s session did not fail. |
1 |
Every person’s session failed (the report says why), or something else went wrong; the message starts with error:. |
2 |
A usage mistake, a project file that is missing, unreadable or not valid, or OPENROUTER_API_KEY is not set. |
Model calls go from your machine to OpenRouter, asking the providers behind it not to keep or train on the data; nothing goes to Trawler.
Where the browser can go
Section titled “Where the browser can go”The browser opens only the target’s origin and the allowedOrigins, as in a hosted run, and reaches the network only through a proxy the runner starts on your machine for the length of the run. The proxy checks every connection when it is made, so a redirect from an allowed origin to another one is stopped there too — for images, scripts, API calls and frames as well as for pages.
An allowed origin on your machine or your network, such as http://localhost:3000 or a sign-in service on http://localhost:4001, is reached at the addresses its name had when the browser started; names ending in .localhost mean this machine. A name that cannot be looked up within 2 seconds when the browser starts is treated as not local, and the proxy then refuses it if it turns out to be. Every private, loopback, link-local or cloud-metadata address that is not an allowed origin is refused, including another port on localhost and 127.0.0.1 when only localhost is allowed. List each local service the people need under allowedOrigins, with the exact host name the pages use. A refused connection is recorded in events.jsonl as a blocked request, like any other.
The proxy connects to every origin directly. The browser does not use HTTP_PROXY, HTTPS_PROXY or any other proxy set in your environment, so a product that your machine can reach only through such a proxy cannot be tested with the local runner yet.
The third command
Section titled “The third command”trawler-runner work is how a runner takes jobs from the app. Trawler’s hosted runners use it with the runner token of Trawler’s own servers. With an API token as TRAWLER_RUNNER_TOKEN, it takes the runs that were started for an own runner in the token’s workspace instead; trawler-ci starts it that way for an app started in the job. Set TRAWLER_RUN_ID to a run’s id and it takes the jobs of that run only, as trawler-ci does for the runner it starts; without it, it takes the jobs of any own-runner run within the token’s scope that was not started with --url.
When Trawler refuses the runner for good, it does not retry: it prints one line, such as claim failed for good, the runner is stopping: this runner is too old for the control plane (HTTP 426): … upgrade the runner, and exits with 1. That happens for a token Trawler does not know (401), a checkout of another version than the app’s (426) and any other 4xx answer except 408 and 429. For a version mismatch, check out the version the app runs and run npm ci again. A network failure or a 5xx is tried again every 5 seconds.