browsirai 0.1.1 → 0.2.0

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
@@ -5,7 +5,7 @@
5
5
 
6
6
  **Your browser. Your sessions. Your agent.**
7
7
 
8
- An MCP server that connects AI coding agents to your real Chrome via CDP. Like `httpd` or `sshd`, browsirai runs as a daemon it survives Chrome crashes, maintains state, and is always ready.
8
+ An MCP server + CLI that connects AI coding agents to your real Chrome via CDP. Use as an MCP server for LLM-driven automation, or as a standalone CLI for direct browser control from the terminal.
9
9
 
10
10
  ## Why browsirai?
11
11
 
@@ -170,6 +170,65 @@ mcpServers:
170
170
  ```
171
171
  </details>
172
172
 
173
+ ## CLI Mode
174
+
175
+ browsirai also works as a standalone CLI — no LLM required. Same commands, same Chrome connection.
176
+
177
+ ```bash
178
+ browsirai open example.com
179
+ browsirai snapshot -i
180
+ browsirai click @e5
181
+ browsirai fill @e2 "hello world"
182
+ browsirai press Enter
183
+ browsirai eval "document.title"
184
+ ```
185
+
186
+ ### Commands (30)
187
+
188
+ | Category | Commands |
189
+ |----------|----------|
190
+ | **Navigation** | `open` (goto, navigate), `back`, `scroll`, `wait`, `tab` (tabs), `close`, `resize` |
191
+ | **Observation** | `snapshot`, `screenshot`, `html`, `eval`, `find`, `source`, `console`, `network` |
192
+ | **Actions** | `click`, `fill`, `type`, `press` (key), `hover`, `drag`, `select`, `upload`, `dialog` |
193
+ | **Network** | `route`, `abort`, `unroute`, `save`, `load`, `diff` |
194
+
195
+ ### Short Flags
196
+
197
+ ```bash
198
+ browsirai snapshot -i # interactive elements only
199
+ browsirai snapshot -c # compact output
200
+ browsirai snapshot -d 3 # depth limit
201
+ browsirai snapshot -s "main" # scope to selector
202
+ browsirai screenshot -o ss.png # save to file
203
+ ```
204
+
205
+ ### Positional Arguments
206
+
207
+ ```bash
208
+ browsirai click @e5 # ref (not --ref=@e5)
209
+ browsirai click "#submit" # CSS selector
210
+ browsirai fill @e2 "text" # ref + value
211
+ browsirai drag @e1 @e2 # source + target
212
+ browsirai select @e3 "option1" # ref + value(s)
213
+ browsirai scroll down # direction
214
+ browsirai resize 1280 720 # width height
215
+ ```
216
+
217
+ ### Workflow Example
218
+
219
+ ```bash
220
+ browsirai open github.com/login
221
+ browsirai snapshot -i
222
+ # @e12 textbox "Username"
223
+ # @e15 textbox "Password"
224
+ # @e18 button "Sign in"
225
+ browsirai fill @e12 "user@example.com"
226
+ browsirai fill @e15 "password"
227
+ browsirai click @e18
228
+ browsirai wait --url="github.com/dashboard"
229
+ browsirai snapshot -i
230
+ ```
231
+
173
232
  ## Features
174
233
 
175
234
  | Feature | Description |
package/dist/bin.js CHANGED
@@ -4914,21 +4914,9 @@ async function runCli(args) {
4914
4914
  break;
4915
4915
  }
4916
4916
  default: {
4917
- console.error(`Unknown command: ${command}`);
4918
- console.log(
4919
- [
4920
- `browsirai v${VERSION}`,
4921
- "",
4922
- "Usage: browsirai [command]",
4923
- "",
4924
- "Commands:",
4925
- " (none) Start the MCP server (default)",
4926
- " doctor Run diagnostics",
4927
- " install Install browser integration",
4928
- " --version Print version",
4929
- ""
4930
- ].join("\n")
4931
- );
4917
+ const cliUrl = new URL("./cli/run.js", import.meta.url);
4918
+ const { runCLI } = await import(cliUrl.href);
4919
+ await runCLI(args);
4932
4920
  break;
4933
4921
  }
4934
4922
  }