Skip to main content

buse: Stateless CLI for browser-use

Project description

buse

CI PyPI version Python versions License

Control your browser from your terminal.

buse is a stateless CLI designed for AI agents and automation scripts. It turns complex browser interaction into simple, structured command-line primitives.

Key Features

  • Stateless Control: Just point the CLI at a browser and go.
  • Persistent Sessions: Multiple browser instances can run simultaneously.
  • Universal Primitives: Click, type, scroll, and execute JS with one-liners.
  • Vision-Ready: observe command captures state + screenshots in a single call.
  • Session Migration: Export cookies/storage via save-state to maintain persistent logins.

Why 'buse'?

Automating a browser usually means writing long, complex scripts or paying for expensive cloud services. buse changes that by letting you control a browser just like any other folder or file on your computer—using simple, one-word commands in your terminal.

For example, open a browser and navigate to a website:

uvx --python 3.12 buse browser-1
uvx --python 3.12 buse browser-1 navigate "https://example.com"
uvx --python 3.12 buse browser-2 # open a second browser
uvx --python 3.12 buse browser-2 search "latest tech news"

Installation

With uv:

uvx --python 3.12 buse --help

With pip:

pip install buse

From source:

cd buse
uv pip install -e .

Requirements

  • Python 3.12
  • Google Chrome (local install)

Usage Pattern

buse <instance_id> <command> [args]


Command List

1. Lifecycle & State

Command Description Example
<id> Initialize/Start a new browser instance buse b1
list Show all active browser instances buse list
stop Stop and kill a browser instance buse b1 stop
save-state Export cookies/storage to a file buse b1 save-state cookies.json

2. Analysis & Extraction

Command Description Example
observe Get minified DOM (use --screenshot to include an image) buse b1 observe --screenshot
extract Use LLM to extract data (set BUSE_EXTRACT_MODEL) buse b1 extract "get product info"

3. Navigation & Interaction

Command Description Example
navigate Load a specific URL (supports --new-tab) buse b1 navigate "https://google.com"
new-tab Open a URL in a new tab (alias for navigate --new-tab) buse b1 new-tab "https://example.com"
search Search the web (engines: google, bing, duckduckgo) buse b1 search "query" --engine google
click Click by index, coordinates, or resolve by --id/--class buse b1 click --x 500 --y 300
input Type text into a field by index or --id/--class (use --text when no index) buse b1 input 12 "Hello"
dropdown-options List options for a select element by index or --id/--class buse b1 dropdown-options 12
select-dropdown Select dropdown option by visible text and index or --id/--class (use --text when no index) buse b1 select-dropdown 12 "Option"
hover Hover over an element by index or --id/--class buse b1 hover 5
scroll Scroll page or a specific element buse b1 scroll --down --pages 2
refresh Reload the current page buse b1 refresh
go-back Go back in browser history buse b1 go-back
wait Wait for N seconds buse b1 wait 2
evaluate Execute custom JavaScript code buse b1 evaluate "alert('Hi')"

4. Advanced

Command Description Example
switch-tab Switch by 4-char tab ID buse b1 switch-tab "4D39"
close-tab Close by 4-char tab ID buse b1 close-tab "4D39"

Examples

# Start a session
buse b1

# Observe without screenshot (JSON)
buse b1 observe

# Observe with screenshot (JSON + image)
buse b1 observe --screenshot

# Navigate and click by coordinates
buse b1 navigate "https://example.com"
buse b1 click --x 280 --y 220

# Click by id/class fallback
buse b1 click --id "submit-button"
buse b1 click --class "cta-primary"

# Input by id with explicit --text
buse b1 input --id "email" --text "test@example.com"

# Get dropdown options and select by text
buse b1 dropdown-options --id "country"
buse b1 select-dropdown --id "country" --text "Canada"

# Scroll and wait
buse b1 scroll --down --pages 1.5
buse b1 wait 2

Output & Profiling

  • --format json|toon to switch output format.
  • --profile (or -p) includes timing data in the JSON response.

Environment Variables

  • BUSE_EXTRACT_MODEL: model name for extract (default: gpt-4o-mini).
  • OPENAI_API_KEY: required for extract.
  • BUSE_KEEP_SESSION: set to 1 to keep the session open within a single process.
  • BUSE_REMOTE_ALLOW_ORIGINS: override Chrome --remote-allow-origins (default: http://localhost:<port>,http://127.0.0.1:<port>).

References & Inspiration

https://blog.google/innovation-and-ai/models-and-research/google-deepmind/gemini-computer-use-model/

https://www.anthropic.com/news/3-5-models-and-computer-use

https://docs.browser-use.com/introduction

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

buse-0.1.2.tar.gz (201.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

buse-0.1.2-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file buse-0.1.2.tar.gz.

File metadata

  • Download URL: buse-0.1.2.tar.gz
  • Upload date:
  • Size: 201.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for buse-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4b4dc25f55958d3008afc5287e91a7f272f01b5d5bb7261bc905af17442dbe39
MD5 2ef91bab7198f68b43c27f4388f1050f
BLAKE2b-256 c9f0db9562c05acc6e9268eda3e1f9d48380d8a730beb65c4fa52b84f0f7fe15

See more details on using hashes here.

Provenance

The following attestation bundles were made for buse-0.1.2.tar.gz:

Publisher: release.yml on rinvii/buse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file buse-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: buse-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for buse-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 16524916f6896e01f8a36e93a378adde7c8d5d9eb6b9fa65d22314a001d56004
MD5 2d04716a16d6ebfad11934aaed47ccfa
BLAKE2b-256 bac5497f5716938ffe8b434bbcc1df6a986eabcd3d324a2b973e617afeefbf5e

See more details on using hashes here.

Provenance

The following attestation bundles were made for buse-0.1.2-py3-none-any.whl:

Publisher: release.yml on rinvii/buse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page