Skip to content
Smart subagent on top of Playwright CLI

Prima CLI

Each Playwright needs their Prima

Playwright CLI is how coding agents drive the browser today — and every click, ARIA ref and snapshot pollutes the main loop's context at frontier prices. Prima CLI is the fast subagent on top of it: a cheap model takes the wheel and hands your agent back a verdict, not a transcript.

Works with your favorite agent

Claude Code Codex Cursor OpenCode Claude Code Codex Cursor OpenCode
The new loop

Your agent sends intent. Prima CLI sends back proof

Playwright CLI stays exactly where it is. Prima CLI acts as a fast subagent on top of it, so your frontier model stops driving it by hand — each model does what it is priced for.

A cartoon robot builder holding a wrench, leaning on a screen it just built with a light and dark theme toggle, asking: Does our theme setting survive reload?
claude-code · delegating
$ prima-cli check "the theme setting survives a reload"

### Result
ok: true                    expectations: PASSED
used: I.click('Theme'); I.selectOption('Dark'); I.reload(); ...

### Steps
1. ok  switch the theme to dark     I.selectOption('Theme', 'Dark')
2. ok  confirm it took effect       I.seeInField('#theme', 'dark')

agent: verdict received. 1 call, ~40 tokens. moving on.

Your agent decides what

Claude Code, Codex or Cursor states the outcome it needs — one sentence, one call. No page trees, no locators, no screenshots.

A fast subagent works out how

A budget-tier model runs the perceive-and-click loop on Playwright CLI: resolve, heal, retry. Clicks, ARIA refs and API noise never leave the subagent.

A verdict comes back

A compact envelope back: PASSED, FAILED or CONTRADICTION, the steps, the code that worked. Dumps stay inside; artifacts land on disk.

Sound familiar?

Have you experienced this?

Your agent ships the feature fast, then spends twice as long proving it works. Here is that session, drawn to scale.

One feature, start to finish

15 min

Builds the feature

one continuous flow

5 min
then

Verifies it via Playwright CLI

snapshot, read, click, ×20

10 min

Two thirds of the session went to driving Playwright CLI in the main loop — clicks, ARIA refs and API dumps piling trashy tokens into context, billed at frontier-model rates.

And here is what that second half quietly cost you

An overgrown context window

Every click, ARIA ref and page dump stays in history as trashy tokens. Context balloons; the model degrades from there.

Supermind wages for monkey work

Frontier-model prices for ten minutes of clicking the green button in the top-right corner.

The economics

Web checks belong on cent-tier models

Playwright CLI is the mainstream way agents drive the browser — and it works. It is just priced wrong: clicking through a form and confirming a save does not need frontier reasoning, it needs speed, volume and a low bill. Prima CLI runs that layer on whatever budget model you point it at, while your coding agent keeps its context for architecture and code.

  • One call replaces a dozen Playwright CLI snapshot-read-act round trips
  • Clicks, ARIA refs and API dumps never pollute the main loop

playwright-cli by hand

20 steps × (snapshot, read, ref, act) as trashy tokens in the main loop. Context fills; every later token costs more.

browser MCPs

DevTools or Playwright MCP: a server to wire up, dozens of tool definitions — then the same round trips, same trashy tokens, no verdict.

Claude in Chrome

Your frontier model clicks a real tab, waiting on the UI between steps. Slow — and the whole page still lands in its context.

prima-cli on top

A fast subagent takes one delegated call on a cheap model. Back comes PASSED, FAILED or CONTRADICTION — and room to think.

Runs its cheap model on any provider

OpenAI Anthropic Google Groq Mistral OpenRouter SambaNova
The problem

Your best model is doing a cheap model's job

When a coding agent drives Playwright CLI itself, every step taxes the thing you are actually paying for: reasoning.

Every click bills your best model

A round trip per action in the main loop: snapshot in, read the tree, pick a ref, act, repeat — clicks, ARIA refs and API dumps piling up as trashy tokens at Opus prices.

Snapshots eat the context window

Each Playwright CLI snapshot is kilobytes of ARIA dump that never leave history. Fifteen steps in, the context is all DOM — and every later turn costs more.

Refs die the moment the page moves

e13 and e26 live for one Playwright CLI snapshot. Apps re-render, so the agent re-snapshots for fresh refs — same tax, same page, same button.

Open source · Elastic License 2.0

Give your coding agent its Prima

Point your agent at prima-cli, set one model variable, and hand browser work to a fast subagent — same Playwright CLI and browser underneath, just faster and cheaper.

Questions & answers

Frequently asked questions

Why is this cheaper than letting my agent drive playwright-cli?

Because the expensive model stops reading pages. With Playwright CLI — the standard setup — every step dumps clicks, ARIA refs and snapshots into your agent's main-loop context, and the frontier model pays to parse them — trashy tokens that stay in history, compounding for the rest of the session. Prima CLI acts as a fast subagent: it takes the whole scenario in one call, runs the clicking on a cheap model you point it at, and hands back only the verdict.

Which agents can use it?

Any agent that can run a terminal command. Point Claude Code, Codex or Cursor at prima-cli --help and it will find its way — the contract is taught entirely by the help text. One call carries a whole job, and the reply is sized for a machine to read, not a human.

Which model does the driving?

Whatever you set PRIMA_CLI_AI_MODEL to — openai/gpt-oss-120b on OpenRouter or Groq is the sweet spot: fast, cents per session, accurate enough to click through a form. Screenshot judgement uses a separate vision model. Your coding agent stays on its own subscription, doing the work it is actually good at.

Does this replace Playwright CLI?

No — Playwright CLI stays the mainstream driver, and Prima CLI sits on top of it. Prima CLI attaches to the browser Playwright CLI already opened, and below it sits raw Playwright, fully intact: prima-cli pw runs a function expression with no model involved. You keep the standard tool, just faster and cheaper: when a check fails, Prima CLI reports back compactly so your agent can drop down a level and drive Playwright CLI directly.