@browserbasehq/cli 0.0.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +5 -3
- package/dist/commands/browse.js +1 -1
- package/dist/commands/contexts.js +1 -1
- package/dist/commands/dashboard.js +1 -1
- package/dist/commands/extensions.js +1 -1
- package/dist/commands/fetch.js +1 -1
- package/dist/commands/functions.js +1 -1
- package/dist/commands/projects.js +1 -1
- package/dist/commands/sessions.js +1 -1
- package/dist/commands/skills.js +60 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -7,6 +7,7 @@ import { attachFetchCommand } from "./commands/fetch.js";
|
|
|
7
7
|
import { attachFunctionsCommand } from "./commands/functions.js";
|
|
8
8
|
import { attachProjectsCommand } from "./commands/projects.js";
|
|
9
9
|
import { attachSessionsCommand } from "./commands/sessions.js";
|
|
10
|
+
import { attachSkillsCommand } from "./commands/skills.js";
|
|
10
11
|
export function buildProgram() {
|
|
11
12
|
const program = new Command();
|
|
12
13
|
program
|
|
@@ -18,14 +19,15 @@ export function buildProgram() {
|
|
|
18
19
|
.showSuggestionAfterError()
|
|
19
20
|
.enablePositionalOptions()
|
|
20
21
|
.exitOverride();
|
|
21
|
-
attachDashboardCommand(program);
|
|
22
22
|
attachBrowseCommand(program);
|
|
23
|
-
|
|
23
|
+
attachFetchCommand(program);
|
|
24
24
|
attachSessionsCommand(program);
|
|
25
|
+
attachDashboardCommand(program);
|
|
26
|
+
attachFunctionsCommand(program);
|
|
25
27
|
attachProjectsCommand(program);
|
|
26
28
|
attachContextsCommand(program);
|
|
27
29
|
attachExtensionsCommand(program);
|
|
28
|
-
|
|
30
|
+
attachSkillsCommand(program);
|
|
29
31
|
return program;
|
|
30
32
|
}
|
|
31
33
|
export async function run(argv) {
|
package/dist/commands/browse.js
CHANGED
|
@@ -3,7 +3,7 @@ import { findExecutable, spawnPassthrough } from "../lib/process.js";
|
|
|
3
3
|
export function attachBrowseCommand(program) {
|
|
4
4
|
program
|
|
5
5
|
.command("browse")
|
|
6
|
-
.description("
|
|
6
|
+
.description("Run and interact with a local or remote browser. Navigate to pages, send clicks, keystrokes, take screenshots, get a11y trees, and more.")
|
|
7
7
|
.argument("[args...]", "Arguments to forward to browse")
|
|
8
8
|
.allowUnknownOption(true)
|
|
9
9
|
.allowExcessArguments(true)
|
|
@@ -2,7 +2,7 @@ import { addCommonApiOptions, createBrowserbaseClient, mergeProjectIdIntoBody, o
|
|
|
2
2
|
export function attachContextsCommand(program) {
|
|
3
3
|
const contexts = program
|
|
4
4
|
.command("contexts")
|
|
5
|
-
.description("
|
|
5
|
+
.description("Contexts allow you to persist user data across multiple browser sessions, enabling smoother automation, seamless authentication, and faster end-to-end workflows.")
|
|
6
6
|
.helpCommand(false);
|
|
7
7
|
contexts.action(() => {
|
|
8
8
|
contexts.outputHelp();
|
|
@@ -2,7 +2,7 @@ import { openUrl } from "../lib/open.js";
|
|
|
2
2
|
export function attachDashboardCommand(program) {
|
|
3
3
|
program
|
|
4
4
|
.command("dashboard")
|
|
5
|
-
.description("Open Browserbase
|
|
5
|
+
.description("Open the Browserbase web dashboard for your project.")
|
|
6
6
|
.action(async () => {
|
|
7
7
|
const url = "http://browserbase.com/overview";
|
|
8
8
|
await openUrl(url);
|
|
@@ -2,7 +2,7 @@ import { addCommonApiOptions, createBrowserbaseClient, outputJson, requestBrowse
|
|
|
2
2
|
export function attachExtensionsCommand(program) {
|
|
3
3
|
const extensions = program
|
|
4
4
|
.command("extensions")
|
|
5
|
-
.description("
|
|
5
|
+
.description("Install Chrome extensions onto remote Browserbase sessions.")
|
|
6
6
|
.helpCommand(false);
|
|
7
7
|
extensions.action(() => {
|
|
8
8
|
extensions.outputHelp();
|
package/dist/commands/fetch.js
CHANGED
|
@@ -2,7 +2,7 @@ import { addCommonApiOptions, createBrowserbaseClient, outputJson, writeOutputFi
|
|
|
2
2
|
export function attachFetchCommand(program) {
|
|
3
3
|
addCommonApiOptions(program
|
|
4
4
|
.command("fetch <url>")
|
|
5
|
-
.description("
|
|
5
|
+
.description("Retrieve webpage content without a full browser session using the lightweight Browserbase Fetch API.")
|
|
6
6
|
.option("--allow-insecure-ssl", "Bypass TLS certificate verification.")
|
|
7
7
|
.option("--allow-redirects", "Follow HTTP redirects.")
|
|
8
8
|
.option("--proxies", "Enable Browserbase proxy support.")
|
|
@@ -8,7 +8,7 @@ const packageManagers = ["npm", "pnpm"];
|
|
|
8
8
|
export function attachFunctionsCommand(program) {
|
|
9
9
|
const functions = program
|
|
10
10
|
.command("functions")
|
|
11
|
-
.description("
|
|
11
|
+
.description("Write and deploy web automation scripts to Browserbase cloud Functions.")
|
|
12
12
|
.helpCommand(false);
|
|
13
13
|
functions.action(() => {
|
|
14
14
|
functions.outputHelp();
|
|
@@ -2,7 +2,7 @@ import { addCommonApiOptions, createBrowserbaseClient, outputJson } from "../lib
|
|
|
2
2
|
export function attachProjectsCommand(program) {
|
|
3
3
|
const projects = program
|
|
4
4
|
.command("projects")
|
|
5
|
-
.description("
|
|
5
|
+
.description("Manage your Browserbase projects.")
|
|
6
6
|
.helpCommand(false);
|
|
7
7
|
projects.action(() => {
|
|
8
8
|
projects.outputHelp();
|
|
@@ -3,7 +3,7 @@ import { addCommonApiOptions, createBrowserbaseClient, fail, mergeProjectIdIntoB
|
|
|
3
3
|
export function attachSessionsCommand(program) {
|
|
4
4
|
const sessions = program
|
|
5
5
|
.command("sessions")
|
|
6
|
-
.description("Create,
|
|
6
|
+
.description("Manage your remote browser sessions on Browserbase. Create, update, list, and read logs.")
|
|
7
7
|
.helpCommand(false);
|
|
8
8
|
sessions.action(() => {
|
|
9
9
|
sessions.outputHelp();
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as readline from "node:readline/promises";
|
|
2
|
+
import { fail } from "../lib/command.js";
|
|
3
|
+
import { findExecutable, spawnPassthrough } from "../lib/process.js";
|
|
4
|
+
async function installSkills() {
|
|
5
|
+
const npxPath = await findExecutable("npx");
|
|
6
|
+
if (!npxPath) {
|
|
7
|
+
fail([
|
|
8
|
+
"`npx` is not installed.",
|
|
9
|
+
"Install Node.js from https://nodejs.org to get npx,",
|
|
10
|
+
"then rerun `bb skills`.",
|
|
11
|
+
].join("\n"));
|
|
12
|
+
}
|
|
13
|
+
const exitCode = await spawnPassthrough(npxPath, [
|
|
14
|
+
"skills",
|
|
15
|
+
"add",
|
|
16
|
+
"browserbase/skills",
|
|
17
|
+
"--yes",
|
|
18
|
+
"--global",
|
|
19
|
+
]);
|
|
20
|
+
if (exitCode !== 0) {
|
|
21
|
+
process.exitCode = exitCode;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export function attachSkillsCommand(program) {
|
|
25
|
+
const skills = program
|
|
26
|
+
.command("skills")
|
|
27
|
+
.description("Install Browserbase agent skills for Claude Code.")
|
|
28
|
+
.action(async () => {
|
|
29
|
+
console.log([
|
|
30
|
+
"",
|
|
31
|
+
"Browserbase Skills for Claude Code",
|
|
32
|
+
"===================================",
|
|
33
|
+
"",
|
|
34
|
+
"Skills teach Claude Code how to use Browserbase features like",
|
|
35
|
+
"browsing, sessions, functions, and more.",
|
|
36
|
+
"",
|
|
37
|
+
" Source: https://github.com/browserbase/skills",
|
|
38
|
+
" Run: npx skills add browserbase/skills --yes --global",
|
|
39
|
+
"",
|
|
40
|
+
].join("\n"));
|
|
41
|
+
const rl = readline.createInterface({
|
|
42
|
+
input: process.stdin,
|
|
43
|
+
output: process.stdout,
|
|
44
|
+
});
|
|
45
|
+
try {
|
|
46
|
+
const answer = await rl.question("Install skills? [Y/n] ");
|
|
47
|
+
if (answer.trim().toLowerCase() === "n") {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
finally {
|
|
52
|
+
rl.close();
|
|
53
|
+
}
|
|
54
|
+
await installSkills();
|
|
55
|
+
});
|
|
56
|
+
skills
|
|
57
|
+
.command("install")
|
|
58
|
+
.description("Install Browserbase agent skills globally via npx (non-interactive).")
|
|
59
|
+
.action(installSkills);
|
|
60
|
+
}
|