browser-use-pi README

The project's README from github.com/browser-use/browser-use-pi. As one markdown file: README.md.

A white arch above the clouds

Browser Use Pi

Browser Use, built on Pi Mono. In TypeScript.

Pi Mono + a persistent V8 REPL + raw CDP. The agent writes JavaScript, controls Chrome, and builds the helpers it needs as it goes.

Your task → Pi Mono → persistent V8 REPL → raw CDP → Chrome
                ↑                                    │
                └──────── AX tree + screenshots ──────┘

The programmability of Browser Harness, with sessions, saved logins, streaming and typed results. One SDK you can put in your app.

Start

npm install @browser_use/pi
# or: pnpm add @browser_use/pi
# or: bun add @browser_use/pi
export OPENROUTER_API_KEY=...
export BROWSER_USE_API_KEY=...
import { Browser, BrowserUse } from '@browser_use/pi';

const agent = await BrowserUse.create({
  model: 'openrouter/openai/gpt-5.6-luna',
  reasoning: 'xhigh',
  browser: Browser.cloud({ apiKey: process.env.BROWSER_USE_API_KEY! }),
  workspace: './work',
});

try {
  const result = await agent.run('Find the top story on Hacker News.');
  console.log(result.status, result.text);
  await agent.followUp('Summarize the comments.');
} finally {
  await agent.close();
}

Save as agent.ts. Run with node agent.ts or bun agent.ts. Uses Browser Use Cloud; no local Chrome installation needed.

Node 22.19+ · Bun 1.3.14+. Bun also needs Node for the V8 worker.

Keep building

Quickstart · Browser primitives · Python · Historical benchmarks

JavaScript runs in a killable worker with filesystem and network access. Use an isolated machine for untrusted tasks. Anonymous run counters are enabled; disable with telemetry: false or DO_NOT_TRACK=1. Telemetry

Develop

npm test
npm run check
npm run docs:build
npm run test:python

browser-use-pi (browser-use/browser-use-pi)

Searching Database…

What is this?Browser Use Pi is a tiny TypeScript SDK that lets an AI agent write live JavaScript to drive a real Chrome browser over the raw DevTools Protocol, instead of calling a fixed set of browser actions.
Is this a standalone app or an SDK I embed in my code?It's an SDK you add to a TypeScript/JavaScript project; there is no separate app, you write an agent.ts file that imports it and run that.
How do I get it running?Save your script as agent.ts and run it with node agent.ts or bun agent.ts; by default it uses Browser Use Cloud, so you don't need Chrome installed locally.
Do I need Node or Bun, and a local Chrome install?You need Node 22.19+ or Bun 1.3.14+ (Bun still needs Node for its V8 worker); a local Chrome install is optional since it defaults to cloud browsers, but you can point it at your own Chrome too.
Is it safe to let the agent write and run its own JavaScript?The agent's generated code runs in a killable V8 worker with filesystem and network access, so untrusted tasks should be isolated to their own machine.
Does it phone home with usage data?Yes, anonymous run counters are enabled by default; you can turn them off with telemetry: false or by setting DONOTTRACK=1.
What can the agent actually do once it's controlling Chrome?It writes and runs its own JavaScript against the live page via raw CDP, building whatever helper functions it needs on the fly rather than relying on a fixed action API.
Can I keep a logged-in session between runs?Yes, sessions support saved logins, persistent workspaces and follow-up runs, on either cloud browsers or your own Chrome instance.
Can I control how long or how much an agent run costs?The Control features let you cap steps, time or cost, stream output, use hooks, get typed results, and keep partial work if a run is stopped early.
Can I see or share what the agent did during a run?Yes, it can produce interaction highlights, recordings and GIF exports so you can show the work afterward.
Size
2.6 MB
Stars
431
Updated
CommitOct 06
Age
1mo
Commits · 90 Days