browse 0.8.2 → 0.8.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 +4 -4
- package/dist/commands/click.js +0 -1
- package/dist/commands/network/on.js +0 -1
- package/dist/lib/cloud/api.js +5 -2
- package/dist/lib/driver/doctor.js +5 -10
- package/dist/lib/driver/mode.js +5 -3
- package/dist/lib/driver/remote-binding.js +27 -0
- package/dist/lib/driver/remote-types.js +1 -0
- package/dist/lib/driver/remote.disabled.js +18 -0
- package/dist/lib/driver/remote.js +37 -0
- package/dist/lib/driver/session-manager.js +4 -15
- package/oclif.manifest.json +189 -191
- package/package.json +16 -19
- package/skills/browse/SKILL.md +1 -1
package/README.md
CHANGED
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/browse)
|
|
8
8
|
[](https://www.npmjs.com/package/browse)
|
|
9
|
-
[](https://github.com/browserbase/
|
|
9
|
+
[](https://github.com/browserbase/stagehand/blob/main/packages/cli/LICENSE)
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
npm install -g browse
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
<img src="https://github.com/browserbase/
|
|
15
|
+
<img src="https://github.com/browserbase/stagehand/blob/main/packages/cli/media/browse.gif?raw=true" alt="browse CLI demo" width="100%" />
|
|
16
16
|
|
|
17
17
|
</div>
|
|
18
18
|
|
|
@@ -135,8 +135,8 @@ Local driver commands (`--local`) work without an API key.
|
|
|
135
135
|
|
|
136
136
|
- [browse.sh](https://browse.sh) — open web skills catalog
|
|
137
137
|
- [Browserbase docs](https://docs.browserbase.com)
|
|
138
|
-
- [GitHub](https://github.com/browserbase/cli) · [Issues](https://github.com/browserbase/
|
|
138
|
+
- [GitHub](https://github.com/browserbase/stagehand/tree/main/packages/cli) · [Issues](https://github.com/browserbase/stagehand/issues)
|
|
139
139
|
|
|
140
140
|
## License
|
|
141
141
|
|
|
142
|
-
[MIT](https://github.com/browserbase/
|
|
142
|
+
[MIT](https://github.com/browserbase/stagehand/blob/main/packages/cli/LICENSE)
|
package/dist/commands/click.js
CHANGED
|
@@ -4,7 +4,6 @@ import { driverCommandFlags, runDriverCommandFromFlags, } from "../lib/driver/co
|
|
|
4
4
|
export default class Click extends BrowseCommand {
|
|
5
5
|
static description = "Click an element by snapshot ref, XPath, or selector. Use `browse mouse click` for raw coordinates.";
|
|
6
6
|
static examples = [
|
|
7
|
-
"browse snapshot --compact",
|
|
8
7
|
"browse click @0-12",
|
|
9
8
|
"browse click 'button[type=submit]'",
|
|
10
9
|
"browse click @0-12 --session research",
|
|
@@ -4,7 +4,6 @@ export default class NetworkOn extends BrowseCommand {
|
|
|
4
4
|
static description = "Enable network capture for the active browser session.";
|
|
5
5
|
static examples = [
|
|
6
6
|
"browse network on",
|
|
7
|
-
"browse network path",
|
|
8
7
|
"browse network on --session research",
|
|
9
8
|
];
|
|
10
9
|
static flags = {
|
package/dist/lib/cloud/api.js
CHANGED
|
@@ -12,8 +12,11 @@ export function resolveApiKey(args) {
|
|
|
12
12
|
const apiKey = args.apiKey ?? process.env.BROWSERBASE_API_KEY;
|
|
13
13
|
return (apiKey ||
|
|
14
14
|
fail([
|
|
15
|
-
"Missing Browserbase API key.
|
|
16
|
-
|
|
15
|
+
"Missing Browserbase API key. Cloud commands (search, fetch, sessions, functions, ...) need one.",
|
|
16
|
+
"Set BROWSERBASE_API_KEY or pass --api-key.",
|
|
17
|
+
`Get a key at ${browserbaseSettingsUrl}.`,
|
|
18
|
+
"",
|
|
19
|
+
"No key? Local browser automation needs none. Try: browse open <url> --local",
|
|
17
20
|
].join("\n"), 1, {
|
|
18
21
|
resultCode: "missing_api_key",
|
|
19
22
|
requestHadHttpResponse: false,
|
|
@@ -6,6 +6,7 @@ import { isProcessAlive } from "./daemon/process.js";
|
|
|
6
6
|
import { discoverLocalCdp, } from "./local-cdp-discovery.js";
|
|
7
7
|
import { hasExplicitDriverTarget } from "./command-cli.js";
|
|
8
8
|
import { resolveConnectionTarget, targetsCompatible } from "./mode.js";
|
|
9
|
+
import { getRemote } from "./remote-binding.js";
|
|
9
10
|
const DEFAULT_URL = "https://example.com";
|
|
10
11
|
export async function buildDoctorReport(options, deps = {}) {
|
|
11
12
|
const checks = [];
|
|
@@ -176,18 +177,12 @@ async function checkTargetPrerequisite(target, flags, session, env, deps) {
|
|
|
176
177
|
};
|
|
177
178
|
}
|
|
178
179
|
if (target.kind === "remote") {
|
|
179
|
-
|
|
180
|
-
return {
|
|
181
|
-
message: "BROWSERBASE_API_KEY is set",
|
|
182
|
-
name: "browserbase",
|
|
183
|
-
status: "ok",
|
|
184
|
-
};
|
|
185
|
-
}
|
|
180
|
+
const result = (await getRemote()).remoteDoctorCheck(env);
|
|
186
181
|
return {
|
|
187
|
-
fix:
|
|
188
|
-
message:
|
|
182
|
+
...(result.fix ? { fix: result.fix } : {}),
|
|
183
|
+
message: result.message,
|
|
189
184
|
name: "browserbase",
|
|
190
|
-
status: "fail",
|
|
185
|
+
status: result.ok ? "ok" : "fail",
|
|
191
186
|
};
|
|
192
187
|
}
|
|
193
188
|
if (target.kind === "auto-connect") {
|
package/dist/lib/driver/mode.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { fail } from "../errors.js";
|
|
2
|
+
import { getRemote } from "./remote-binding.js";
|
|
2
3
|
import { resolveWsTarget } from "./resolve-ws.js";
|
|
3
4
|
function resolveHeadless(flags) {
|
|
4
5
|
if (flags.headed && flags.headless) {
|
|
@@ -45,17 +46,18 @@ export async function resolveConnectionTarget(flags) {
|
|
|
45
46
|
flags.headed ? "--headed" : null,
|
|
46
47
|
flags.headless ? "--headless" : null,
|
|
47
48
|
]);
|
|
48
|
-
return
|
|
49
|
+
return (await getRemote()).resolveExplicitRemoteTarget(flags);
|
|
49
50
|
}
|
|
50
51
|
if (flags.local) {
|
|
51
52
|
return { kind: "managed-local", headless: resolveHeadless(flags) };
|
|
52
53
|
}
|
|
53
|
-
|
|
54
|
+
const autoRemote = (await getRemote()).autoSelectRemoteTarget();
|
|
55
|
+
if (autoRemote) {
|
|
54
56
|
failOnConflictingFlags("remote mode", [
|
|
55
57
|
flags.headed ? "--headed" : null,
|
|
56
58
|
flags.headless ? "--headless" : null,
|
|
57
59
|
]);
|
|
58
|
-
return
|
|
60
|
+
return autoRemote;
|
|
59
61
|
}
|
|
60
62
|
return { kind: "managed-local", headless: resolveHeadless(flags) };
|
|
61
63
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
let cached;
|
|
2
|
+
/**
|
|
3
|
+
* Load the Browserbase capability. The full build ships `remote.js`; the
|
|
4
|
+
* local-only build omits it, so we fall back to `remote.disabled.js`. The full
|
|
5
|
+
* specifier is held in a variable so the local-only TypeScript program can
|
|
6
|
+
* exclude `remote.ts` without the compiler eagerly pulling it back in.
|
|
7
|
+
*/
|
|
8
|
+
export async function getRemote() {
|
|
9
|
+
if (cached)
|
|
10
|
+
return cached;
|
|
11
|
+
const fullModule = "./remote.js";
|
|
12
|
+
try {
|
|
13
|
+
cached = (await import(fullModule));
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
// The full build ships remote.js; the local-only build omits it. Only fall
|
|
17
|
+
// back to the disabled stub when the module is genuinely absent — rethrow
|
|
18
|
+
// any other error so a real failure inside remote.ts isn't masked as
|
|
19
|
+
// "remote disabled".
|
|
20
|
+
const code = error?.code;
|
|
21
|
+
if (code !== "ERR_MODULE_NOT_FOUND" && code !== "MODULE_NOT_FOUND") {
|
|
22
|
+
throw error;
|
|
23
|
+
}
|
|
24
|
+
cached = (await import("./remote.disabled.js"));
|
|
25
|
+
}
|
|
26
|
+
return cached;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stub Browserbase capability used by `build:local-only`. It contains no API
|
|
3
|
+
* key handling and never reaches the cloud. Any attempt to use a remote target
|
|
4
|
+
* fails loudly.
|
|
5
|
+
*/
|
|
6
|
+
const DISABLED_MESSAGE = "Remote (Browserbase) mode is disabled in this local-only build of browse. Rebuild without local-only to use cloud sessions.";
|
|
7
|
+
export function resolveExplicitRemoteTarget() {
|
|
8
|
+
throw new Error(DISABLED_MESSAGE);
|
|
9
|
+
}
|
|
10
|
+
export function autoSelectRemoteTarget() {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
export function remoteStagehandOptions() {
|
|
14
|
+
throw new Error(DISABLED_MESSAGE);
|
|
15
|
+
}
|
|
16
|
+
export function remoteDoctorCheck() {
|
|
17
|
+
return { ok: true, message: "remote disabled (local-only build)" };
|
|
18
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Real Browserbase capability. This is the ONLY module that reads
|
|
3
|
+
* `BROWSERBASE_API_KEY`; it is excluded from `build:local-only` so that
|
|
4
|
+
* local-only artifacts cannot reach Browserbase.
|
|
5
|
+
*/
|
|
6
|
+
export function resolveExplicitRemoteTarget() {
|
|
7
|
+
return { kind: "remote" };
|
|
8
|
+
}
|
|
9
|
+
export function autoSelectRemoteTarget() {
|
|
10
|
+
return process.env.BROWSERBASE_API_KEY ? { kind: "remote" } : null;
|
|
11
|
+
}
|
|
12
|
+
export function remoteStagehandOptions() {
|
|
13
|
+
const apiKey = process.env.BROWSERBASE_API_KEY;
|
|
14
|
+
if (!apiKey) {
|
|
15
|
+
throw new Error("Missing BROWSERBASE_API_KEY for remote mode. Pass --local to run a managed local browser (no key needed), or set BROWSERBASE_API_KEY for cloud sessions.");
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
apiKey,
|
|
19
|
+
browserbaseSessionCreateParams: {
|
|
20
|
+
userMetadata: { browse_cli: "true" },
|
|
21
|
+
},
|
|
22
|
+
disableAPI: true,
|
|
23
|
+
disablePino: true,
|
|
24
|
+
env: "BROWSERBASE",
|
|
25
|
+
verbose: 0,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export function remoteDoctorCheck(env) {
|
|
29
|
+
if (env.BROWSERBASE_API_KEY) {
|
|
30
|
+
return { ok: true, message: "BROWSERBASE_API_KEY is set" };
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
ok: false,
|
|
34
|
+
message: "BROWSERBASE_API_KEY is not set",
|
|
35
|
+
fix: "export BROWSERBASE_API_KEY=...",
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -3,6 +3,7 @@ import { emptyRefMaps, resolveSelector as resolveCachedSelector, } from "./comma
|
|
|
3
3
|
import { executeDriverCommand } from "./commands/registry.js";
|
|
4
4
|
import { discoverLocalCdp } from "./local-cdp-discovery.js";
|
|
5
5
|
import { NetworkCapture } from "./network-capture.js";
|
|
6
|
+
import { getRemote } from "./remote-binding.js";
|
|
6
7
|
const INIT_FAILURE_RETRY_MS = 5_000;
|
|
7
8
|
export class DriverSessionManager {
|
|
8
9
|
session;
|
|
@@ -182,7 +183,7 @@ export class DriverSessionManager {
|
|
|
182
183
|
}
|
|
183
184
|
async initialize() {
|
|
184
185
|
const resolvedTarget = await this.resolveTarget();
|
|
185
|
-
const options = this.stagehandOptions(resolvedTarget);
|
|
186
|
+
const options = await this.stagehandOptions(resolvedTarget);
|
|
186
187
|
const stagehand = new Stagehand(options);
|
|
187
188
|
try {
|
|
188
189
|
await stagehand.init();
|
|
@@ -203,21 +204,9 @@ export class DriverSessionManager {
|
|
|
203
204
|
}
|
|
204
205
|
return { kind: "cdp", endpoint: discovered.wsUrl };
|
|
205
206
|
}
|
|
206
|
-
stagehandOptions(target) {
|
|
207
|
+
async stagehandOptions(target) {
|
|
207
208
|
if (target.kind === "remote") {
|
|
208
|
-
|
|
209
|
-
throw new Error("Missing BROWSERBASE_API_KEY. Set it or pass --local for a managed local browser.");
|
|
210
|
-
}
|
|
211
|
-
return {
|
|
212
|
-
apiKey: process.env.BROWSERBASE_API_KEY,
|
|
213
|
-
browserbaseSessionCreateParams: {
|
|
214
|
-
userMetadata: { browse_cli: "true" },
|
|
215
|
-
},
|
|
216
|
-
disableAPI: true,
|
|
217
|
-
disablePino: true,
|
|
218
|
-
env: "BROWSERBASE",
|
|
219
|
-
verbose: 0,
|
|
220
|
-
};
|
|
209
|
+
return (await getRemote()).remoteStagehandOptions();
|
|
221
210
|
}
|
|
222
211
|
if (target.kind === "managed-local") {
|
|
223
212
|
return {
|
package/oclif.manifest.json
CHANGED
|
@@ -160,7 +160,6 @@
|
|
|
160
160
|
},
|
|
161
161
|
"description": "Click an element by snapshot ref, XPath, or selector. Use `browse mouse click` for raw coordinates.",
|
|
162
162
|
"examples": [
|
|
163
|
-
"browse snapshot --compact",
|
|
164
163
|
"browse click @0-12",
|
|
165
164
|
"browse click 'button[type=submit]'",
|
|
166
165
|
"browse click @0-12 --session research"
|
|
@@ -3300,7 +3299,6 @@
|
|
|
3300
3299
|
"description": "Enable network capture for the active browser session.",
|
|
3301
3300
|
"examples": [
|
|
3302
3301
|
"browse network on",
|
|
3303
|
-
"browse network path",
|
|
3304
3302
|
"browse network on --session research"
|
|
3305
3303
|
],
|
|
3306
3304
|
"flags": {
|
|
@@ -3647,194 +3645,6 @@
|
|
|
3647
3645
|
"list.js"
|
|
3648
3646
|
]
|
|
3649
3647
|
},
|
|
3650
|
-
"templates:clone": {
|
|
3651
|
-
"aliases": [],
|
|
3652
|
-
"args": {
|
|
3653
|
-
"slug": {
|
|
3654
|
-
"description": "Template slug.",
|
|
3655
|
-
"name": "slug",
|
|
3656
|
-
"required": true
|
|
3657
|
-
},
|
|
3658
|
-
"path": {
|
|
3659
|
-
"description": "Destination directory. Defaults to the template slug.",
|
|
3660
|
-
"name": "path",
|
|
3661
|
-
"required": false
|
|
3662
|
-
}
|
|
3663
|
-
},
|
|
3664
|
-
"description": "Scaffold a ready-to-run project from a Browserbase template.",
|
|
3665
|
-
"examples": [
|
|
3666
|
-
"browse templates clone google-trends-keywords",
|
|
3667
|
-
"browse templates clone amazon-product-scraping --language python ./my-scraper",
|
|
3668
|
-
"browse templates clone dynamic-form-filling ./form-bot --language typescript"
|
|
3669
|
-
],
|
|
3670
|
-
"flags": {
|
|
3671
|
-
"json": {
|
|
3672
|
-
"description": "Print clone result as JSON.",
|
|
3673
|
-
"name": "json",
|
|
3674
|
-
"allowNo": false,
|
|
3675
|
-
"type": "boolean"
|
|
3676
|
-
},
|
|
3677
|
-
"language": {
|
|
3678
|
-
"description": "Template language. Defaults to TypeScript when available, then Python.",
|
|
3679
|
-
"name": "language",
|
|
3680
|
-
"hasDynamicHelp": false,
|
|
3681
|
-
"helpValue": "<language>",
|
|
3682
|
-
"multiple": false,
|
|
3683
|
-
"options": [
|
|
3684
|
-
"typescript",
|
|
3685
|
-
"python"
|
|
3686
|
-
],
|
|
3687
|
-
"type": "option"
|
|
3688
|
-
}
|
|
3689
|
-
},
|
|
3690
|
-
"hasDynamicHelp": false,
|
|
3691
|
-
"hiddenAliases": [],
|
|
3692
|
-
"id": "templates:clone",
|
|
3693
|
-
"pluginAlias": "browse",
|
|
3694
|
-
"pluginName": "browse",
|
|
3695
|
-
"pluginType": "core",
|
|
3696
|
-
"strict": true,
|
|
3697
|
-
"isESM": true,
|
|
3698
|
-
"relativePath": [
|
|
3699
|
-
"dist",
|
|
3700
|
-
"commands",
|
|
3701
|
-
"templates",
|
|
3702
|
-
"clone.js"
|
|
3703
|
-
]
|
|
3704
|
-
},
|
|
3705
|
-
"templates:find": {
|
|
3706
|
-
"aliases": [],
|
|
3707
|
-
"args": {
|
|
3708
|
-
"query": {
|
|
3709
|
-
"description": "Template slug or search query.",
|
|
3710
|
-
"name": "query",
|
|
3711
|
-
"required": true
|
|
3712
|
-
}
|
|
3713
|
-
},
|
|
3714
|
-
"description": "Find Browserbase templates by slug, title, category, or tag.",
|
|
3715
|
-
"examples": [
|
|
3716
|
-
"browse templates find google-trends-keywords",
|
|
3717
|
-
"browse templates find amazon",
|
|
3718
|
-
"browse templates find Python --wide",
|
|
3719
|
-
"browse templates find Python --json"
|
|
3720
|
-
],
|
|
3721
|
-
"flags": {
|
|
3722
|
-
"format": {
|
|
3723
|
-
"description": "Output format. Defaults to table in a terminal and JSON when piped.",
|
|
3724
|
-
"name": "format",
|
|
3725
|
-
"hasDynamicHelp": false,
|
|
3726
|
-
"helpValue": "<format>",
|
|
3727
|
-
"multiple": false,
|
|
3728
|
-
"options": [
|
|
3729
|
-
"table",
|
|
3730
|
-
"json"
|
|
3731
|
-
],
|
|
3732
|
-
"type": "option"
|
|
3733
|
-
},
|
|
3734
|
-
"json": {
|
|
3735
|
-
"description": "Print raw JSON output.",
|
|
3736
|
-
"name": "json",
|
|
3737
|
-
"allowNo": false,
|
|
3738
|
-
"type": "boolean"
|
|
3739
|
-
},
|
|
3740
|
-
"wide": {
|
|
3741
|
-
"description": "Show full table values without truncation.",
|
|
3742
|
-
"name": "wide",
|
|
3743
|
-
"allowNo": false,
|
|
3744
|
-
"type": "boolean"
|
|
3745
|
-
}
|
|
3746
|
-
},
|
|
3747
|
-
"hasDynamicHelp": false,
|
|
3748
|
-
"hiddenAliases": [],
|
|
3749
|
-
"id": "templates:find",
|
|
3750
|
-
"pluginAlias": "browse",
|
|
3751
|
-
"pluginName": "browse",
|
|
3752
|
-
"pluginType": "core",
|
|
3753
|
-
"strict": true,
|
|
3754
|
-
"isESM": true,
|
|
3755
|
-
"relativePath": [
|
|
3756
|
-
"dist",
|
|
3757
|
-
"commands",
|
|
3758
|
-
"templates",
|
|
3759
|
-
"find.js"
|
|
3760
|
-
]
|
|
3761
|
-
},
|
|
3762
|
-
"templates:list": {
|
|
3763
|
-
"aliases": [],
|
|
3764
|
-
"args": {},
|
|
3765
|
-
"description": "List Browserbase templates.",
|
|
3766
|
-
"examples": [
|
|
3767
|
-
"browse templates list",
|
|
3768
|
-
"browse templates list --category \"Web Automation\"",
|
|
3769
|
-
"browse templates list --tag Python --source Browserbase",
|
|
3770
|
-
"browse templates list --wide",
|
|
3771
|
-
"browse templates list --json"
|
|
3772
|
-
],
|
|
3773
|
-
"flags": {
|
|
3774
|
-
"format": {
|
|
3775
|
-
"description": "Output format. Defaults to table in a terminal and JSON when piped.",
|
|
3776
|
-
"name": "format",
|
|
3777
|
-
"hasDynamicHelp": false,
|
|
3778
|
-
"helpValue": "<format>",
|
|
3779
|
-
"multiple": false,
|
|
3780
|
-
"options": [
|
|
3781
|
-
"table",
|
|
3782
|
-
"json"
|
|
3783
|
-
],
|
|
3784
|
-
"type": "option"
|
|
3785
|
-
},
|
|
3786
|
-
"json": {
|
|
3787
|
-
"description": "Print raw JSON output.",
|
|
3788
|
-
"name": "json",
|
|
3789
|
-
"allowNo": false,
|
|
3790
|
-
"type": "boolean"
|
|
3791
|
-
},
|
|
3792
|
-
"wide": {
|
|
3793
|
-
"description": "Show full table values without truncation.",
|
|
3794
|
-
"name": "wide",
|
|
3795
|
-
"allowNo": false,
|
|
3796
|
-
"type": "boolean"
|
|
3797
|
-
},
|
|
3798
|
-
"category": {
|
|
3799
|
-
"description": "Filter templates by category.",
|
|
3800
|
-
"name": "category",
|
|
3801
|
-
"hasDynamicHelp": false,
|
|
3802
|
-
"helpValue": "<category>",
|
|
3803
|
-
"multiple": false,
|
|
3804
|
-
"type": "option"
|
|
3805
|
-
},
|
|
3806
|
-
"source": {
|
|
3807
|
-
"description": "Filter templates by source.",
|
|
3808
|
-
"name": "source",
|
|
3809
|
-
"hasDynamicHelp": false,
|
|
3810
|
-
"helpValue": "<source>",
|
|
3811
|
-
"multiple": false,
|
|
3812
|
-
"type": "option"
|
|
3813
|
-
},
|
|
3814
|
-
"tag": {
|
|
3815
|
-
"description": "Filter templates by tag.",
|
|
3816
|
-
"name": "tag",
|
|
3817
|
-
"hasDynamicHelp": false,
|
|
3818
|
-
"helpValue": "<tag>",
|
|
3819
|
-
"multiple": false,
|
|
3820
|
-
"type": "option"
|
|
3821
|
-
}
|
|
3822
|
-
},
|
|
3823
|
-
"hasDynamicHelp": false,
|
|
3824
|
-
"hiddenAliases": [],
|
|
3825
|
-
"id": "templates:list",
|
|
3826
|
-
"pluginAlias": "browse",
|
|
3827
|
-
"pluginName": "browse",
|
|
3828
|
-
"pluginType": "core",
|
|
3829
|
-
"strict": true,
|
|
3830
|
-
"isESM": true,
|
|
3831
|
-
"relativePath": [
|
|
3832
|
-
"dist",
|
|
3833
|
-
"commands",
|
|
3834
|
-
"templates",
|
|
3835
|
-
"list.js"
|
|
3836
|
-
]
|
|
3837
|
-
},
|
|
3838
3648
|
"tab:close": {
|
|
3839
3649
|
"aliases": [],
|
|
3840
3650
|
"args": {
|
|
@@ -4178,6 +3988,194 @@
|
|
|
4178
3988
|
"switch.js"
|
|
4179
3989
|
]
|
|
4180
3990
|
},
|
|
3991
|
+
"templates:clone": {
|
|
3992
|
+
"aliases": [],
|
|
3993
|
+
"args": {
|
|
3994
|
+
"slug": {
|
|
3995
|
+
"description": "Template slug.",
|
|
3996
|
+
"name": "slug",
|
|
3997
|
+
"required": true
|
|
3998
|
+
},
|
|
3999
|
+
"path": {
|
|
4000
|
+
"description": "Destination directory. Defaults to the template slug.",
|
|
4001
|
+
"name": "path",
|
|
4002
|
+
"required": false
|
|
4003
|
+
}
|
|
4004
|
+
},
|
|
4005
|
+
"description": "Scaffold a ready-to-run project from a Browserbase template.",
|
|
4006
|
+
"examples": [
|
|
4007
|
+
"browse templates clone google-trends-keywords",
|
|
4008
|
+
"browse templates clone amazon-product-scraping --language python ./my-scraper",
|
|
4009
|
+
"browse templates clone dynamic-form-filling ./form-bot --language typescript"
|
|
4010
|
+
],
|
|
4011
|
+
"flags": {
|
|
4012
|
+
"json": {
|
|
4013
|
+
"description": "Print clone result as JSON.",
|
|
4014
|
+
"name": "json",
|
|
4015
|
+
"allowNo": false,
|
|
4016
|
+
"type": "boolean"
|
|
4017
|
+
},
|
|
4018
|
+
"language": {
|
|
4019
|
+
"description": "Template language. Defaults to TypeScript when available, then Python.",
|
|
4020
|
+
"name": "language",
|
|
4021
|
+
"hasDynamicHelp": false,
|
|
4022
|
+
"helpValue": "<language>",
|
|
4023
|
+
"multiple": false,
|
|
4024
|
+
"options": [
|
|
4025
|
+
"typescript",
|
|
4026
|
+
"python"
|
|
4027
|
+
],
|
|
4028
|
+
"type": "option"
|
|
4029
|
+
}
|
|
4030
|
+
},
|
|
4031
|
+
"hasDynamicHelp": false,
|
|
4032
|
+
"hiddenAliases": [],
|
|
4033
|
+
"id": "templates:clone",
|
|
4034
|
+
"pluginAlias": "browse",
|
|
4035
|
+
"pluginName": "browse",
|
|
4036
|
+
"pluginType": "core",
|
|
4037
|
+
"strict": true,
|
|
4038
|
+
"isESM": true,
|
|
4039
|
+
"relativePath": [
|
|
4040
|
+
"dist",
|
|
4041
|
+
"commands",
|
|
4042
|
+
"templates",
|
|
4043
|
+
"clone.js"
|
|
4044
|
+
]
|
|
4045
|
+
},
|
|
4046
|
+
"templates:find": {
|
|
4047
|
+
"aliases": [],
|
|
4048
|
+
"args": {
|
|
4049
|
+
"query": {
|
|
4050
|
+
"description": "Template slug or search query.",
|
|
4051
|
+
"name": "query",
|
|
4052
|
+
"required": true
|
|
4053
|
+
}
|
|
4054
|
+
},
|
|
4055
|
+
"description": "Find Browserbase templates by slug, title, category, or tag.",
|
|
4056
|
+
"examples": [
|
|
4057
|
+
"browse templates find google-trends-keywords",
|
|
4058
|
+
"browse templates find amazon",
|
|
4059
|
+
"browse templates find Python --wide",
|
|
4060
|
+
"browse templates find Python --json"
|
|
4061
|
+
],
|
|
4062
|
+
"flags": {
|
|
4063
|
+
"format": {
|
|
4064
|
+
"description": "Output format. Defaults to table in a terminal and JSON when piped.",
|
|
4065
|
+
"name": "format",
|
|
4066
|
+
"hasDynamicHelp": false,
|
|
4067
|
+
"helpValue": "<format>",
|
|
4068
|
+
"multiple": false,
|
|
4069
|
+
"options": [
|
|
4070
|
+
"table",
|
|
4071
|
+
"json"
|
|
4072
|
+
],
|
|
4073
|
+
"type": "option"
|
|
4074
|
+
},
|
|
4075
|
+
"json": {
|
|
4076
|
+
"description": "Print raw JSON output.",
|
|
4077
|
+
"name": "json",
|
|
4078
|
+
"allowNo": false,
|
|
4079
|
+
"type": "boolean"
|
|
4080
|
+
},
|
|
4081
|
+
"wide": {
|
|
4082
|
+
"description": "Show full table values without truncation.",
|
|
4083
|
+
"name": "wide",
|
|
4084
|
+
"allowNo": false,
|
|
4085
|
+
"type": "boolean"
|
|
4086
|
+
}
|
|
4087
|
+
},
|
|
4088
|
+
"hasDynamicHelp": false,
|
|
4089
|
+
"hiddenAliases": [],
|
|
4090
|
+
"id": "templates:find",
|
|
4091
|
+
"pluginAlias": "browse",
|
|
4092
|
+
"pluginName": "browse",
|
|
4093
|
+
"pluginType": "core",
|
|
4094
|
+
"strict": true,
|
|
4095
|
+
"isESM": true,
|
|
4096
|
+
"relativePath": [
|
|
4097
|
+
"dist",
|
|
4098
|
+
"commands",
|
|
4099
|
+
"templates",
|
|
4100
|
+
"find.js"
|
|
4101
|
+
]
|
|
4102
|
+
},
|
|
4103
|
+
"templates:list": {
|
|
4104
|
+
"aliases": [],
|
|
4105
|
+
"args": {},
|
|
4106
|
+
"description": "List Browserbase templates.",
|
|
4107
|
+
"examples": [
|
|
4108
|
+
"browse templates list",
|
|
4109
|
+
"browse templates list --category \"Web Automation\"",
|
|
4110
|
+
"browse templates list --tag Python --source Browserbase",
|
|
4111
|
+
"browse templates list --wide",
|
|
4112
|
+
"browse templates list --json"
|
|
4113
|
+
],
|
|
4114
|
+
"flags": {
|
|
4115
|
+
"format": {
|
|
4116
|
+
"description": "Output format. Defaults to table in a terminal and JSON when piped.",
|
|
4117
|
+
"name": "format",
|
|
4118
|
+
"hasDynamicHelp": false,
|
|
4119
|
+
"helpValue": "<format>",
|
|
4120
|
+
"multiple": false,
|
|
4121
|
+
"options": [
|
|
4122
|
+
"table",
|
|
4123
|
+
"json"
|
|
4124
|
+
],
|
|
4125
|
+
"type": "option"
|
|
4126
|
+
},
|
|
4127
|
+
"json": {
|
|
4128
|
+
"description": "Print raw JSON output.",
|
|
4129
|
+
"name": "json",
|
|
4130
|
+
"allowNo": false,
|
|
4131
|
+
"type": "boolean"
|
|
4132
|
+
},
|
|
4133
|
+
"wide": {
|
|
4134
|
+
"description": "Show full table values without truncation.",
|
|
4135
|
+
"name": "wide",
|
|
4136
|
+
"allowNo": false,
|
|
4137
|
+
"type": "boolean"
|
|
4138
|
+
},
|
|
4139
|
+
"category": {
|
|
4140
|
+
"description": "Filter templates by category.",
|
|
4141
|
+
"name": "category",
|
|
4142
|
+
"hasDynamicHelp": false,
|
|
4143
|
+
"helpValue": "<category>",
|
|
4144
|
+
"multiple": false,
|
|
4145
|
+
"type": "option"
|
|
4146
|
+
},
|
|
4147
|
+
"source": {
|
|
4148
|
+
"description": "Filter templates by source.",
|
|
4149
|
+
"name": "source",
|
|
4150
|
+
"hasDynamicHelp": false,
|
|
4151
|
+
"helpValue": "<source>",
|
|
4152
|
+
"multiple": false,
|
|
4153
|
+
"type": "option"
|
|
4154
|
+
},
|
|
4155
|
+
"tag": {
|
|
4156
|
+
"description": "Filter templates by tag.",
|
|
4157
|
+
"name": "tag",
|
|
4158
|
+
"hasDynamicHelp": false,
|
|
4159
|
+
"helpValue": "<tag>",
|
|
4160
|
+
"multiple": false,
|
|
4161
|
+
"type": "option"
|
|
4162
|
+
}
|
|
4163
|
+
},
|
|
4164
|
+
"hasDynamicHelp": false,
|
|
4165
|
+
"hiddenAliases": [],
|
|
4166
|
+
"id": "templates:list",
|
|
4167
|
+
"pluginAlias": "browse",
|
|
4168
|
+
"pluginName": "browse",
|
|
4169
|
+
"pluginType": "core",
|
|
4170
|
+
"strict": true,
|
|
4171
|
+
"isESM": true,
|
|
4172
|
+
"relativePath": [
|
|
4173
|
+
"dist",
|
|
4174
|
+
"commands",
|
|
4175
|
+
"templates",
|
|
4176
|
+
"list.js"
|
|
4177
|
+
]
|
|
4178
|
+
},
|
|
4181
4179
|
"cloud:contexts:create": {
|
|
4182
4180
|
"aliases": [],
|
|
4183
4181
|
"args": {},
|
|
@@ -5268,5 +5266,5 @@
|
|
|
5268
5266
|
]
|
|
5269
5267
|
}
|
|
5270
5268
|
},
|
|
5271
|
-
"version": "0.8.
|
|
5269
|
+
"version": "0.8.3"
|
|
5272
5270
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "browse",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3",
|
|
4
4
|
"description": "Unified Browserbase CLI for browser automation and cloud APIs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"author": "Browserbase <support@browserbase.com>",
|
|
7
9
|
"bin": {
|
|
8
10
|
"browse": "bin/run.js"
|
|
9
11
|
},
|
|
@@ -12,7 +14,8 @@
|
|
|
12
14
|
"dist",
|
|
13
15
|
"oclif.manifest.json",
|
|
14
16
|
"skills",
|
|
15
|
-
"README.md"
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE"
|
|
16
19
|
],
|
|
17
20
|
"publishConfig": {
|
|
18
21
|
"access": "public"
|
|
@@ -71,18 +74,18 @@
|
|
|
71
74
|
},
|
|
72
75
|
"repository": {
|
|
73
76
|
"type": "git",
|
|
74
|
-
"url": "git+https://github.com/browserbase/
|
|
77
|
+
"url": "git+https://github.com/browserbase/stagehand.git",
|
|
78
|
+
"directory": "packages/cli"
|
|
75
79
|
},
|
|
76
80
|
"bugs": {
|
|
77
|
-
"url": "https://github.com/browserbase/
|
|
81
|
+
"url": "https://github.com/browserbase/stagehand/issues"
|
|
78
82
|
},
|
|
79
|
-
"homepage": "https://github.com/browserbase/cli#readme",
|
|
83
|
+
"homepage": "https://github.com/browserbase/stagehand/tree/main/packages/cli#readme",
|
|
80
84
|
"engines": {
|
|
81
85
|
"node": "^20.19.0 || >=22.12.0"
|
|
82
86
|
},
|
|
83
87
|
"dependencies": {
|
|
84
88
|
"@browserbasehq/sdk": "^2.12.0",
|
|
85
|
-
"@browserbasehq/stagehand": "3.5.0-alpha-aff5528c8de93c14b695c73b2919d8c91950ef8a",
|
|
86
89
|
"@oclif/core": "^4.11.0",
|
|
87
90
|
"@vercel/detect-agent": "^1.2.3",
|
|
88
91
|
"archiver": "^7.0.1",
|
|
@@ -93,42 +96,36 @@
|
|
|
93
96
|
"semver": "^7.7.4",
|
|
94
97
|
"tsx": "^4.20.6",
|
|
95
98
|
"ws": "^8.18.3",
|
|
96
|
-
"zod": "^4.2.1"
|
|
99
|
+
"zod": "^4.2.1",
|
|
100
|
+
"@browserbasehq/stagehand": "3.5.0"
|
|
97
101
|
},
|
|
98
102
|
"devDependencies": {
|
|
99
|
-
"@changesets/cli": "^2.29.8",
|
|
100
103
|
"@eslint/js": "^10.0.1",
|
|
101
104
|
"@types/archiver": "^6.0.3",
|
|
102
|
-
"@types/node": "^
|
|
105
|
+
"@types/node": "^20.11.30",
|
|
103
106
|
"@types/semver": "^7.7.1",
|
|
104
107
|
"@types/ws": "^8.18.1",
|
|
105
108
|
"eslint": "^10.4.0",
|
|
106
109
|
"eslint-plugin-security": "^4.0.0",
|
|
107
110
|
"globals": "^17.6.0",
|
|
108
|
-
"husky": "^9.1.7",
|
|
109
|
-
"lint-staged": "^17.0.5",
|
|
110
111
|
"oclif": "^4.23.1",
|
|
111
|
-
"prettier": "
|
|
112
|
+
"prettier": "3.5.3",
|
|
112
113
|
"typescript": "^5.8.3",
|
|
113
114
|
"typescript-eslint": "^8.59.3",
|
|
114
|
-
"vitest": "^
|
|
115
|
-
},
|
|
116
|
-
"lint-staged": {
|
|
117
|
-
"*": "prettier --write --ignore-unknown"
|
|
115
|
+
"vitest": "^4.1.6"
|
|
118
116
|
},
|
|
119
117
|
"scripts": {
|
|
120
118
|
"build": "node -e \"const fs = require('fs'); fs.rmSync('dist', { recursive: true, force: true }); fs.rmSync('oclif.manifest.json', { force: true })\" && tsc -p tsconfig.json && pnpm manifest",
|
|
119
|
+
"build:local-only": "node -e \"const fs = require('fs'); fs.rmSync('dist', { recursive: true, force: true }); fs.rmSync('oclif.manifest.json', { force: true })\" && tsc -p tsconfig.local-only.json && pnpm manifest",
|
|
121
120
|
"check": "tsc --noEmit -p tsconfig.json",
|
|
122
121
|
"cli": "pnpm build && node bin/run.js",
|
|
123
|
-
"changeset": "changeset",
|
|
124
122
|
"eslint": "eslint .",
|
|
125
123
|
"eslint:fix": "eslint . --fix",
|
|
126
124
|
"format": "prettier --write .",
|
|
127
125
|
"format:check": "prettier . --check --cache",
|
|
128
126
|
"lint": "pnpm format:check && pnpm eslint && pnpm check",
|
|
129
127
|
"manifest": "oclif manifest .",
|
|
130
|
-
"release": "pnpm build && changeset publish",
|
|
131
128
|
"test": "pnpm build && vitest run",
|
|
132
|
-
"
|
|
129
|
+
"test:cli": "vitest run"
|
|
133
130
|
}
|
|
134
131
|
}
|