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:
- Snapshot the page into a numbered table of interactable controls
(
snapshot.js). - DONE check —
POST /boolean: is the goal already satisfied? - Operation —
POST /choice:CLICK,TYPE_TEXT,SELECT,SCROLL_DOWN,SCROLL_UP,DONE, orBLOCKED. Only operations the page supports are offered. - Target —
POST /choice: which element, from the ones compatible with the chosen operation. - 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
The Bivia API key
If you already use the Bivia CLI, you're done
— browser-cli reads the same key from ~/.bivia/config automatically. No extra
setup.
Otherwise, provide the key any of these ways (highest priority first):
browser-cli run --api-key "your-key" ... # 1. explicit flag
export A8_API_KEY="your-key" # 2. browser-cli env var
export BIVIA_API_KEY="your-key" # 3. Bivia env var
# 4. ~/.bivia/config (BIVIA_API_KEY=...) written by the Bivia CLI
Optionally enable a small text model for the TYPE_TEXT operation
(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 (also reports where the key was found):
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
- docs/AGENT_INTEGRATION.md — calling
browser-clifrom another agent or LLM (JSON contract, exit codes, safe invocation). - CHANGELOG.md — release history.
- CONTRIBUTING.md — development setup and release process.
Credits
Action-space design inspired by browser-use/jev-ultrafast. Decision policy powered by Bivia.
Metadata
Release files for bivia-browser-cli 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bivia_browser_cli-0.1.1.tar.gz | 20.8 kB | Without provenance | Details for bivia_browser_cli-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bivia_browser_cli-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for bivia_browser_cli-0.1.1-py3-none-any.whl |
Total release size: 42.4 kB
Release files / bivia_browser_cli-0.1.1.tar.gz
| Download URL | bivia_browser_cli-0.1.1.tar.gz |
|---|---|
| Size | 20.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
07a85a582389b8e971d27cce9a7a03a55ef24b9f4d57eb7b73e49a6ba07062f7
|
|
BLAKE2b-256 checksum How to use checksums |
24742bf0fed091330e5cc49c11108b6e4571a4486fd18bc8859b304bc64e0032
|
| 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.1-py3-none-any.whl
| Download URL | bivia_browser_cli-0.1.1-py3-none-any.whl |
|---|---|
| Size | 21.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7b77ab8035aa113415d96eb073b9ee89ad45923cd508a04ee5b141dd87239e63
|
|
BLAKE2b-256 checksum How to use checksums |
0421a47f5a5924eeebafa5c25fedb5bd0d52987b90a75cf888ff35acf96b1a48
|
| 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.1
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.