browser-ctl 0.2.0__tar.gz → 0.2.2__tar.gz
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.
- {browser_ctl-0.2.0 → browser_ctl-0.2.2}/PKG-INFO +7 -5
- {browser_ctl-0.2.0 → browser_ctl-0.2.2}/README.md +6 -4
- {browser_ctl-0.2.0 → browser_ctl-0.2.2}/browser_ctl/cli.py +11 -1
- browser_ctl-0.2.2/browser_ctl/extension/background.js +1253 -0
- browser_ctl-0.2.2/browser_ctl/extension/icon-128.png +0 -0
- browser_ctl-0.2.2/browser_ctl/extension/icon-16.png +0 -0
- browser_ctl-0.2.2/browser_ctl/extension/icon-32.png +0 -0
- browser_ctl-0.2.2/browser_ctl/extension/icon-48.png +0 -0
- browser_ctl-0.2.2/browser_ctl/extension/manifest.json +25 -0
- {browser_ctl-0.2.0 → browser_ctl-0.2.2}/browser_ctl.egg-info/PKG-INFO +7 -5
- {browser_ctl-0.2.0 → browser_ctl-0.2.2}/browser_ctl.egg-info/SOURCES.txt +7 -1
- {browser_ctl-0.2.0 → browser_ctl-0.2.2}/pyproject.toml +2 -2
- {browser_ctl-0.2.0 → browser_ctl-0.2.2}/LICENSE +0 -0
- {browser_ctl-0.2.0 → browser_ctl-0.2.2}/browser_ctl/SKILL.md +0 -0
- {browser_ctl-0.2.0 → browser_ctl-0.2.2}/browser_ctl/__init__.py +0 -0
- {browser_ctl-0.2.0 → browser_ctl-0.2.2}/browser_ctl/__main__.py +0 -0
- {browser_ctl-0.2.0 → browser_ctl-0.2.2}/browser_ctl/client.py +0 -0
- {browser_ctl-0.2.0 → browser_ctl-0.2.2}/browser_ctl/server.py +0 -0
- {browser_ctl-0.2.0 → browser_ctl-0.2.2}/browser_ctl.egg-info/dependency_links.txt +0 -0
- {browser_ctl-0.2.0 → browser_ctl-0.2.2}/browser_ctl.egg-info/entry_points.txt +0 -0
- {browser_ctl-0.2.0 → browser_ctl-0.2.2}/browser_ctl.egg-info/requires.txt +0 -0
- {browser_ctl-0.2.0 → browser_ctl-0.2.2}/browser_ctl.egg-info/top_level.txt +0 -0
- {browser_ctl-0.2.0 → browser_ctl-0.2.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: browser-ctl
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Control your browser from the command line via a Chrome extension + WebSocket bridge
|
|
5
5
|
Author-email: geb <853934146@qq.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -47,8 +47,9 @@ Dynamic: license-file
|
|
|
47
47
|
pip install browser-ctl
|
|
48
48
|
|
|
49
49
|
bctl go https://github.com
|
|
50
|
-
bctl
|
|
51
|
-
bctl
|
|
50
|
+
bctl snapshot # List interactive elements → e0, e1, e2, …
|
|
51
|
+
bctl click e3 # Click by ref — no CSS selector needed
|
|
52
|
+
bctl type e5 "browser-ctl" # Type into element by ref
|
|
52
53
|
bctl press Enter
|
|
53
54
|
bctl screenshot results.png
|
|
54
55
|
```
|
|
@@ -74,11 +75,12 @@ Tools like [browser-use](https://github.com/browser-use/browser-use), [Playwrigh
|
|
|
74
75
|
|
|
75
76
|
browser-ctl is purpose-built for AI agent workflows:
|
|
76
77
|
|
|
78
|
+
- **Snapshot-first workflow** — `bctl snapshot` lists interactive elements as `e0`, `e1`, … then operate by ref (`bctl click e3`) — no CSS selector guessing
|
|
77
79
|
- **Tool-calling ready** — every command is a single shell call returning structured JSON, perfect for function-calling / tool-use patterns
|
|
78
80
|
- **Built-in AI skill** — ships with `SKILL.md` that teaches AI agents (Cursor, OpenCode, etc.) the full command set and best practices
|
|
79
81
|
- **Real browser = real access** — your LLM can operate on authenticated pages (Gmail, Jira, internal tools) without credential management
|
|
80
|
-
- **Deterministic output** — JSON responses with CSS
|
|
81
|
-
- **Minimal token cost** — `bctl
|
|
82
|
+
- **Deterministic output** — JSON responses with element refs or CSS selectors, no vision model needed for most tasks
|
|
83
|
+
- **Minimal token cost** — `bctl snapshot` + `bctl click e5` vs multi-step screenshot → vision → parse loops
|
|
82
84
|
|
|
83
85
|
```bash
|
|
84
86
|
# Install the AI skill for Cursor IDE in one command
|
|
@@ -21,8 +21,9 @@
|
|
|
21
21
|
pip install browser-ctl
|
|
22
22
|
|
|
23
23
|
bctl go https://github.com
|
|
24
|
-
bctl
|
|
25
|
-
bctl
|
|
24
|
+
bctl snapshot # List interactive elements → e0, e1, e2, …
|
|
25
|
+
bctl click e3 # Click by ref — no CSS selector needed
|
|
26
|
+
bctl type e5 "browser-ctl" # Type into element by ref
|
|
26
27
|
bctl press Enter
|
|
27
28
|
bctl screenshot results.png
|
|
28
29
|
```
|
|
@@ -48,11 +49,12 @@ Tools like [browser-use](https://github.com/browser-use/browser-use), [Playwrigh
|
|
|
48
49
|
|
|
49
50
|
browser-ctl is purpose-built for AI agent workflows:
|
|
50
51
|
|
|
52
|
+
- **Snapshot-first workflow** — `bctl snapshot` lists interactive elements as `e0`, `e1`, … then operate by ref (`bctl click e3`) — no CSS selector guessing
|
|
51
53
|
- **Tool-calling ready** — every command is a single shell call returning structured JSON, perfect for function-calling / tool-use patterns
|
|
52
54
|
- **Built-in AI skill** — ships with `SKILL.md` that teaches AI agents (Cursor, OpenCode, etc.) the full command set and best practices
|
|
53
55
|
- **Real browser = real access** — your LLM can operate on authenticated pages (Gmail, Jira, internal tools) without credential management
|
|
54
|
-
- **Deterministic output** — JSON responses with CSS
|
|
55
|
-
- **Minimal token cost** — `bctl
|
|
56
|
+
- **Deterministic output** — JSON responses with element refs or CSS selectors, no vision model needed for most tasks
|
|
57
|
+
- **Minimal token cost** — `bctl snapshot` + `bctl click e5` vs multi-step screenshot → vision → parse loops
|
|
56
58
|
|
|
57
59
|
```bash
|
|
58
60
|
# Install the AI skill for Cursor IDE in one command
|
|
@@ -421,8 +421,18 @@ def handle_serve(args):
|
|
|
421
421
|
|
|
422
422
|
|
|
423
423
|
def _get_extension_source_dir() -> str | None:
|
|
424
|
-
"""Locate the extension source directory
|
|
424
|
+
"""Locate the extension source directory.
|
|
425
|
+
|
|
426
|
+
Looks in two places:
|
|
427
|
+
1. Inside the package (works for pip install)
|
|
428
|
+
2. Project root (works for editable/dev install)
|
|
429
|
+
"""
|
|
425
430
|
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
|
431
|
+
# 1. Bundled inside the package (pip install browser-ctl)
|
|
432
|
+
ext_dir = os.path.join(pkg_dir, "extension")
|
|
433
|
+
if os.path.isdir(ext_dir) and os.path.exists(os.path.join(ext_dir, "manifest.json")):
|
|
434
|
+
return ext_dir
|
|
435
|
+
# 2. Project root (pip install -e . / dev checkout)
|
|
426
436
|
project_root = os.path.dirname(pkg_dir)
|
|
427
437
|
ext_dir = os.path.join(project_root, "extension")
|
|
428
438
|
if os.path.isdir(ext_dir) and os.path.exists(os.path.join(ext_dir, "manifest.json")):
|