Skip to content

Commit e8098f5

Browse files
committed
Prepare public release
0 parents  commit e8098f5

167 files changed

Lines changed: 38844 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: release
2+
3+
# Build cross-platform binaries and attach them to a GitHub Release.
4+
# Trigger by pushing a version tag (e.g. `git tag v0.1.0 && git push origin v0.1.0`),
5+
# or run manually from the Actions tab with a tag input.
6+
7+
on:
8+
push:
9+
tags: ["v*"]
10+
workflow_dispatch:
11+
inputs:
12+
tag:
13+
description: "Existing tag to build and release (e.g. v0.1.0)"
14+
required: true
15+
16+
permissions:
17+
contents: write
18+
19+
jobs:
20+
release:
21+
name: ${{ matrix.target }}
22+
runs-on: ${{ matrix.os }}
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
include:
27+
- target: aarch64-apple-darwin
28+
os: macos-latest
29+
- target: x86_64-apple-darwin
30+
os: macos-13
31+
- target: x86_64-unknown-linux-gnu
32+
os: ubuntu-latest
33+
- target: aarch64-unknown-linux-gnu
34+
os: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
with:
38+
ref: ${{ inputs.tag || github.ref_name }}
39+
40+
- name: Build and upload release binary
41+
uses: taiki-e/upload-rust-binary-action@v1
42+
with:
43+
bin: browser-control
44+
target: ${{ matrix.target }}
45+
# Produces e.g. browser-control-aarch64-apple-darwin.tar.gz
46+
archive: browser-control-$target
47+
tar: unix
48+
# cross-compile linux/aarch64 in a container when the host can't build it natively
49+
checksum: sha256
50+
ref: refs/tags/${{ inputs.tag || github.ref_name }}
51+
token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/target
2+
/.browser-control
3+
/.omc
4+
.DS_Store
5+
__pycache__/
6+
*.pyc
7+
.env
8+
.env.local

AGENTS.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# browser-control agent guide
2+
3+
Use this project as a tiny browser pipe, not an agent framework.
4+
5+
Quick loop:
6+
7+
```bash
8+
browser-control launch about:blank
9+
export BROWSER_CONTROL_CDP_URL=http://127.0.0.1:9222
10+
browser-control open https://example.com
11+
browser-control inspect # compact title/url/text/headings/actions/links
12+
browser-control snapshot # observe also works
13+
browser-control click @e1
14+
browser-control eval 'document.title'
15+
browser-control events
16+
browser-control network
17+
browser-control console
18+
browser-control cdp Browser.getVersion
19+
```
20+
21+
Rules:
22+
- Use `snapshot` before ref actions.
23+
- Use `inspect` first when you need compact page text + candidate links/actions.
24+
- Use refs for simple actions, selectors/coordinates when needed.
25+
- Use `--wait N` on `click`/`fill` for late-rendered elements; `wait-element` for explicit polling.
26+
- Use `press ctrl+a` / `press cmd+shift+t` style combos; editing combos (select-all/copy/paste/undo) work headless and on macOS.
27+
- Use `scroll --at x,y` for inner scrollable containers; plain `scroll` for the window.
28+
- Use `screenshot --full` for full-page captures; `click --clicks 2` / `--button right` for double/context clicks.
29+
- `page-info` reports a pending `{dialog}` instead of hanging; clear it with `dialog accept|dismiss`.
30+
- `eval` accepts top-level `return` (auto-wrapped in an IIFE).
31+
- Use `eval` or `cdp` as the raw escape hatch.
32+
- Use `events`, `network`, and `console` when diagnosing flaky waits/pages.
33+
- Use `--frame <target-id|url-substring>` on `eval`, `click`, or `fill` for OOPIF/frame targets.
34+
- Put reusable scripts in `.browser-control/scripts`.
35+
- Verify with `text`, `eval`, `screenshot`, or raw CDP before saying done.
36+
- Check `.browser-control/traces/*` after failures.
37+
- Short env aliases `BU_CDP_WS` and `BU_CDP_URL` are accepted.
38+
39+
Lifecycle:
40+
41+
```bash
42+
browser-control stop # stop browser launched by browser-control
43+
browser-control reload # same minimal lifecycle reset
44+
```

0 commit comments

Comments
 (0)