pi-browser

Playwright-backed pi extension that registers the pi-browser tool

Packages

Package details

extension

Install pi-browser from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-browser
Package
pi-browser
Version
0.1.0
Published
May 20, 2026
Downloads
not available
Author
linimin
License
MIT
Types
extension
Size
12.9 KB
Dependencies
1 dependency · 3 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-browser

A publishable pi package that registers a Playwright-backed browser tool named pi-browser.

It loads a single URL in headless Chromium and returns concise rendered output:

  • title
  • finalUrl
  • status when available
  • rendered text
  • optional truncated html

Install

pi install npm:pi-browser
npx playwright install chromium

Then restart pi or run:

/reload

Linux may need:

npx playwright install --with-deps chromium

Local development

npm install
npx playwright install chromium
pi

This repo keeps:

  • extensions/pi-browser.ts — publishable package entry
  • .pi/extensions/pi-browser.ts — local auto-discovery shim for pi in this repo

Tool inputs

  • url — required
  • waitUntilload, domcontentloaded, networkidle, commit
  • timeoutMs
  • waitForSelector
  • waitForSelectorStateattached, detached, visible, hidden
  • extraWaitMs
  • modetext (default), html, both

Example

{
  "url": "https://example.com",
  "waitUntil": "load",
  "timeoutMs": 30000,
  "mode": "text"
}

Publish

npm run typecheck
npm pack --dry-run
npm login
npm publish

For a scoped package, use:

npm publish --access public