@vibemastery/zurf 0.1.0 → 0.2.3
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 +86 -485
- package/dist/commands/browse/index.d.ts +15 -0
- package/dist/commands/browse/index.js +109 -0
- package/dist/commands/config/which.d.ts +1 -0
- package/dist/commands/fetch/index.d.ts +1 -0
- package/dist/commands/fetch/index.js +14 -15
- package/dist/commands/init/index.d.ts +3 -0
- package/dist/commands/init/index.js +26 -5
- package/dist/commands/search/index.d.ts +1 -0
- package/dist/lib/browse-output.d.ts +12 -0
- package/dist/lib/browse-output.js +10 -0
- package/dist/lib/browserbase-session.d.ts +7 -0
- package/dist/lib/browserbase-session.js +39 -0
- package/dist/lib/cli-errors.d.ts +1 -0
- package/dist/lib/cli-errors.js +9 -0
- package/dist/lib/config.d.ts +26 -0
- package/dist/lib/config.js +77 -6
- package/dist/lib/fetch-output.d.ts +2 -1
- package/dist/lib/fetch-output.js +3 -2
- package/dist/lib/flags.d.ts +3 -0
- package/dist/lib/flags.js +7 -0
- package/dist/lib/html-to-markdown.d.ts +1 -0
- package/dist/lib/html-to-markdown.js +21 -0
- package/oclif.manifest.json +157 -64
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -1,541 +1,142 @@
|
|
|
1
1
|
zurf
|
|
2
2
|
=================
|
|
3
3
|
|
|
4
|
-
A lightweight CLI for searching and fetching web pages, powered by Browserbase.
|
|
4
|
+
A lightweight CLI for searching, browsing, and fetching web pages, powered by Browserbase.
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
[](https://oclif.io)
|
|
8
|
-
[](https://npmjs.org/package/zurf)
|
|
9
|
-
[](https://npmjs.org/package/zurf)
|
|
8
|
+
[](https://npmjs.org/package/@vibemastery/zurf)
|
|
9
|
+
[](https://npmjs.org/package/@vibemastery/zurf)
|
|
10
10
|
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
API key resolution for `zurf search` and `zurf fetch` (highest precedence first):
|
|
14
|
-
|
|
15
|
-
1. `--api-key` / `-k` on the command
|
|
16
|
-
2. Environment variable `BROWSERBASE_API_KEY`
|
|
17
|
-
3. Nearest `.zurf/config.json` when walking up from the current working directory
|
|
18
|
-
4. Global file: `$XDG_CONFIG_HOME/zurf/config.json` if `XDG_CONFIG_HOME` is set, otherwise `~/.config/zurf/config.json` (on Windows, `%APPDATA%\zurf\config.json`)
|
|
19
|
-
|
|
20
|
-
Save a key interactively or with `--api-key`:
|
|
11
|
+
## Installation
|
|
21
12
|
|
|
22
|
-
```sh-session
|
|
23
|
-
$ zurf init --global
|
|
24
|
-
$ zurf init --local
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
For project-local storage, add `.zurf/` to `.gitignore` so the key is never committed. You can run `zurf init --local --gitignore` to append a `.zurf/` entry automatically.
|
|
28
|
-
|
|
29
|
-
**Security note:** Keys in `config.json` are stored as plaintext with file mode `0o600`. For shared machines or stricter setups, prefer `BROWSERBASE_API_KEY` from your environment or a secrets manager instead of `init`.
|
|
30
|
-
|
|
31
|
-
See where a key would be loaded from (nothing secret is printed): `zurf config which`.
|
|
32
|
-
|
|
33
|
-
## Claude Code and agents
|
|
34
|
-
|
|
35
|
-
Install `zurf` on your `PATH` and allow the agent to run shell commands. Use `--json` when you want a single JSON object on stdout, for example:
|
|
36
|
-
|
|
37
|
-
```sh-session
|
|
38
|
-
$ zurf search "browserbase fetch api" --json
|
|
39
|
-
$ zurf fetch https://example.com --json
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
<!-- toc -->
|
|
43
|
-
* [Usage](#usage)
|
|
44
|
-
* [Commands](#commands)
|
|
45
|
-
<!-- tocstop -->
|
|
46
|
-
# Usage
|
|
47
|
-
<!-- usage -->
|
|
48
13
|
```sh-session
|
|
49
14
|
$ npm install -g @vibemastery/zurf
|
|
50
|
-
$ zurf
|
|
51
|
-
|
|
52
|
-
$ zurf (--version)
|
|
53
|
-
@vibemastery/zurf/0.1.0 darwin-arm64 node-v22.22.2
|
|
54
|
-
$ zurf --help [COMMAND]
|
|
55
|
-
USAGE
|
|
56
|
-
$ zurf COMMAND
|
|
57
|
-
...
|
|
58
|
-
```
|
|
59
|
-
<!-- usagestop -->
|
|
60
|
-
# Commands
|
|
61
|
-
<!-- commands -->
|
|
62
|
-
* [`zurf autocomplete [SHELL]`](#zurf-autocomplete-shell)
|
|
63
|
-
* [`zurf config which`](#zurf-config-which)
|
|
64
|
-
* [`zurf fetch URL`](#zurf-fetch-url)
|
|
65
|
-
* [`zurf help [COMMAND]`](#zurf-help-command)
|
|
66
|
-
* [`zurf init`](#zurf-init)
|
|
67
|
-
* [`zurf plugins`](#zurf-plugins)
|
|
68
|
-
* [`zurf plugins add PLUGIN`](#zurf-plugins-add-plugin)
|
|
69
|
-
* [`zurf plugins:inspect PLUGIN...`](#zurf-pluginsinspect-plugin)
|
|
70
|
-
* [`zurf plugins install PLUGIN`](#zurf-plugins-install-plugin)
|
|
71
|
-
* [`zurf plugins link PATH`](#zurf-plugins-link-path)
|
|
72
|
-
* [`zurf plugins remove [PLUGIN]`](#zurf-plugins-remove-plugin)
|
|
73
|
-
* [`zurf plugins reset`](#zurf-plugins-reset)
|
|
74
|
-
* [`zurf plugins uninstall [PLUGIN]`](#zurf-plugins-uninstall-plugin)
|
|
75
|
-
* [`zurf plugins unlink [PLUGIN]`](#zurf-plugins-unlink-plugin)
|
|
76
|
-
* [`zurf plugins update`](#zurf-plugins-update)
|
|
77
|
-
* [`zurf search QUERY`](#zurf-search-query)
|
|
78
|
-
|
|
79
|
-
## `zurf autocomplete [SHELL]`
|
|
80
|
-
|
|
81
|
-
Display autocomplete installation instructions.
|
|
82
|
-
|
|
83
|
-
```
|
|
84
|
-
USAGE
|
|
85
|
-
$ zurf autocomplete [SHELL] [-r]
|
|
86
|
-
|
|
87
|
-
ARGUMENTS
|
|
88
|
-
[SHELL] (zsh|bash|powershell) Shell type
|
|
89
|
-
|
|
90
|
-
FLAGS
|
|
91
|
-
-r, --refresh-cache Refresh cache (ignores displaying instructions)
|
|
92
|
-
|
|
93
|
-
DESCRIPTION
|
|
94
|
-
Display autocomplete installation instructions.
|
|
95
|
-
|
|
96
|
-
EXAMPLES
|
|
97
|
-
$ zurf autocomplete
|
|
98
|
-
|
|
99
|
-
$ zurf autocomplete bash
|
|
100
|
-
|
|
101
|
-
$ zurf autocomplete zsh
|
|
102
|
-
|
|
103
|
-
$ zurf autocomplete powershell
|
|
104
|
-
|
|
105
|
-
$ zurf autocomplete --refresh-cache
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v3.2.42/src/commands/autocomplete/index.ts)_
|
|
109
|
-
|
|
110
|
-
## `zurf config which`
|
|
111
|
-
|
|
112
|
-
Show where the API key is loaded from
|
|
113
|
-
|
|
114
|
-
```
|
|
115
|
-
USAGE
|
|
116
|
-
$ zurf config which [--json]
|
|
117
|
-
|
|
118
|
-
FLAGS
|
|
119
|
-
--json [env: ZURF_JSON] Print machine-readable JSON to stdout
|
|
120
|
-
|
|
121
|
-
DESCRIPTION
|
|
122
|
-
Show where the API key is loaded from
|
|
123
|
-
|
|
124
|
-
Show where the Browserbase API key would be loaded from (no secret printed).
|
|
125
|
-
Resolution order: BROWSERBASE_API_KEY, then project .zurf/config.json (walk-up), then global config in the CLI config
|
|
126
|
-
directory.
|
|
127
|
-
|
|
128
|
-
EXAMPLES
|
|
129
|
-
$ zurf config which
|
|
130
|
-
|
|
131
|
-
$ zurf config which --json
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
_See code: [src/commands/config/which.ts](https://github.com/vibemastery/zurf/blob/v0.1.0/src/commands/config/which.ts)_
|
|
135
|
-
|
|
136
|
-
## `zurf fetch URL`
|
|
137
|
-
|
|
138
|
-
Fetch a URL via Browserbase
|
|
139
|
-
|
|
140
|
-
```
|
|
141
|
-
USAGE
|
|
142
|
-
$ zurf fetch URL [--json] [--allow-insecure-ssl] [--allow-redirects] [-o <value>] [--proxies]
|
|
143
|
-
|
|
144
|
-
ARGUMENTS
|
|
145
|
-
URL URL to fetch
|
|
146
|
-
|
|
147
|
-
FLAGS
|
|
148
|
-
-o, --output=<value> Write response body to this file (full content); otherwise human mode prints a truncated
|
|
149
|
-
preview to stdout
|
|
150
|
-
--allow-insecure-ssl Disable TLS certificate verification (use only if you trust the target)
|
|
151
|
-
--allow-redirects Follow HTTP redirects
|
|
152
|
-
--json [env: ZURF_JSON] Print machine-readable JSON to stdout
|
|
153
|
-
--proxies Route through Browserbase proxies (helps with some blocked sites)
|
|
154
|
-
|
|
155
|
-
DESCRIPTION
|
|
156
|
-
Fetch a URL via Browserbase
|
|
157
|
-
|
|
158
|
-
Fetch a URL via Browserbase (no browser session; static HTML, 1 MB max).
|
|
159
|
-
Requires authentication. Run `zurf init --global` or use a project key before first use.
|
|
160
|
-
|
|
161
|
-
EXAMPLES
|
|
162
|
-
$ zurf fetch https://example.com
|
|
163
|
-
|
|
164
|
-
$ zurf fetch https://example.com --json
|
|
165
|
-
|
|
166
|
-
$ zurf fetch https://example.com -o page.html --proxies
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
_See code: [src/commands/fetch/index.ts](https://github.com/vibemastery/zurf/blob/v0.1.0/src/commands/fetch/index.ts)_
|
|
170
|
-
|
|
171
|
-
## `zurf help [COMMAND]`
|
|
172
|
-
|
|
173
|
-
Display help for zurf.
|
|
174
|
-
|
|
175
|
-
```
|
|
176
|
-
USAGE
|
|
177
|
-
$ zurf help [COMMAND...] [-n]
|
|
178
|
-
|
|
179
|
-
ARGUMENTS
|
|
180
|
-
[COMMAND...] Command to show help for.
|
|
181
|
-
|
|
182
|
-
FLAGS
|
|
183
|
-
-n, --nested-commands Include all nested commands in the output.
|
|
184
|
-
|
|
185
|
-
DESCRIPTION
|
|
186
|
-
Display help for zurf.
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/6.2.40/src/commands/help.ts)_
|
|
190
|
-
|
|
191
|
-
## `zurf init`
|
|
192
|
-
|
|
193
|
-
Configure Browserbase API key storage
|
|
194
|
-
|
|
195
|
-
```
|
|
196
|
-
USAGE
|
|
197
|
-
$ zurf init [--json] [--api-key <value>] [--gitignore] [--global] [--local]
|
|
198
|
-
|
|
199
|
-
FLAGS
|
|
200
|
-
--api-key=<value> API key for non-interactive use. Prefer piping stdin or using a TTY prompt — values on the command
|
|
201
|
-
line are visible in shell history and process listings.
|
|
202
|
-
--gitignore Append .zurf/ to ./.gitignore if that entry is missing
|
|
203
|
-
--global Store API key in user config (oclif config dir for this CLI)
|
|
204
|
-
--json [env: ZURF_JSON] Print machine-readable JSON to stdout
|
|
205
|
-
--local Store API key in ./.zurf/config.json for this directory
|
|
206
|
-
|
|
207
|
-
DESCRIPTION
|
|
208
|
-
Configure Browserbase API key storage
|
|
209
|
-
|
|
210
|
-
Save your Browserbase API key to global or project config.
|
|
211
|
-
Global path follows oclif config (same as `zurf config which`).
|
|
212
|
-
|
|
213
|
-
EXAMPLES
|
|
214
|
-
$ zurf init --global
|
|
215
|
-
|
|
216
|
-
$ zurf init --local
|
|
217
|
-
|
|
218
|
-
printenv BROWSERBASE_API_KEY | zurf init --global
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
_See code: [src/commands/init/index.ts](https://github.com/vibemastery/zurf/blob/v0.1.0/src/commands/init/index.ts)_
|
|
222
|
-
|
|
223
|
-
## `zurf plugins`
|
|
224
|
-
|
|
225
|
-
List installed plugins.
|
|
226
|
-
|
|
227
|
-
```
|
|
228
|
-
USAGE
|
|
229
|
-
$ zurf plugins [--json] [--core]
|
|
230
|
-
|
|
231
|
-
FLAGS
|
|
232
|
-
--core Show core plugins.
|
|
233
|
-
|
|
234
|
-
GLOBAL FLAGS
|
|
235
|
-
--json Format output as json.
|
|
236
|
-
|
|
237
|
-
DESCRIPTION
|
|
238
|
-
List installed plugins.
|
|
239
|
-
|
|
240
|
-
EXAMPLES
|
|
241
|
-
$ zurf plugins
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/5.4.59/src/commands/plugins/index.ts)_
|
|
245
|
-
|
|
246
|
-
## `zurf plugins add PLUGIN`
|
|
247
|
-
|
|
248
|
-
Installs a plugin into zurf.
|
|
249
|
-
|
|
250
|
-
```
|
|
251
|
-
USAGE
|
|
252
|
-
$ zurf plugins add PLUGIN... [--json] [-f] [-h] [-s | -v]
|
|
253
|
-
|
|
254
|
-
ARGUMENTS
|
|
255
|
-
PLUGIN... Plugin to install.
|
|
256
|
-
|
|
257
|
-
FLAGS
|
|
258
|
-
-f, --force Force npm to fetch remote resources even if a local copy exists on disk.
|
|
259
|
-
-h, --help Show CLI help.
|
|
260
|
-
-s, --silent Silences npm output.
|
|
261
|
-
-v, --verbose Show verbose npm output.
|
|
262
|
-
|
|
263
|
-
GLOBAL FLAGS
|
|
264
|
-
--json Format output as json.
|
|
265
|
-
|
|
266
|
-
DESCRIPTION
|
|
267
|
-
Installs a plugin into zurf.
|
|
268
|
-
|
|
269
|
-
Uses npm to install plugins.
|
|
270
|
-
|
|
271
|
-
Installation of a user-installed plugin will override a core plugin.
|
|
272
|
-
|
|
273
|
-
Use the ZURF_NPM_LOG_LEVEL environment variable to set the npm loglevel.
|
|
274
|
-
Use the ZURF_NPM_REGISTRY environment variable to set the npm registry.
|
|
275
|
-
|
|
276
|
-
ALIASES
|
|
277
|
-
$ zurf plugins add
|
|
278
|
-
|
|
279
|
-
EXAMPLES
|
|
280
|
-
Install a plugin from npm registry.
|
|
281
|
-
|
|
282
|
-
$ zurf plugins add myplugin
|
|
283
|
-
|
|
284
|
-
Install a plugin from a github url.
|
|
285
|
-
|
|
286
|
-
$ zurf plugins add https://github.com/someuser/someplugin
|
|
287
|
-
|
|
288
|
-
Install a plugin from a github slug.
|
|
289
|
-
|
|
290
|
-
$ zurf plugins add someuser/someplugin
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
## `zurf plugins:inspect PLUGIN...`
|
|
294
|
-
|
|
295
|
-
Displays installation properties of a plugin.
|
|
296
|
-
|
|
297
|
-
```
|
|
298
|
-
USAGE
|
|
299
|
-
$ zurf plugins inspect PLUGIN...
|
|
300
|
-
|
|
301
|
-
ARGUMENTS
|
|
302
|
-
PLUGIN... [default: .] Plugin to inspect.
|
|
303
|
-
|
|
304
|
-
FLAGS
|
|
305
|
-
-h, --help Show CLI help.
|
|
306
|
-
-v, --verbose
|
|
307
|
-
|
|
308
|
-
GLOBAL FLAGS
|
|
309
|
-
--json Format output as json.
|
|
310
|
-
|
|
311
|
-
DESCRIPTION
|
|
312
|
-
Displays installation properties of a plugin.
|
|
313
|
-
|
|
314
|
-
EXAMPLES
|
|
315
|
-
$ zurf plugins inspect myplugin
|
|
316
|
-
```
|
|
317
|
-
|
|
318
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/5.4.59/src/commands/plugins/inspect.ts)_
|
|
319
|
-
|
|
320
|
-
## `zurf plugins install PLUGIN`
|
|
321
|
-
|
|
322
|
-
Installs a plugin into zurf.
|
|
323
|
-
|
|
324
|
-
```
|
|
325
|
-
USAGE
|
|
326
|
-
$ zurf plugins install PLUGIN... [--json] [-f] [-h] [-s | -v]
|
|
327
|
-
|
|
328
|
-
ARGUMENTS
|
|
329
|
-
PLUGIN... Plugin to install.
|
|
330
|
-
|
|
331
|
-
FLAGS
|
|
332
|
-
-f, --force Force npm to fetch remote resources even if a local copy exists on disk.
|
|
333
|
-
-h, --help Show CLI help.
|
|
334
|
-
-s, --silent Silences npm output.
|
|
335
|
-
-v, --verbose Show verbose npm output.
|
|
336
|
-
|
|
337
|
-
GLOBAL FLAGS
|
|
338
|
-
--json Format output as json.
|
|
339
|
-
|
|
340
|
-
DESCRIPTION
|
|
341
|
-
Installs a plugin into zurf.
|
|
342
|
-
|
|
343
|
-
Uses npm to install plugins.
|
|
344
|
-
|
|
345
|
-
Installation of a user-installed plugin will override a core plugin.
|
|
346
|
-
|
|
347
|
-
Use the ZURF_NPM_LOG_LEVEL environment variable to set the npm loglevel.
|
|
348
|
-
Use the ZURF_NPM_REGISTRY environment variable to set the npm registry.
|
|
349
|
-
|
|
350
|
-
ALIASES
|
|
351
|
-
$ zurf plugins add
|
|
352
|
-
|
|
353
|
-
EXAMPLES
|
|
354
|
-
Install a plugin from npm registry.
|
|
355
|
-
|
|
356
|
-
$ zurf plugins install myplugin
|
|
357
|
-
|
|
358
|
-
Install a plugin from a github url.
|
|
359
|
-
|
|
360
|
-
$ zurf plugins install https://github.com/someuser/someplugin
|
|
361
|
-
|
|
362
|
-
Install a plugin from a github slug.
|
|
363
|
-
|
|
364
|
-
$ zurf plugins install someuser/someplugin
|
|
365
|
-
```
|
|
366
|
-
|
|
367
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/5.4.59/src/commands/plugins/install.ts)_
|
|
368
|
-
|
|
369
|
-
## `zurf plugins link PATH`
|
|
370
|
-
|
|
371
|
-
Links a plugin into the CLI for development.
|
|
372
|
-
|
|
15
|
+
$ zurf init --global # save your Browserbase API key
|
|
16
|
+
$ zurf --help
|
|
373
17
|
```
|
|
374
|
-
USAGE
|
|
375
|
-
$ zurf plugins link PATH [-h] [--install] [-v]
|
|
376
|
-
|
|
377
|
-
ARGUMENTS
|
|
378
|
-
PATH [default: .] path to plugin
|
|
379
18
|
|
|
380
|
-
|
|
381
|
-
-h, --help Show CLI help.
|
|
382
|
-
-v, --verbose
|
|
383
|
-
--[no-]install Install dependencies after linking the plugin.
|
|
19
|
+
## Commands
|
|
384
20
|
|
|
385
|
-
|
|
386
|
-
Links a plugin into the CLI for development.
|
|
21
|
+
### `zurf search <query>`
|
|
387
22
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
|
|
391
|
-
command will override the user-installed or core plugin implementation. This is useful for development work.
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
EXAMPLES
|
|
395
|
-
$ zurf plugins link myplugin
|
|
396
|
-
```
|
|
397
|
-
|
|
398
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/5.4.59/src/commands/plugins/link.ts)_
|
|
399
|
-
|
|
400
|
-
## `zurf plugins remove [PLUGIN]`
|
|
401
|
-
|
|
402
|
-
Removes a plugin from the CLI.
|
|
23
|
+
Search the web via Browserbase (Exa-powered). Returns a list of matching URLs with titles and snippets.
|
|
403
24
|
|
|
25
|
+
```sh-session
|
|
26
|
+
$ zurf search "browserbase documentation"
|
|
27
|
+
$ zurf search "laravel inertia" --num-results 5 --json
|
|
404
28
|
```
|
|
405
|
-
USAGE
|
|
406
|
-
$ zurf plugins remove [PLUGIN...] [-h] [-v]
|
|
407
|
-
|
|
408
|
-
ARGUMENTS
|
|
409
|
-
[PLUGIN...] plugin to uninstall
|
|
410
29
|
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
30
|
+
| Flag | Description |
|
|
31
|
+
|------|-------------|
|
|
32
|
+
| `-n, --num-results` | Number of results, 1-25 (default: 10) |
|
|
33
|
+
| `--json` | Print machine-readable JSON to stdout |
|
|
414
34
|
|
|
415
|
-
|
|
416
|
-
Removes a plugin from the CLI.
|
|
35
|
+
### `zurf browse <url>`
|
|
417
36
|
|
|
418
|
-
|
|
419
|
-
$ zurf plugins unlink
|
|
420
|
-
$ zurf plugins remove
|
|
37
|
+
Open a URL in a real cloud Chromium browser via Browserbase, wait for JavaScript to fully render, then return the page content as **markdown** (default) or raw HTML.
|
|
421
38
|
|
|
422
|
-
|
|
423
|
-
$ zurf plugins remove myplugin
|
|
424
|
-
```
|
|
425
|
-
|
|
426
|
-
## `zurf plugins reset`
|
|
427
|
-
|
|
428
|
-
Remove all user-installed and linked plugins.
|
|
429
|
-
|
|
430
|
-
```
|
|
431
|
-
USAGE
|
|
432
|
-
$ zurf plugins reset [--hard] [--reinstall]
|
|
39
|
+
Best for JavaScript-heavy pages (SPAs, dashboards, pages behind client-side rendering).
|
|
433
40
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
41
|
+
```sh-session
|
|
42
|
+
$ zurf browse https://example.com # markdown output
|
|
43
|
+
$ zurf browse https://example.com --html # raw HTML output
|
|
44
|
+
$ zurf browse https://example.com -o page.md # save full content to file
|
|
45
|
+
$ zurf browse https://example.com --json # JSON with content + metadata
|
|
437
46
|
```
|
|
438
47
|
|
|
439
|
-
|
|
48
|
+
| Flag | Description |
|
|
49
|
+
|------|-------------|
|
|
50
|
+
| `--html` | Output raw HTML instead of markdown |
|
|
51
|
+
| `-o, --output` | Write full content to a file |
|
|
52
|
+
| `--json` | Print machine-readable JSON to stdout |
|
|
440
53
|
|
|
441
|
-
|
|
54
|
+
### `zurf fetch <url>`
|
|
442
55
|
|
|
443
|
-
|
|
56
|
+
Fetch a URL via Browserbase without launching a full browser session. Returns the content as **markdown** (default) or raw HTML. Fast and lightweight, but only works for static pages (no JavaScript rendering). 1 MB max.
|
|
444
57
|
|
|
58
|
+
```sh-session
|
|
59
|
+
$ zurf fetch https://example.com # markdown output
|
|
60
|
+
$ zurf fetch https://example.com --html # raw HTML output
|
|
61
|
+
$ zurf fetch https://example.com -o page.md # save full content to file
|
|
62
|
+
$ zurf fetch https://example.com --proxies # route through Browserbase proxies
|
|
63
|
+
$ zurf fetch https://example.com --json # JSON with content + metadata
|
|
445
64
|
```
|
|
446
|
-
USAGE
|
|
447
|
-
$ zurf plugins uninstall [PLUGIN...] [-h] [-v]
|
|
448
|
-
|
|
449
|
-
ARGUMENTS
|
|
450
|
-
[PLUGIN...] plugin to uninstall
|
|
451
65
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
66
|
+
| Flag | Description |
|
|
67
|
+
|------|-------------|
|
|
68
|
+
| `--html` | Output raw HTML instead of markdown |
|
|
69
|
+
| `-o, --output` | Write full content to a file |
|
|
70
|
+
| `--proxies` | Route through Browserbase proxies |
|
|
71
|
+
| `--allow-redirects` | Follow HTTP redirects |
|
|
72
|
+
| `--allow-insecure-ssl` | Disable TLS certificate verification |
|
|
73
|
+
| `--json` | Print machine-readable JSON to stdout |
|
|
455
74
|
|
|
456
|
-
|
|
457
|
-
Removes a plugin from the CLI.
|
|
75
|
+
### `zurf init`
|
|
458
76
|
|
|
459
|
-
|
|
460
|
-
$ zurf plugins unlink
|
|
461
|
-
$ zurf plugins remove
|
|
77
|
+
Save your Browserbase API key and optional Project ID to a config file.
|
|
462
78
|
|
|
463
|
-
|
|
464
|
-
|
|
79
|
+
```sh-session
|
|
80
|
+
$ zurf init --global # save to global config
|
|
81
|
+
$ zurf init --local # save to project .zurf/config.json
|
|
82
|
+
$ zurf init --local --gitignore # also append .zurf/ to .gitignore
|
|
83
|
+
$ zurf init --global --project-id <project-id> # save project ID too
|
|
465
84
|
```
|
|
466
85
|
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
## `zurf plugins unlink [PLUGIN]`
|
|
86
|
+
### `zurf config which`
|
|
470
87
|
|
|
471
|
-
|
|
88
|
+
Show where your API key and Project ID would be loaded from (nothing secret is printed).
|
|
472
89
|
|
|
90
|
+
```sh-session
|
|
91
|
+
$ zurf config which
|
|
92
|
+
$ zurf config which --json
|
|
473
93
|
```
|
|
474
|
-
USAGE
|
|
475
|
-
$ zurf plugins unlink [PLUGIN...] [-h] [-v]
|
|
476
94
|
|
|
477
|
-
|
|
478
|
-
[PLUGIN...] plugin to uninstall
|
|
95
|
+
## Output format
|
|
479
96
|
|
|
480
|
-
|
|
481
|
-
-h, --help Show CLI help.
|
|
482
|
-
-v, --verbose
|
|
97
|
+
`zurf browse` and `zurf fetch` return **markdown** by default — smaller and more useful for LLM agents. Pass `--html` (or set `ZURF_HTML=true`) to get raw HTML instead.
|
|
483
98
|
|
|
484
|
-
|
|
485
|
-
Removes a plugin from the CLI.
|
|
99
|
+
You can also set the default in `.zurf/config.json` or the global config:
|
|
486
100
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
$ zurf plugins remove
|
|
490
|
-
|
|
491
|
-
EXAMPLES
|
|
492
|
-
$ zurf plugins unlink myplugin
|
|
101
|
+
```json
|
|
102
|
+
{ "format": "html" }
|
|
493
103
|
```
|
|
494
104
|
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
Update installed plugins.
|
|
105
|
+
Format resolution (highest precedence first):
|
|
498
106
|
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
107
|
+
1. `--html` flag
|
|
108
|
+
2. `ZURF_HTML` environment variable (`true` or `1`)
|
|
109
|
+
3. Local `.zurf/config.json` `format` field
|
|
110
|
+
4. Global config `format` field
|
|
111
|
+
5. Default: `markdown`
|
|
502
112
|
|
|
503
|
-
|
|
504
|
-
-h, --help Show CLI help.
|
|
505
|
-
-v, --verbose
|
|
506
|
-
|
|
507
|
-
DESCRIPTION
|
|
508
|
-
Update installed plugins.
|
|
509
|
-
```
|
|
113
|
+
## Configuration
|
|
510
114
|
|
|
511
|
-
|
|
115
|
+
API key resolution (highest precedence first):
|
|
512
116
|
|
|
513
|
-
|
|
117
|
+
1. Environment variable `BROWSERBASE_API_KEY`
|
|
118
|
+
2. Nearest `.zurf/config.json` when walking up from the current working directory
|
|
119
|
+
3. Global config: `$XDG_CONFIG_HOME/zurf/config.json` (or `~/.config/zurf/config.json`)
|
|
514
120
|
|
|
515
|
-
|
|
121
|
+
Save a key interactively:
|
|
516
122
|
|
|
123
|
+
```sh-session
|
|
124
|
+
$ zurf init --global
|
|
125
|
+
$ zurf init --local
|
|
517
126
|
```
|
|
518
|
-
USAGE
|
|
519
|
-
$ zurf search QUERY [--json] [-n <value>]
|
|
520
|
-
|
|
521
|
-
ARGUMENTS
|
|
522
|
-
QUERY Search query, max 200 characters (quote for multiple words)
|
|
523
127
|
|
|
524
|
-
|
|
525
|
-
-n, --num-results=<value> [default: 10] Number of results (1–25)
|
|
526
|
-
--json [env: ZURF_JSON] Print machine-readable JSON to stdout
|
|
128
|
+
For project-local storage, add `.zurf/` to `.gitignore` so the key is never committed. You can run `zurf init --local --gitignore` to append a `.zurf/` entry automatically.
|
|
527
129
|
|
|
528
|
-
|
|
529
|
-
Search the web via Browserbase
|
|
130
|
+
**Security note:** Keys in `config.json` are stored as plaintext with file mode `0o600`. For shared machines or stricter setups, prefer `BROWSERBASE_API_KEY` from your environment or a secrets manager instead of `init`.
|
|
530
131
|
|
|
531
|
-
|
|
532
|
-
Requires authentication. Run `zurf init --global` or use a project key before first use.
|
|
132
|
+
## Claude Code and agents
|
|
533
133
|
|
|
534
|
-
|
|
535
|
-
$ zurf search "browserbase documentation"
|
|
134
|
+
Install `zurf` on your `PATH` and allow the agent to run shell commands. Use `--json` when you want structured output:
|
|
536
135
|
|
|
537
|
-
|
|
136
|
+
```sh-session
|
|
137
|
+
$ zurf search "browserbase fetch api" --json
|
|
138
|
+
$ zurf browse https://example.com --json
|
|
139
|
+
$ zurf fetch https://example.com --json
|
|
538
140
|
```
|
|
539
141
|
|
|
540
|
-
|
|
541
|
-
<!-- commandsstop -->
|
|
142
|
+
Content is returned as markdown by default, which keeps token counts low. Pass `--html` if the agent needs the raw DOM.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ZurfBrowserbaseCommand } from '../../lib/zurf-browserbase-command.js';
|
|
2
|
+
export default class Browse extends ZurfBrowserbaseCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
url: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
output: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
html: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
};
|
|
13
|
+
static summary: string;
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|