pi-frontend-check

extensionmaintained

Pi extension: review and test JS frontends headlessly — open dev-server pages in Playwright Chromium, interact with them, capture screenshots the model can see, and collect console/network errors.

by · v1.1.0 · published 3w ago

$ pi install npm:pi-frontend-check
downloads/mo
553
stars
0
last push
2w ago
open issues
0

Signals

license: MITtestspi manifest: missinginstall size: —deps: 0peer deps: 0

Download trend

571 downloads · last 12 weeks (weekly)

README

pi-frontend-check

npm

A pi extension that lets the model review and test JS frontends headlessly, with screenshots it can actually see: frontend_open, frontend_act, frontend_screenshot, frontend_console, and frontend_eval drive a Playwright Chromium against your dev server, static build, or a plain HTML file.

Editing UI code without looking at the result is guesswork. With this extension the agent opens the page after a change, sees the rendered screenshot, walks the user flow (click, type, select), reads the browser console and failed network requests, and checks responsive layouts at phone/tablet/desktop widths — all headless.

Install

From npm:

pi install npm:pi-frontend-check

Or from git:

pi install git:github.com/sebaxzero/pi-frontend-check.git

Add -l to either form to install project-locally (adds to .pi/settings.json only).

No manual setup: the playwright npm dependency installs automatically with the package, and the Chromium binary (~150 MB) downloads once on the first browser launch. To pre-download it instead, run npx playwright install chromium in the install directory.

Tools

ToolWhat it does
frontend_openNavigate to a URL, host:port shorthand, or HTML file path → title, console health line, screenshot
frontend_actclick / type / press / hover / select / scroll / wait_for on the open page → updated state + fresh screenshot
frontend_screenshotCapture the viewport, the full page, or one element; optionally resize the viewport first (e.g. 375×812) for responsive testing
frontend_consoleFull collected log: console messages, uncaught page errors, failed requests, HTTP 4xx/5xx responses
frontend_evalEvaluate a JS expression in the page and return the JSON result — exact assertions (counts, text, computed styles)

Every frontend_open / frontend_act result pairs a text half (title, URL, viewport, console error summary with the first errors inlined) with an image half (a screenshot of the rendered page), so one tool call answers both "does it error?" and "does it look right?".

What it deliberately is not

This is a testing tool for your own frontend, not a web browser:

  • No SSRF protection, no sanitizationlocalhost, private addresses, and file:// are the whole point. For browsing the open web with prompt-injection and SSRF defenses, use pi-browser-search or pi-safe-search.
  • No dev-server management — the agent starts your dev server itself (bash, background) and then points frontend_open at it.

Commands

/frontend-check                 — show current status and config
/frontend-check set KEY=VAL     — override config for the current session only
/frontend-check save            — write the current config to frontend-check.json
/frontend-check reset           — close the browser

Configuration

Persistent configuration lives in extensions/frontend-check.json next to the installed extension (auto-created on first load with defaults). You can ask the agent to edit it, or tune values live with /frontend-check set.

KeyDefaultDescription
HEADLESStrueSet false to watch the browser during a session
VIEWPORT_WIDTH / VIEWPORT_HEIGHT1280 / 900Initial viewport
NAV_TIMEOUT_MS30000Navigation timeout
AUTO_SHOTtrueAttach a screenshot to every open/act result (set false for non-vision models)
FULL_PAGEfalseDefault screenshot mode
SHOT_FORMAT / SHOT_QUALITYjpeg / 80Screenshot encoding (png for lossless)
MAX_CONSOLE200Console log ring-buffer size
MAX_EVAL_CHARS4000Truncation limit for frontend_eval results

Dependencies

playwright (^1.53.0) — installed automatically with the package, whether via pi install npm: or a git-based install. The Chromium binary is downloaded separately on first browser launch (see Install above).

License

MIT