TypeScript zot extension for token-efficient browser automation through the official Playwright CLI.
It gives the agent a persistent, project-scoped browser session without adding a large browser protocol or local dependencies to the extension.
- Open and navigate pages.
- Capture concise accessibility snapshots with stable element references.
- Click, fill, type, select, check, drag, upload, and press keys.
- Inspect console messages and network requests.
- Evaluate page JavaScript when standard browser actions are insufficient.
- Manage tabs, cookies, local storage, session storage, and authentication state.
- Capture screenshots and PDFs. Explicitly named screenshots are returned to zot as image content.
- Reuse one isolated browser session per project.
- Pass arguments directly to the Playwright CLI without shell interpolation.
- zot 0.3.54 or newer
- Node.js 18 or newer
npx
No node_modules directory or package installation is required. The executable uses npx to run TypeScript and the pinned official @playwright/cli package from the npm cache.
If a compatible browser is not already available, install Chromium once:
npx --yes @playwright/cli@0.1.19 install-browser chromiumzot --ext .Ask zot to use the browser naturally:
Open https://example.com and summarize the page.
Test the login flow at http://localhost:3000 and report console errors.
Fill the signup form, submit it, and save a screenshot to /tmp/signup.png.
Run /playwright to show the active session and artifact directory.
Install directly from GitHub:
zot ext install https://github.com/patriceckhart/zot-playwrightTo install from a local checkout instead:
zot ext install .Restart zot, or run /reload-ext if zot is already open.
The extension manifest invokes index.ts directly. Its shebang runs npx --yes tsx, so there is no build step and no local dependency directory.
The extension registers one playwright tool with a constrained command allowlist. The agent normally follows this workflow:
opena URL.snapshotthe page to obtain references such ase5.- Use references with commands such as
click,fill, orcheck. - Re-run
snapshotafter navigation or major page changes. - Use
closewhen finished.
Browser sessions are named from the current Git repository or working directory. Set PLAYWRIGHT_CLI_SESSION before starting zot to override the name.
The Playwright CLI can create .playwright-cli/ artifacts in the project. The slash command also reports a stable temporary artifact directory at $TMPDIR/zot-playwright/<session>/ for explicit screenshot, PDF, trace, and state file paths.
bunx --yes tsx --test runtime.test.tsManual protocol smoke test:
printf '%s\n' \
'{"type":"hello_ack","protocol_version":1,"zot_version":"0.3.54","provider":"test","model":"test","cwd":"/tmp"}' \
'{"type":"command_invoked","id":"1","name":"playwright","args":""}' \
'{"type":"shutdown"}' | ./index.tsThis extension launches a real browser with your user permissions. Pages can contain untrusted content, and browser state files can contain sensitive authentication data. Review destinations and artifact paths before sharing them. The command allowlist prevents package installation and browser-session-wide kill commands through the agent tool, but it is not a security sandbox.
MIT. See LICENSE for the full license text.