fastbrowser_cli 1.0.13 → 1.0.14

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 CHANGED
@@ -13,6 +13,19 @@ A lighter alternative to Chrome DevTools MCP or Puppeteer, designed for AI agent
13
13
  - It means faster/cheaper LLM iterations when used in an agent loop.
14
14
  - It means more accurate/better quality responses from the LLM as well, since it has less irrelevant info to parse through.
15
15
 
16
+ ## How to install the CLI tool for claude
17
+
18
+ ### How to install the SKILL.md
19
+ ```
20
+ # goto the claude directory
21
+ cd ~/.claude
22
+ # install the fastbrowser_cli skill
23
+ npx fastbrowser_cli install
24
+ ```
25
+
26
+ ### How to install the MCP server
27
+
28
+
16
29
  ## Architecture
17
30
 
18
31
  Three components ship together in this package:
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "fastbrowser_cli",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "",
5
5
  "main": "dist/fastbrowser_cli/fastbrowser_cli.js",
6
6
  "bin": {
7
- "fastbrowser_cli": "./dist/fastbrowser_cli/fastbrowser_cli.js"
7
+ "fastbrowser_cli": "./dist/fastbrowser_cli/fastbrowser_cli.js",
8
+ "fastbrowser_mcp": "./dist/fastbrowser_mcp/fastbrowser_mcp.js"
8
9
  },
9
10
  "scripts": {
10
11
  "start:fastbrowser_mcp": "npx tsx ./src/fastbrowser_mcp/fastbrowser_mcp.ts",
@@ -183,7 +183,7 @@ npx fastbrowser_cli click --selector "#1_42"
183
183
  npx fastbrowser_cli click -s 'button[name="Submit"]'
184
184
 
185
185
  # Fill a single form field - selector can be a uid (#1_7) or any CSS-like selector
186
- npx fastbrowser_cli fill_form -s 'textbox[name="Email"]' --value "hello@example.com"
186
+ npx fastbrowser_cli fill_form -s 'textbox[name="Email"]' -v "hello@example.com"
187
187
 
188
188
  # Press a comma-separated sequence of keys (literals and named keys both work)
189
189
  npx fastbrowser_cli press_keys --keys "Tab, Tab, Enter"
@@ -221,7 +221,7 @@ Example `demo.fbs`:
221
221
  ```
222
222
  # open a page and interact
223
223
  new_page --url https://example.com
224
- fill_form -s 'textbox[name="Email"]' --value 'hello@example.com'
224
+ fill_form -s 'textbox[name="Email"]' -v 'hello@example.com'
225
225
  press_keys --keys "Tab, Enter"
226
226
  ```
227
227
 
@@ -1,214 +0,0 @@
1
- ---
2
- name: fastbrowser
3
- description: >
4
- Control a live browser from the command line: navigate, click, fill forms, and query the accessibility tree with CSS-like selectors. Lighter alternative to Chrome DevTools MCP or Puppeteer. Triggers on: navigate/click/fill actions, page snapshots, or mentions of fastbrowser.
5
- ---
6
-
7
- # fastbrowser Skill
8
-
9
- `fastbrowser-cli` is a command-line client for the FastWeb HTTP server, which keeps a persistent
10
- MCP connection to a Chrome browser alive so commands incur minimal latency. Each command
11
- maps 1-to-1 to a FastWeb tool and returns the tool's response on stdout.
12
-
13
- ## Invocation
14
-
15
- Run the CLI directly via `tsx`:
16
-
17
- ```bash
18
- npx fastbrowser_cli <command> [flags]
19
- ```
20
-
21
- ## Typical Workflow
22
-
23
- 1. **Query** the accessibility tree for specific nodes: `query_selectors` (first match per selector) or `query_selectors_all` (every match per selector).
24
- 2. **Act** on an element by its accessibility selector: `click`, `fill_form`, `press_keys`. The selector can be a direct uid reference (e.g. `#1_42`, fastest path) or any CSS-like selector (e.g. `button[name="Submit"]`), which is resolved to a uid internally.
25
-
26
- Snapshot output looks like:
27
-
28
- ```
29
- uid=1_0 RootWebArea "Example Domain" url="https://example.com/"
30
- uid=1_1 heading "Example Domain" level="1"
31
- uid=1_2 link "More information..." url="https://www.iana.org/..."
32
- ```
33
-
34
- ## Page Management
35
-
36
- ```bash
37
- # List all open browser pages
38
- npx fastbrowser_cli list_pages
39
-
40
- # Open a new page at a URL
41
- npx fastbrowser_cli new_page --url https://example.com
42
-
43
- # Close a page by its numeric id
44
- npx fastbrowser_cli close_page --page-id 1
45
-
46
- # Navigate the current page to a URL
47
- npx fastbrowser_cli navigate_page --url https://example.com
48
- ```
49
-
50
-
51
- ## Selector Language
52
-
53
- The selector syntax is modelled on CSS selectors, adapted for accessibility tree structures.
54
-
55
- ### Role selector
56
-
57
- Matches nodes by their accessibility role.
58
-
59
- ```
60
- button
61
- link
62
- comboxbox
63
- searchbox
64
- heading
65
- WebArea
66
- ```
67
-
68
- ### Universal selector
69
-
70
- Matches any node.
71
-
72
- ```
73
- *
74
- ```
75
-
76
- ### UID selector
77
-
78
- Matches a node by its exact unique identifier.
79
-
80
- ```
81
- #4
82
- #1_3
83
- ```
84
-
85
- ### Attribute selectors
86
-
87
- Attribute selectors match values inside `node.attributes`. The special virtual attribute `name` maps to `node.name`.
88
-
89
- | Syntax | Semantics |
90
- |--------|-----------|
91
- | `[attr]` | attribute is present |
92
- | `[attr="value"]` | exact match |
93
- | `[attr^="prefix"]` | starts with |
94
- | `[attr$="suffix"]` | ends with |
95
- | `[attr*="sub"]` | contains substring |
96
-
97
- ```
98
- link[href]
99
- button[disabled="true"]
100
- link[href^="https"]
101
- link[href$=".com"]
102
- link[href*="example"]
103
- heading[name="Welcome"]
104
- link[name="Click \"here\""]
105
- ```
106
-
107
- ### Combinators
108
-
109
- | Syntax | Semantics |
110
- |--------|-----------|
111
- | `A B` | B is a descendant of A (any depth) |
112
- | `A > B` | B is a direct child of A |
113
- | `A, B` | union — matches A or B |
114
-
115
- ```
116
- WebArea link
117
- main > button
118
- heading, button
119
- RootWebArea > link[href^="https"]
120
- ```
121
-
122
- ### Examples
123
-
124
- Sample accessibility tree:
125
-
126
- ```
127
- uid=1 WebArea "Main Page"
128
- uid=2 main
129
- uid=3 heading "Welcome"
130
- uid=4 link "Click here" href="https://example.com"
131
- uid=5 button "Submit" disabled="true"
132
- uid=6 navigation
133
- uid=7 link "Home" href="/"
134
- uid=8 link "About" href="/about"
135
- ```
136
-
137
- Example queries on it:
138
- - `link` matches all the links (uid=4, uid=7, uid=8)
139
- - 'navigation > link' matches only the links that are direct children of navigation (uid=7, uid=8)
140
- - `link[href^="https"]` matches links with an external href (uid=4)
141
- - `button[name="Submit"]` matches the submit button by name (uid=5)
142
- - `*[disabled="true"]` matches any disabled element (uid=5)
143
- - `heading, button` matches both headings and buttons in one query (uid=3, uid=5)
144
- - `#7` matches a node by its UID (uid=7)
145
-
146
- ## Inspection
147
-
148
- - `query_selectors` and `query_selectors_all` are the most efficient way to get specific elements or data from the page. Use them instead of `take_snapshot` whenever possible.
149
- - Prefer `query_selectors` when you only need the first match per selector (cheaper, less output); use `query_selectors_all` when you need every match or want to cap with `--limit`.
150
-
151
- ```bash
152
- # Query the accessibility tree returning the FIRST match per selector (--selector is repeatable)
153
- npx fastbrowser_cli query_selectors --selector "button" --selector "link"
154
-
155
- # Exclude ancestor nodes from the result
156
- npx fastbrowser_cli query_selectors --selector 'heading[level="1"]' --no-with-ancestors
157
-
158
- # Per-selector control over withAncestors via JSON
159
- npx fastbrowser_cli query_selectors \
160
- --selectors-json '[{"selector":"button","withAncestors":true},{"selector":"link","withAncestors":false}]'
161
-
162
- # Query the accessibility tree returning ALL matches per selector (--selector is repeatable)
163
- npx fastbrowser_cli query_selectors_all --selector "button" --selector "link" --limit 5
164
-
165
- # Exclude ancestor nodes from the result
166
- npx fastbrowser_cli query_selectors_all --selector 'heading[level="1"]' --no-with-ancestors
167
-
168
- # Per-selector control over limit / withAncestors via JSON
169
- npx fastbrowser_cli query_selectors_all \
170
- --selectors-json '[{"selector":"button","limit":3,"withAncestors":true},{"selector":"link","limit":0,"withAncestors":false}]'
171
-
172
- # Take an accessibility-tree full page snapshot of the current page - very expensive, prefer targeted queries when possible
173
- npx fastbrowser_cli take_snapshot
174
- ```
175
-
176
- ## Interaction
177
-
178
- ```bash
179
- # Click by a direct uid reference (fast path - no accessibility-tree lookup)
180
- npx fastbrowser_cli click --selector "#1_42"
181
-
182
- # Click by any CSS-like selector - resolved to a uid internally
183
- npx fastbrowser_cli click -s 'button[name="Submit"]'
184
-
185
- # Fill a single form field - selector can be a uid (#1_7) or any CSS-like selector
186
- npx fastbrowser_cli fill_form -s 'textbox[name="Email"]' --value "hello@example.com"
187
-
188
- # Press a comma-separated sequence of keys (literals and named keys both work)
189
- npx fastbrowser_cli press_keys --keys "Tab, Tab, Enter"
190
- npx fastbrowser_cli press_keys --keys "Hello, Tab, Enter"
191
- ```
192
-
193
- ## Command Reference
194
-
195
- | Command | Purpose | Required flags |
196
- |---------|---------|----------------|
197
- | `list_pages` | List open browser pages | — |
198
- | `new_page` | Open a new page at a URL | `--url` |
199
- | `close_page` | Close a page by id | `--page-id` |
200
- | `navigate_page` | Navigate current page to a URL | `--url` |
201
- | `take_snapshot` | Dump the accessibility tree of the whole page - very expensive, prefer targeted queries (`query_selectors` / `query_selectors_all`) when possible | — |
202
- | `query_selectors` | Query a11y tree by CSS-like selector, returning the first match per selector | `--selector` or `--selectors-json` |
203
- | `query_selectors_all` | Query a11y tree by CSS-like selector, returning every match per selector | `--selector` or `--selectors-json` |
204
- | `click` | Click an element by accessibility selector | `--selector` / `-s` |
205
- | `fill_form` | Fill a form field by accessibility selector | `--selector` / `-s`, `--value` |
206
- | `press_keys` | Press a comma-separated key sequence | `--keys` |
207
- | `server start` | Start the HTTP server daemon | — |
208
- | `server status` | Report server running/stopped | — |
209
- | `server stop` | Stop the HTTP server | — |
210
-
211
- ## Output & Errors
212
-
213
- Tool output is written to **stdout** — one line per response content part. On failure the
214
- CLI writes `fastbrowser-cli error: <message>` to **stderr** and exits with code 1.