@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/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"commands": {
|
|
3
|
+
"browse": {
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"args": {
|
|
6
|
+
"url": {
|
|
7
|
+
"description": "URL to browse",
|
|
8
|
+
"name": "url",
|
|
9
|
+
"required": true
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"description": "Browse a URL in a cloud browser and return the rendered content as markdown (default) or raw HTML.\nUses a real Chromium browser via Browserbase, so JavaScript-heavy pages are fully rendered.\nRequires authentication and a Project ID. Run `zurf init --global` before first use.",
|
|
13
|
+
"examples": [
|
|
14
|
+
"<%= config.bin %> <%= command.id %> https://example.com",
|
|
15
|
+
"<%= config.bin %> <%= command.id %> https://example.com --html",
|
|
16
|
+
"<%= config.bin %> <%= command.id %> https://example.com --json",
|
|
17
|
+
"<%= config.bin %> <%= command.id %> https://example.com -o page.md"
|
|
18
|
+
],
|
|
19
|
+
"flags": {
|
|
20
|
+
"html": {
|
|
21
|
+
"description": "Output raw HTML instead of markdown",
|
|
22
|
+
"env": "ZURF_HTML",
|
|
23
|
+
"name": "html",
|
|
24
|
+
"allowNo": false,
|
|
25
|
+
"type": "boolean"
|
|
26
|
+
},
|
|
27
|
+
"json": {
|
|
28
|
+
"description": "Print machine-readable JSON to stdout",
|
|
29
|
+
"env": "ZURF_JSON",
|
|
30
|
+
"name": "json",
|
|
31
|
+
"allowNo": false,
|
|
32
|
+
"type": "boolean"
|
|
33
|
+
},
|
|
34
|
+
"output": {
|
|
35
|
+
"char": "o",
|
|
36
|
+
"description": "Write rendered content to this file (full content); otherwise human mode prints a truncated preview to stdout",
|
|
37
|
+
"name": "output",
|
|
38
|
+
"hasDynamicHelp": false,
|
|
39
|
+
"multiple": false,
|
|
40
|
+
"type": "option"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"hasDynamicHelp": false,
|
|
44
|
+
"hiddenAliases": [],
|
|
45
|
+
"id": "browse",
|
|
46
|
+
"pluginAlias": "@vibemastery/zurf",
|
|
47
|
+
"pluginName": "@vibemastery/zurf",
|
|
48
|
+
"pluginType": "core",
|
|
49
|
+
"strict": true,
|
|
50
|
+
"summary": "Browse a URL in a cloud browser and return rendered content as markdown",
|
|
51
|
+
"isESM": true,
|
|
52
|
+
"relativePath": [
|
|
53
|
+
"dist",
|
|
54
|
+
"commands",
|
|
55
|
+
"browse",
|
|
56
|
+
"index.js"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
3
59
|
"config:which": {
|
|
4
60
|
"aliases": [],
|
|
5
61
|
"args": {},
|
|
@@ -9,6 +65,13 @@
|
|
|
9
65
|
"<%= config.bin %> config which --json"
|
|
10
66
|
],
|
|
11
67
|
"flags": {
|
|
68
|
+
"html": {
|
|
69
|
+
"description": "Output raw HTML instead of markdown",
|
|
70
|
+
"env": "ZURF_HTML",
|
|
71
|
+
"name": "html",
|
|
72
|
+
"allowNo": false,
|
|
73
|
+
"type": "boolean"
|
|
74
|
+
},
|
|
12
75
|
"json": {
|
|
13
76
|
"description": "Print machine-readable JSON to stdout",
|
|
14
77
|
"env": "ZURF_JSON",
|
|
@@ -34,6 +97,81 @@
|
|
|
34
97
|
"which.js"
|
|
35
98
|
]
|
|
36
99
|
},
|
|
100
|
+
"init": {
|
|
101
|
+
"aliases": [],
|
|
102
|
+
"args": {},
|
|
103
|
+
"description": "Save your Browserbase API key and optional Project ID to global or project config.\nGlobal path follows oclif config (same as `zurf config which`).",
|
|
104
|
+
"examples": [
|
|
105
|
+
"<%= config.bin %> <%= command.id %> --global",
|
|
106
|
+
"<%= config.bin %> <%= command.id %> --local",
|
|
107
|
+
"<%= config.bin %> <%= command.id %> --global --api-key KEY --project-id PROJ_ID",
|
|
108
|
+
"printenv BROWSERBASE_API_KEY | <%= config.bin %> <%= command.id %> --global"
|
|
109
|
+
],
|
|
110
|
+
"flags": {
|
|
111
|
+
"html": {
|
|
112
|
+
"description": "Output raw HTML instead of markdown",
|
|
113
|
+
"env": "ZURF_HTML",
|
|
114
|
+
"name": "html",
|
|
115
|
+
"allowNo": false,
|
|
116
|
+
"type": "boolean"
|
|
117
|
+
},
|
|
118
|
+
"json": {
|
|
119
|
+
"description": "Print machine-readable JSON to stdout",
|
|
120
|
+
"env": "ZURF_JSON",
|
|
121
|
+
"name": "json",
|
|
122
|
+
"allowNo": false,
|
|
123
|
+
"type": "boolean"
|
|
124
|
+
},
|
|
125
|
+
"api-key": {
|
|
126
|
+
"description": "API key for non-interactive use. Prefer piping stdin or using a TTY prompt — values on the command line are visible in shell history and process listings.",
|
|
127
|
+
"name": "api-key",
|
|
128
|
+
"hasDynamicHelp": false,
|
|
129
|
+
"multiple": false,
|
|
130
|
+
"type": "option"
|
|
131
|
+
},
|
|
132
|
+
"gitignore": {
|
|
133
|
+
"description": "Append .zurf/ to ./.gitignore if that entry is missing",
|
|
134
|
+
"name": "gitignore",
|
|
135
|
+
"allowNo": false,
|
|
136
|
+
"type": "boolean"
|
|
137
|
+
},
|
|
138
|
+
"global": {
|
|
139
|
+
"description": "Store API key in user config (oclif config dir for this CLI)",
|
|
140
|
+
"name": "global",
|
|
141
|
+
"allowNo": false,
|
|
142
|
+
"type": "boolean"
|
|
143
|
+
},
|
|
144
|
+
"local": {
|
|
145
|
+
"description": "Store API key in ./.zurf/config.json for this directory",
|
|
146
|
+
"name": "local",
|
|
147
|
+
"allowNo": false,
|
|
148
|
+
"type": "boolean"
|
|
149
|
+
},
|
|
150
|
+
"project-id": {
|
|
151
|
+
"description": "Browserbase Project ID (optional; needed for browse, screenshot, pdf commands)",
|
|
152
|
+
"name": "project-id",
|
|
153
|
+
"hasDynamicHelp": false,
|
|
154
|
+
"multiple": false,
|
|
155
|
+
"type": "option"
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"hasDynamicHelp": false,
|
|
159
|
+
"hiddenAliases": [],
|
|
160
|
+
"id": "init",
|
|
161
|
+
"pluginAlias": "@vibemastery/zurf",
|
|
162
|
+
"pluginName": "@vibemastery/zurf",
|
|
163
|
+
"pluginType": "core",
|
|
164
|
+
"strict": true,
|
|
165
|
+
"summary": "Configure Browserbase API key and Project ID storage",
|
|
166
|
+
"enableJsonFlag": false,
|
|
167
|
+
"isESM": true,
|
|
168
|
+
"relativePath": [
|
|
169
|
+
"dist",
|
|
170
|
+
"commands",
|
|
171
|
+
"init",
|
|
172
|
+
"index.js"
|
|
173
|
+
]
|
|
174
|
+
},
|
|
37
175
|
"fetch": {
|
|
38
176
|
"aliases": [],
|
|
39
177
|
"args": {
|
|
@@ -43,13 +181,21 @@
|
|
|
43
181
|
"required": true
|
|
44
182
|
}
|
|
45
183
|
},
|
|
46
|
-
"description": "Fetch a URL via Browserbase (no browser session; static HTML, 1 MB max).\nRequires authentication. Run `zurf init --global` or use a project key before first use.",
|
|
184
|
+
"description": "Fetch a URL via Browserbase and return content as markdown (default) or raw HTML (no browser session; static HTML, 1 MB max).\nRequires authentication. Run `zurf init --global` or use a project key before first use.",
|
|
47
185
|
"examples": [
|
|
48
186
|
"<%= config.bin %> <%= command.id %> https://example.com",
|
|
187
|
+
"<%= config.bin %> <%= command.id %> https://example.com --html",
|
|
49
188
|
"<%= config.bin %> <%= command.id %> https://example.com --json",
|
|
50
|
-
"<%= config.bin %> <%= command.id %> https://example.com -o page.
|
|
189
|
+
"<%= config.bin %> <%= command.id %> https://example.com -o page.md --proxies"
|
|
51
190
|
],
|
|
52
191
|
"flags": {
|
|
192
|
+
"html": {
|
|
193
|
+
"description": "Output raw HTML instead of markdown",
|
|
194
|
+
"env": "ZURF_HTML",
|
|
195
|
+
"name": "html",
|
|
196
|
+
"allowNo": false,
|
|
197
|
+
"type": "boolean"
|
|
198
|
+
},
|
|
53
199
|
"json": {
|
|
54
200
|
"description": "Print machine-readable JSON to stdout",
|
|
55
201
|
"env": "ZURF_JSON",
|
|
@@ -91,7 +237,7 @@
|
|
|
91
237
|
"pluginName": "@vibemastery/zurf",
|
|
92
238
|
"pluginType": "core",
|
|
93
239
|
"strict": true,
|
|
94
|
-
"summary": "Fetch a URL via Browserbase",
|
|
240
|
+
"summary": "Fetch a URL via Browserbase and return content as markdown",
|
|
95
241
|
"isESM": true,
|
|
96
242
|
"relativePath": [
|
|
97
243
|
"dist",
|
|
@@ -115,6 +261,13 @@
|
|
|
115
261
|
"<%= config.bin %> <%= command.id %> \"laravel inertia\" --num-results 5 --json"
|
|
116
262
|
],
|
|
117
263
|
"flags": {
|
|
264
|
+
"html": {
|
|
265
|
+
"description": "Output raw HTML instead of markdown",
|
|
266
|
+
"env": "ZURF_HTML",
|
|
267
|
+
"name": "html",
|
|
268
|
+
"allowNo": false,
|
|
269
|
+
"type": "boolean"
|
|
270
|
+
},
|
|
118
271
|
"json": {
|
|
119
272
|
"description": "Print machine-readable JSON to stdout",
|
|
120
273
|
"env": "ZURF_JSON",
|
|
@@ -147,67 +300,7 @@
|
|
|
147
300
|
"search",
|
|
148
301
|
"index.js"
|
|
149
302
|
]
|
|
150
|
-
},
|
|
151
|
-
"init": {
|
|
152
|
-
"aliases": [],
|
|
153
|
-
"args": {},
|
|
154
|
-
"description": "Save your Browserbase API key to global or project config.\nGlobal path follows oclif config (same as `zurf config which`).",
|
|
155
|
-
"examples": [
|
|
156
|
-
"<%= config.bin %> <%= command.id %> --global",
|
|
157
|
-
"<%= config.bin %> <%= command.id %> --local",
|
|
158
|
-
"printenv BROWSERBASE_API_KEY | <%= config.bin %> <%= command.id %> --global"
|
|
159
|
-
],
|
|
160
|
-
"flags": {
|
|
161
|
-
"json": {
|
|
162
|
-
"description": "Print machine-readable JSON to stdout",
|
|
163
|
-
"env": "ZURF_JSON",
|
|
164
|
-
"name": "json",
|
|
165
|
-
"allowNo": false,
|
|
166
|
-
"type": "boolean"
|
|
167
|
-
},
|
|
168
|
-
"api-key": {
|
|
169
|
-
"description": "API key for non-interactive use. Prefer piping stdin or using a TTY prompt — values on the command line are visible in shell history and process listings.",
|
|
170
|
-
"name": "api-key",
|
|
171
|
-
"hasDynamicHelp": false,
|
|
172
|
-
"multiple": false,
|
|
173
|
-
"type": "option"
|
|
174
|
-
},
|
|
175
|
-
"gitignore": {
|
|
176
|
-
"description": "Append .zurf/ to ./.gitignore if that entry is missing",
|
|
177
|
-
"name": "gitignore",
|
|
178
|
-
"allowNo": false,
|
|
179
|
-
"type": "boolean"
|
|
180
|
-
},
|
|
181
|
-
"global": {
|
|
182
|
-
"description": "Store API key in user config (oclif config dir for this CLI)",
|
|
183
|
-
"name": "global",
|
|
184
|
-
"allowNo": false,
|
|
185
|
-
"type": "boolean"
|
|
186
|
-
},
|
|
187
|
-
"local": {
|
|
188
|
-
"description": "Store API key in ./.zurf/config.json for this directory",
|
|
189
|
-
"name": "local",
|
|
190
|
-
"allowNo": false,
|
|
191
|
-
"type": "boolean"
|
|
192
|
-
}
|
|
193
|
-
},
|
|
194
|
-
"hasDynamicHelp": false,
|
|
195
|
-
"hiddenAliases": [],
|
|
196
|
-
"id": "init",
|
|
197
|
-
"pluginAlias": "@vibemastery/zurf",
|
|
198
|
-
"pluginName": "@vibemastery/zurf",
|
|
199
|
-
"pluginType": "core",
|
|
200
|
-
"strict": true,
|
|
201
|
-
"summary": "Configure Browserbase API key storage",
|
|
202
|
-
"enableJsonFlag": false,
|
|
203
|
-
"isESM": true,
|
|
204
|
-
"relativePath": [
|
|
205
|
-
"dist",
|
|
206
|
-
"commands",
|
|
207
|
-
"init",
|
|
208
|
-
"index.js"
|
|
209
|
-
]
|
|
210
303
|
}
|
|
211
304
|
},
|
|
212
|
-
"version": "0.
|
|
305
|
+
"version": "0.2.3"
|
|
213
306
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibemastery/zurf",
|
|
3
3
|
"description": "A lightweight CLI for searching and fetching web pages, powered by Browserbase.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.3",
|
|
5
5
|
"author": "Luis Güette",
|
|
6
6
|
"bin": {
|
|
7
7
|
"zurf": "./bin/run.js"
|
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
"@oclif/plugin-help": "^6",
|
|
15
15
|
"@oclif/plugin-not-found": "^3.2.77",
|
|
16
16
|
"@oclif/plugin-plugins": "^5",
|
|
17
|
-
"@oclif/plugin-warn-if-update-available": "^3.1.57"
|
|
17
|
+
"@oclif/plugin-warn-if-update-available": "^3.1.57",
|
|
18
|
+
"playwright-core": "^1.58.2",
|
|
19
|
+
"turndown": "^7.2.2"
|
|
18
20
|
},
|
|
19
21
|
"devDependencies": {
|
|
20
22
|
"@eslint/compat": "^1",
|
|
@@ -23,6 +25,7 @@
|
|
|
23
25
|
"@types/chai": "^4",
|
|
24
26
|
"@types/mocha": "^10",
|
|
25
27
|
"@types/node": "^18",
|
|
28
|
+
"@types/turndown": "^5.0.6",
|
|
26
29
|
"chai": "^4",
|
|
27
30
|
"eslint": "^9",
|
|
28
31
|
"eslint-config-oclif": "^6",
|
|
@@ -81,10 +84,9 @@
|
|
|
81
84
|
"lint": "eslint",
|
|
82
85
|
"postpack": "shx rm -f oclif.manifest.json",
|
|
83
86
|
"posttest": "pnpm run lint",
|
|
84
|
-
"prepack": "oclif manifest
|
|
87
|
+
"prepack": "oclif manifest",
|
|
85
88
|
"pretest": "pnpm run build",
|
|
86
|
-
"test": "mocha --forbid-only \"test/**/*.test.ts\""
|
|
87
|
-
"version": "oclif readme && git add README.md"
|
|
89
|
+
"test": "mocha --forbid-only \"test/**/*.test.ts\""
|
|
88
90
|
},
|
|
89
91
|
"types": "dist/index.d.ts"
|
|
90
92
|
}
|