Skip to main content

browser-cli

A fast web-browsing agent you run from the command line. Give it one URL and one natural-language goal; it drives a real browser to accomplish it.

The policy is the Bivia decision model rather than a large language model. This mirrors browser-use/jev-ultrafast's indexed action space, but swaps the single speculative model call for Bivia's bounded, calibrated decisions:

LLMs generate. Bivia decides. Use an LLM to write and plan, and Bivia for the bounded decisions around it.

browser-cli is built so any coding agent or LLM can call it as a tool — pass --json and it emits machine-readable NDJSON with a predictable exit code.

How it works

Each step is one observe → decide → act → verify cycle:

  1. Snapshot the page into a numbered table of interactable controls (snapshot.js).
  2. DONE check — POST /boolean: is the goal already satisfied?
  3. Operation — POST /choice: CLICK, TYPE_TEXT, SELECT, SCROLL_DOWN, SCROLL_UP, DONE, or BLOCKED. Only operations the page supports are offered.
  4. Target — POST /choice: which element, from the ones compatible with the chosen operation.
  5. Text — only when the operation is TYPE_TEXT, a small (optional) text model writes the exact string. Everything else is decided by Bivia.

Each decision is one calibrated call; Bivia can abstain instead of guessing, which the agent surfaces as BLOCKED. The executor re-resolves the chosen element from the live DOM and verifies the action before trusting it.

Install

# zero-install, per invocation (best for agents / one-off runs)
uvx --from bivia-browser-cli browser-cli run -u https://example.com -g "find pricing"

# or install it
pip install bivia-browser-cli          # into the current environment
uv tool install bivia-browser-cli      # as a standalone tool

The package name on PyPI is bivia-browser-cli; the command it installs is browser-cli. The Chromium browser the agent drives (~180MB) is downloaded automatically on first use into a per-user cache (~/Library/Caches/browser-cli on macOS, ~/.cache/browser-cli on Linux), so it survives across ephemeral uvx runs. To pre-warm it (e.g. before going offline):

browser-cli install

Set your keys:

export A8_API_KEY="your-bivia-key"            # required — the decision policy

# optional: a small text model for TYPE_TEXT (OpenAI-compatible endpoint)
export TEXT_MODEL_API_KEY="your-openrouter-key"
export TEXT_MODEL="openai/gpt-4o-mini"        # any small model
export TEXT_MODEL_BASE_URL="https://openrouter.ai/api/v1"

Without a text model, TYPE_TEXT falls back to typing the goal text — fine for search boxes. Check your setup:

browser-cli doctor

Use

# Human-readable, visible browser
browser-cli run \
  --url https://en.wikipedia.org/wiki/Main_Page \
  --goal "Open the article about Gödel's incompleteness theorems"

# Headless + deep mode for harder pages
browser-cli run -u https://example.com -g "find the pricing page" --headless --mode deep

As a tool for another agent

browser-cli run --url https://example.com --goal "accept cookies and go to docs" --json --headless

Output is NDJSON — one object per step, then a final result object:

{"step": 1, "status": "running", "operation": "CLICK", "target_index": 4, "target_name": "Accept all", "elapsed_ms": 820, "url": "https://example.com", "note": "clicked", "distribution": {}}
{"result": "done", "goal": "...", "url": "https://example.com/docs", "steps": 3, "elapsed_ms": 2140, "note": "Goal satisfied"}

Exit codes let a caller branch without parsing:

code meaning
0 goal done
1 blocked (Bivia abstained / no confident action)
2 failed or error

As a Python library

from browser_cli import Agent

with Agent("https://example.com", "find the pricing page", headless=True) as agent:
    for state in agent.run():
        print(state.elapsed_ms, state.status, state.operation, state.target_name)

Options

flag meaning
--url, -u starting URL (required)
--goal, -g natural-language goal (required)
--json emit NDJSON for machine consumption
--headless run without a visible window
--mode fast (default) or deep
--max-steps decision-step cap (default 25)
--profile persistent browser profile dir (reuse logins)
--quiet, -q suppress the live step view

Limits

Common HTML and ARIA controls are supported, not the full accessible-name spec. Shadow roots, frames, canvas, uploads, pop-up tabs, nested scrolling, and arbitrary keyboard widgets are out of scope for this MVP. A DONE result is Bivia's judgment — verify important outcomes independently.

Development & publishing

pip install -e ".[dev]"      # editable install with dev tools
ruff check src/              # lint
python -m build              # build wheel + sdist into dist/
twine check dist/*           # validate metadata

# publish: test first, then real PyPI
twine upload --repository testpypi dist/*
twine upload dist/*

One upload to PyPI serves pip, pipx, uv tool install, and uvx alike.

Documentation

Credits

Action-space design inspired by browser-use/jev-ultrafast. Decision policy powered by Bivia.

Metadata

Release files for bivia-browser-cli 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bivia-browser-cli 0.1.0
File Size Uploaded Provenance Actions
bivia_browser_cli-0.1.0.tar.gz 19.8 kB Without provenance Details for bivia_browser_cli-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bivia-browser-cli 0.1.0
File Interpreter ABI Platform Actions
bivia_browser_cli-0.1.0-py3-none-any.whl Python 3 none any Details for bivia_browser_cli-0.1.0-py3-none-any.whl

Total release size: 40.5 kB

Release files / bivia_browser_cli-0.1.0.tar.gz

Download URL bivia_browser_cli-0.1.0.tar.gz
Size 19.8 kB
Tags Source
SHA-256 checksum
How to use checksums
322e4a20b6b26d0c6780dcfced6228c41a51c9387f67379a4c2a364402871c0a
BLAKE2b-256 checksum
How to use checksums
e48d20b6c767c6f3165d3ebe3f813095520f87eced127cd7739a8e746d2329c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / bivia_browser_cli-0.1.0-py3-none-any.whl

Download URL bivia_browser_cli-0.1.0-py3-none-any.whl
Size 20.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0404c62929e093515619764c54bc9275b9b0c1ab3d7371daf541a205acc34ad3
BLAKE2b-256 checksum
How to use checksums
48ced0121b53ebb8ed7a3e3916bc52c51b3fad27d0b58ef8e8c2c2980b9de5a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Security for bivia-browser-cli 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page