browser4-cli 4.14.0-rc.3 → 4.14.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -11
- package/bin/browser4-cli-darwin-arm64 +0 -0
- package/bin/browser4-cli-darwin-x64 +0 -0
- package/bin/browser4-cli-linux-arm64 +0 -0
- package/bin/browser4-cli-linux-musl-arm64 +0 -0
- package/bin/browser4-cli-linux-musl-x64 +0 -0
- package/bin/browser4-cli-linux-x64 +0 -0
- package/bin/browser4-cli-win32-x64.exe +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -61,10 +61,10 @@ English | [简体中文](README.zh.md) | [中国镜像](https://gitee.com/platon
|
|
|
61
61
|
|
|
62
62
|
## Quick Start
|
|
63
63
|
|
|
64
|
-
Paste the following instruction to your favorite AI agent like claude, codex, workbuddy or openclaw and run it:
|
|
64
|
+
Paste the following instruction to your favorite AI agent like dsh, claude, codex, workbuddy or openclaw and run it:
|
|
65
65
|
|
|
66
66
|
```
|
|
67
|
-
Read https://browser4.io/SKILL.md
|
|
67
|
+
Read https://browser4.io/SKILL.md, install or upgrade browser4-cli for browser automation, perform the following task:
|
|
68
68
|
|
|
69
69
|
1. Open the browser in headed mode (`open --headed`) so the window is visible — this is a human-facing demo
|
|
70
70
|
2. go to amazon.com
|
|
@@ -90,6 +90,8 @@ Choosing the right tool for your task:
|
|
|
90
90
|
|
|
91
91
|
Use `snapshot -i --boxes` to see clickable/typeable elements with refs like `e15`, then `click <ref>`, `fill <ref> "<text>"`, `type`/`press`, `select`, `hover`/`drag`/`scroll`, and `wait` to drive the page. All interaction commands accept CSS selectors too. Chain multiple steps efficiently with `batch`.
|
|
92
92
|
|
|
93
|
+
Content embedded in `<iframe>`s (payment forms, editors, widgets) is reached with the built-in frame switching: `frames` lists the frame tree, `frame "<iframe selector>"` scopes subsequent element commands into that frame (same-origin iframes fully supported), and `frame main` returns to the main document — no manual `contentDocument` eval needed.
|
|
94
|
+
|
|
93
95
|
Typical interactive flow:
|
|
94
96
|
|
|
95
97
|
```bash
|
|
@@ -100,6 +102,10 @@ browser4-cli fill e3 "user@example.com"
|
|
|
100
102
|
browser4-cli fill e4 "secret" --submit
|
|
101
103
|
browser4-cli wait --load networkidle
|
|
102
104
|
browser4-cli snapshot -i
|
|
105
|
+
# iframe-heavy page:
|
|
106
|
+
browser4-cli frame "#pay-frame"
|
|
107
|
+
browser4-cli fill "#card-number" "4111 1111 1111 1111"
|
|
108
|
+
browser4-cli frame main
|
|
103
109
|
```
|
|
104
110
|
|
|
105
111
|
### How to Extract Data
|
|
@@ -124,7 +130,7 @@ Need to process multiple pages?
|
|
|
124
130
|
├─ List of known URLs (in a file)? → crawl --seed-file urls.txt --depth 0 --sql @query.sql
|
|
125
131
|
├─ Crawl from a start URL (follow links)? → crawl <url> --out-link-selector "..." --depth N
|
|
126
132
|
├─ Need parallel execution (high throughput)? → swarm create → swarm query --seed-file ...
|
|
127
|
-
├─ Repeated monitoring (check every hour)? → loop -- eval "..."
|
|
133
|
+
├─ Repeated monitoring (check every hour)? → loop -i 3600 -- eval "..."
|
|
128
134
|
└─ Just a few URLs in a shell script?
|
|
129
135
|
→ browser4-cli open --headed "https://first-url" # humans: open once, visibly
|
|
130
136
|
→ for url in ...; do browser4-cli goto "$url"; ... done
|
|
@@ -276,14 +282,14 @@ export DEEPSEEK_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxx
|
|
|
276
282
|
| Command | Description |
|
|
277
283
|
|---|---|
|
|
278
284
|
| `open [url]` | Open a browser session or reconnect to an existing one. **Headless by default.** Supports `--headed` (visible window), `--headless`, `--profile <path>`, `--profile-mode <DEFAULT\|SYSTEM_DEFAULT\|SEQUENTIAL\|TEMPORARY>`, `--interact-level <FASTEST\|FAST\|DEFAULT>`. **Note:** `SYSTEM_DEFAULT` is deprecated and unsupported on Chrome ≥ 143 — use `attach` + `state-save`/`state-load` to reuse system browser state (see [browser-state-import.md](skills/browser4-cli/references/browser-state-import.md)). |
|
|
279
|
-
| `attach` | Attach to an existing browser via CDP or the Browser4 extension. Supports `--cdp <url\|port\|channel>` and remote endpoint options. |
|
|
285
|
+
| `attach` | Attach to an existing browser via CDP or the Browser4 extension. Supports `--cdp <url\|port\|channel>` and remote endpoint options. After a successful attach the CLI prints the browser that actually connected (`Connected browser: …` / `Attached to … at …`) and shows a ⚠ warning when it conflicts with the requested channel (e.g. requested msedge but Chrome connected) — verify it before driving the session. |
|
|
280
286
|
| `close` | Close the active browser session. |
|
|
281
|
-
| `list` | List browser sessions with their status and next-open behavior. Supports `--all`. |
|
|
287
|
+
| `list` | List browser sessions with their status and next-open behavior. The Connection column prefers the backend-reported actual browser and annotates channel conflicts (e.g. `requested msedge · actual Google Chrome`). Supports `--all`. |
|
|
282
288
|
| `session-default <name>` | Make a named session become the default unnamed session. |
|
|
283
289
|
| `close-all` | Close all sessions without stopping the backend. |
|
|
284
290
|
| `kill-all` | Force-stop the backend and Browser4-managed browser processes. |
|
|
285
291
|
| `stop` | Gracefully stop the Browser4 server. |
|
|
286
|
-
| `status` | Show server version, port, health, and the web status panel URL (`http://<server>:8182/status`). |
|
|
292
|
+
| `status` | Show server version, port, health, and the web status panel URL (`http://<server>:8182/status`). When a session is active it also prints a current-session block: Name / Session ID / Status / Connection / Next open. |
|
|
287
293
|
| `doctor` | Run diagnostics: build info, LLM status, stale daemon cleanup, optional repair. Supports `--verbose` and `--fix`. |
|
|
288
294
|
| `doctor log [name]` | List, view, tail, or grep backend log files. Supports `--tail`, grep-style flags, and `doctor log <name> grep <pattern>`. |
|
|
289
295
|
| `doctor metrics [filter]` | List, filter, or grep backend metrics. Supports `doctor metrics grep <pattern>`. |
|
|
@@ -343,13 +349,14 @@ All interaction commands accept a snapshot ref such as `e15` or a CSS selector u
|
|
|
343
349
|
| `dblclick <ref> [button]` | Double-click an element. Supports `--modifiers`, `--follow`, `--auto-dismiss-dialogs`. |
|
|
344
350
|
| `hover <ref>` | Hover over an element. |
|
|
345
351
|
| `fill <ref> <text>` | Clear and fill text into an editable field. Supports `--submit`, `--verify`. |
|
|
346
|
-
| `type <text> [ref]` | Type text into the focused element or a target element. Supports `--submit`, `--verify`, `--focus`, `--interactable-timeout
|
|
352
|
+
| `type <text> [ref]` | Type text into the focused element or a target element. Supports `--submit`, `--verify`, `--focus`, `--interactable-timeout`, and `--method auto\|chars\|exec` (requires a target ref; `auto` types short text per-character and bulk-inserts long/multi-line text on textarea/contenteditable via a single `execCommand('insertText')`, `chars` forces per-character typing, `exec` forces the bulk insert). |
|
|
347
353
|
| `press <key> [ref]` | Press a key on the focused element or a target element. Supports `--verify`, `--follow`. |
|
|
348
354
|
| `select <ref> <value>` | Select a dropdown value. Supports `--verify`. |
|
|
349
355
|
| `check <ref>` | Check a checkbox or radio button. |
|
|
350
356
|
| `uncheck <ref>` | Uncheck a checkbox or radio button. |
|
|
351
357
|
| `drag <startRef> <endRef>` | Drag and drop from one element to another. |
|
|
352
358
|
| `wait [target]` | Wait for a selector/ref, duration, text, URL pattern, page-load state, or JavaScript expression. Supports `--timeout`, `--text`, `--url`, `--load`, `--fn`. |
|
|
359
|
+
| `upload <ref> <file> [file...]` | Upload one or more local files to a page file input. The target must be an `<input type="file">` (anything else errors); the paths must be readable by the browser process — local mode: the same machine, and empty/missing files are rejected with a hint; remote backend: paths resolve on the backend host. Supports `--no-snapshot`. |
|
|
353
360
|
|
|
354
361
|
`wait --load` accepts `domcontentloaded`, `load`, and `networkidle`.
|
|
355
362
|
|
|
@@ -377,7 +384,7 @@ browser4-cli wait --load networkidle
|
|
|
377
384
|
|
|
378
385
|
| Command | Description |
|
|
379
386
|
|---|---|
|
|
380
|
-
| `snapshot` | Capture an accessibility-tree snapshot. Supports `--boxes`, `-i/--interactive`, `-u/--urls`, `-c/--compact`, `--no-compact`, `-d/--depth`, `-l/--limit`, `-s/--selector`, `--raw`, `--stdout`, `-vp/--viewport`, `--filename`. |
|
|
387
|
+
| `snapshot` | Capture an accessibility-tree snapshot. Supports `--boxes`/`--no-boxes`, `-i/--interactive`, `-u/--urls`, `-c/--compact`, `--no-compact`, `-d/--depth`, `-l/--limit`, `-s/--selector`, `--raw`, `--stdout`, `-vp/--viewport`, `--filename`. `--stdout`/`--raw` output is paginated at 2000 lines/page by default — when truncated, stdout (if piped) gets a `# … output truncated: showing N of M lines …` hint and the full footer goes to stderr; use `--all` or `--page-size 0` for the complete tree, and bound very large pages with `-v N`/`--depth`/`--selector`/`--no-boxes`. |
|
|
381
388
|
| `snapshot grep <pattern>` | Search saved/current snapshot YAML with grep-style flags such as `-i`, `-v`, `-c`, `-l`, `-F`, `-w`, `-A`, `-B`, `-C`, `--selector`, `--page`, `--page-size`, `--all`. |
|
|
382
389
|
| `snapshot list` | List saved snapshot files with timestamps and sizes. |
|
|
383
390
|
| `snapshot clean` | Remove old snapshot files. Supports `--dry-run`. |
|
|
@@ -618,7 +625,7 @@ These commands operate on Browser4's learned experience store.
|
|
|
618
625
|
|
|
619
626
|
| Command | Description |
|
|
620
627
|
|---|---|
|
|
621
|
-
| `experience save <url> <trace>` | Save a task execution trace. Supports `--outcome`, `--intent`, `--task-type
|
|
628
|
+
| `experience save <url> <trace>` | Save a task execution trace. Supports `--outcome`, `--intent`, `--task-type` (canonical types including `publish_post`), and `--facts <inline JSON \| @file.json>` — merges retrospective knowledge (`selectors` / `interaction_hints` / `known_blockers` / `anti_patterns`, camelCase or snake_case keys) into the (domain, intent) facts entry; the merge is refused when that entry is VERIFIED (immutable). |
|
|
622
629
|
| `experience query <url>` | Query known selectors, blockers, and hints for a URL/domain. Supports `--intent`. |
|
|
623
630
|
| `experience list` | List stored experience entries. Supports `--filter`, `--intent-filter`, `--page`, `--page-size`. |
|
|
624
631
|
| `experience deep-learn <url> <intent>` | Run deeper analysis on stored traces. Supports `--force`. |
|
|
@@ -640,7 +647,6 @@ These commands exist in the CLI but are intentionally kept out of the default pu
|
|
|
640
647
|
|
|
641
648
|
| Command | Description |
|
|
642
649
|
|---|---|
|
|
643
|
-
| `upload <ref> <file>` | Upload one or multiple files to a file input. |
|
|
644
650
|
| `act <description>` | Experimental natural-language action translator that turns plain text into a browser command and runs it. |
|
|
645
651
|
|
|
646
652
|
### Timeout environment variables
|
|
@@ -778,7 +784,7 @@ The `coding` domain exposes **47 tools** in four groups:
|
|
|
778
784
|
|
|
779
785
|
Browser4 includes a lightweight **MockSite** server that serves static HTML pages for testing and demos. Start it from the repository root:
|
|
780
786
|
|
|
781
|
-
**Windows:** `./bin/test.ps1 mock-site -Dmock.site.port=18080`
|
|
787
|
+
**Windows (pwsh — PowerShell 7+):** `./bin/test.ps1 mock-site -Dmock.site.port=18080`
|
|
782
788
|
**Linux/macOS:** `./bin/test.sh mock-site -Dmock.site.port=18080`
|
|
783
789
|
|
|
784
790
|
Key demo pages are served at `http://localhost:18080/generated/`. For the full page listing, environment variables, Python fallback, and Maven-based launch, see [MockSite](docs/mocksite.md). For the test taxonomy and tagging system, see [Test Taxonomy](docs/TESTING.md).
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|