@vibemastery/zurf 0.1.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.
Files changed (40) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +541 -0
  3. package/bin/dev.cmd +3 -0
  4. package/bin/dev.js +28 -0
  5. package/bin/run.cmd +3 -0
  6. package/bin/run.js +17 -0
  7. package/dist/commands/config/which.d.ts +10 -0
  8. package/dist/commands/config/which.js +61 -0
  9. package/dist/commands/fetch/index.d.ts +17 -0
  10. package/dist/commands/fetch/index.js +111 -0
  11. package/dist/commands/init/index.d.ts +15 -0
  12. package/dist/commands/init/index.js +95 -0
  13. package/dist/commands/search/index.d.ts +14 -0
  14. package/dist/commands/search/index.js +59 -0
  15. package/dist/index.d.ts +1 -0
  16. package/dist/index.js +1 -0
  17. package/dist/lib/browserbase-client.d.ts +12 -0
  18. package/dist/lib/browserbase-client.js +16 -0
  19. package/dist/lib/browserbase-command.d.ts +8 -0
  20. package/dist/lib/browserbase-command.js +16 -0
  21. package/dist/lib/cli-errors.d.ts +19 -0
  22. package/dist/lib/cli-errors.js +36 -0
  23. package/dist/lib/config.d.ts +34 -0
  24. package/dist/lib/config.js +66 -0
  25. package/dist/lib/fetch-output.d.ts +20 -0
  26. package/dist/lib/fetch-output.js +23 -0
  27. package/dist/lib/flags.d.ts +6 -0
  28. package/dist/lib/flags.js +10 -0
  29. package/dist/lib/gitignore-zurf.d.ts +5 -0
  30. package/dist/lib/gitignore-zurf.js +45 -0
  31. package/dist/lib/init-input.d.ts +2 -0
  32. package/dist/lib/init-input.js +26 -0
  33. package/dist/lib/json-output.d.ts +3 -0
  34. package/dist/lib/json-output.js +11 -0
  35. package/dist/lib/search-output.d.ts +16 -0
  36. package/dist/lib/search-output.js +20 -0
  37. package/dist/lib/zurf-browserbase-command.d.ts +8 -0
  38. package/dist/lib/zurf-browserbase-command.js +36 -0
  39. package/oclif.manifest.json +213 -0
  40. package/package.json +90 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Luis Güette
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,541 @@
1
+ zurf
2
+ =================
3
+
4
+ A lightweight CLI for searching and fetching web pages, powered by Browserbase.
5
+
6
+
7
+ [![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
8
+ [![Version](https://img.shields.io/npm/v/zurf.svg)](https://npmjs.org/package/zurf)
9
+ [![Downloads/week](https://img.shields.io/npm/dw/zurf.svg)](https://npmjs.org/package/zurf)
10
+
11
+ ## Configuration
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`:
21
+
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
+ ```sh-session
49
+ $ npm install -g @vibemastery/zurf
50
+ $ zurf COMMAND
51
+ running command...
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
+
373
+ ```
374
+ USAGE
375
+ $ zurf plugins link PATH [-h] [--install] [-v]
376
+
377
+ ARGUMENTS
378
+ PATH [default: .] path to plugin
379
+
380
+ FLAGS
381
+ -h, --help Show CLI help.
382
+ -v, --verbose
383
+ --[no-]install Install dependencies after linking the plugin.
384
+
385
+ DESCRIPTION
386
+ Links a plugin into the CLI for development.
387
+
388
+ Installation of a linked plugin will override a user-installed or core plugin.
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.
403
+
404
+ ```
405
+ USAGE
406
+ $ zurf plugins remove [PLUGIN...] [-h] [-v]
407
+
408
+ ARGUMENTS
409
+ [PLUGIN...] plugin to uninstall
410
+
411
+ FLAGS
412
+ -h, --help Show CLI help.
413
+ -v, --verbose
414
+
415
+ DESCRIPTION
416
+ Removes a plugin from the CLI.
417
+
418
+ ALIASES
419
+ $ zurf plugins unlink
420
+ $ zurf plugins remove
421
+
422
+ EXAMPLES
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]
433
+
434
+ FLAGS
435
+ --hard Delete node_modules and package manager related files in addition to uninstalling plugins.
436
+ --reinstall Reinstall all plugins after uninstalling.
437
+ ```
438
+
439
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/5.4.59/src/commands/plugins/reset.ts)_
440
+
441
+ ## `zurf plugins uninstall [PLUGIN]`
442
+
443
+ Removes a plugin from the CLI.
444
+
445
+ ```
446
+ USAGE
447
+ $ zurf plugins uninstall [PLUGIN...] [-h] [-v]
448
+
449
+ ARGUMENTS
450
+ [PLUGIN...] plugin to uninstall
451
+
452
+ FLAGS
453
+ -h, --help Show CLI help.
454
+ -v, --verbose
455
+
456
+ DESCRIPTION
457
+ Removes a plugin from the CLI.
458
+
459
+ ALIASES
460
+ $ zurf plugins unlink
461
+ $ zurf plugins remove
462
+
463
+ EXAMPLES
464
+ $ zurf plugins uninstall myplugin
465
+ ```
466
+
467
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/5.4.59/src/commands/plugins/uninstall.ts)_
468
+
469
+ ## `zurf plugins unlink [PLUGIN]`
470
+
471
+ Removes a plugin from the CLI.
472
+
473
+ ```
474
+ USAGE
475
+ $ zurf plugins unlink [PLUGIN...] [-h] [-v]
476
+
477
+ ARGUMENTS
478
+ [PLUGIN...] plugin to uninstall
479
+
480
+ FLAGS
481
+ -h, --help Show CLI help.
482
+ -v, --verbose
483
+
484
+ DESCRIPTION
485
+ Removes a plugin from the CLI.
486
+
487
+ ALIASES
488
+ $ zurf plugins unlink
489
+ $ zurf plugins remove
490
+
491
+ EXAMPLES
492
+ $ zurf plugins unlink myplugin
493
+ ```
494
+
495
+ ## `zurf plugins update`
496
+
497
+ Update installed plugins.
498
+
499
+ ```
500
+ USAGE
501
+ $ zurf plugins update [-h] [-v]
502
+
503
+ FLAGS
504
+ -h, --help Show CLI help.
505
+ -v, --verbose
506
+
507
+ DESCRIPTION
508
+ Update installed plugins.
509
+ ```
510
+
511
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/5.4.59/src/commands/plugins/update.ts)_
512
+
513
+ ## `zurf search QUERY`
514
+
515
+ Search the web via Browserbase
516
+
517
+ ```
518
+ USAGE
519
+ $ zurf search QUERY [--json] [-n <value>]
520
+
521
+ ARGUMENTS
522
+ QUERY Search query, max 200 characters (quote for multiple words)
523
+
524
+ FLAGS
525
+ -n, --num-results=<value> [default: 10] Number of results (1–25)
526
+ --json [env: ZURF_JSON] Print machine-readable JSON to stdout
527
+
528
+ DESCRIPTION
529
+ Search the web via Browserbase
530
+
531
+ Search the web via Browserbase (Exa-powered).
532
+ Requires authentication. Run `zurf init --global` or use a project key before first use.
533
+
534
+ EXAMPLES
535
+ $ zurf search "browserbase documentation"
536
+
537
+ $ zurf search "laravel inertia" --num-results 5 --json
538
+ ```
539
+
540
+ _See code: [src/commands/search/index.ts](https://github.com/vibemastery/zurf/blob/v0.1.0/src/commands/search/index.ts)_
541
+ <!-- commandsstop -->
package/bin/dev.cmd ADDED
@@ -0,0 +1,3 @@
1
+ @echo off
2
+
3
+ node --loader ts-node/esm --no-warnings=ExperimentalWarning "%~dp0\dev" %*
package/bin/dev.js ADDED
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env node
2
+ /* eslint-disable n/no-unsupported-features/node-builtins -- register ts-node ESM */
3
+ /* eslint-disable n/no-unpublished-import -- dev bundle loads ../src */
4
+
5
+ import {register} from 'node:module'
6
+ import {dirname, join} from 'node:path'
7
+ import {fileURLToPath, pathToFileURL} from 'node:url'
8
+
9
+ const root = join(dirname(fileURLToPath(import.meta.url)), '..')
10
+ register('ts-node/esm', pathToFileURL(`${root}/`))
11
+
12
+ const {flush, handle, run, settings} = await import('@oclif/core')
13
+ const {CliJsonExitContractError} = await import('../src/lib/cli-errors.js')
14
+
15
+ process.env.NODE_ENV = 'development'
16
+ settings.debug = true
17
+
18
+ try {
19
+ await run(process.argv.slice(2), import.meta.url)
20
+ } catch (error) {
21
+ if (error instanceof CliJsonExitContractError) {
22
+ process.exitCode = 1
23
+ } else {
24
+ await handle(error)
25
+ }
26
+ } finally {
27
+ await flush()
28
+ }
package/bin/run.cmd ADDED
@@ -0,0 +1,3 @@
1
+ @echo off
2
+
3
+ node "%~dp0\run" %*
package/bin/run.js ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+
3
+ import {flush, handle, run} from '@oclif/core'
4
+
5
+ import {CliJsonExitContractError} from '../dist/lib/cli-errors.js'
6
+
7
+ try {
8
+ await run(process.argv.slice(2), import.meta.url)
9
+ } catch (error) {
10
+ if (error instanceof CliJsonExitContractError) {
11
+ process.exitCode = 1
12
+ } else {
13
+ await handle(error)
14
+ }
15
+ } finally {
16
+ await flush()
17
+ }
@@ -0,0 +1,10 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class ConfigWhich extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
+ };
8
+ static summary: string;
9
+ run(): Promise<void>;
10
+ }
@@ -0,0 +1,61 @@
1
+ import { Command } from '@oclif/core';
2
+ import { globalConfigFilePath, resolveApiKey } from '../../lib/config.js';
3
+ import { zurfBaseFlags } from '../../lib/flags.js';
4
+ import { printJson } from '../../lib/json-output.js';
5
+ export default class ConfigWhich extends Command {
6
+ static description = `Show where the Browserbase API key would be loaded from (no secret printed).
7
+ Resolution order: BROWSERBASE_API_KEY, then project .zurf/config.json (walk-up), then global config in the CLI config directory.`;
8
+ static examples = ['<%= config.bin %> config which', '<%= config.bin %> config which --json'];
9
+ static flags = {
10
+ ...zurfBaseFlags,
11
+ };
12
+ static summary = 'Show where the API key is loaded from';
13
+ async run() {
14
+ const { flags } = await this.parse(ConfigWhich);
15
+ const resolved = resolveApiKey({ globalConfigDir: this.config.configDir });
16
+ if (flags.json) {
17
+ switch (resolved.source) {
18
+ case 'env': {
19
+ printJson({ envVar: 'BROWSERBASE_API_KEY', source: 'env' });
20
+ break;
21
+ }
22
+ case 'global': {
23
+ printJson({ path: resolved.path, source: 'global' });
24
+ break;
25
+ }
26
+ case 'local': {
27
+ printJson({ path: resolved.path, source: 'local' });
28
+ break;
29
+ }
30
+ case 'none': {
31
+ printJson({
32
+ globalConfigPath: globalConfigFilePath(this.config.configDir),
33
+ hint: `Run \`${this.config.bin} init --global\` or \`${this.config.bin} init --local\`, or set BROWSERBASE_API_KEY.`,
34
+ source: 'none',
35
+ });
36
+ this.exit(1);
37
+ break;
38
+ }
39
+ }
40
+ return;
41
+ }
42
+ switch (resolved.source) {
43
+ case 'env': {
44
+ this.log('API key source: environment variable BROWSERBASE_API_KEY');
45
+ break;
46
+ }
47
+ case 'global': {
48
+ this.log(`API key source: global file ${resolved.path}`);
49
+ break;
50
+ }
51
+ case 'local': {
52
+ this.log(`API key source: local file ${resolved.path}`);
53
+ break;
54
+ }
55
+ case 'none': {
56
+ this.error(`No API key configured. Set BROWSERBASE_API_KEY or run \`${this.config.bin} init --global\` / \`--local\`.`);
57
+ break;
58
+ }
59
+ }
60
+ }
61
+ }
@@ -0,0 +1,17 @@
1
+ import { ZurfBrowserbaseCommand } from '../../lib/zurf-browserbase-command.js';
2
+ export default class Fetch 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
+ 'allow-insecure-ssl': import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
+ 'allow-redirects': import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ output: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ proxies: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
+ };
15
+ static summary: string;
16
+ run(): Promise<void>;
17
+ }