@opencode/browse 0.0.0 → 0.0.6-dev.17

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.mjs ADDED
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/main.ts
4
+ import path from "node:path";
5
+ var embeddedVersion = "0.0.6-dev.17";
6
+ var setupCommands = new Set(["install", "uninstall", "extension", "pair", "rollback", "set"]);
7
+ var command = process.argv[2];
8
+ var invokedAs = path.basename(process.argv[1] ?? "");
9
+ if (command === "--version" || command === "-v") {
10
+ const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-wrebjhy7.mjs")).opencodeBrowserVersion;
11
+ process.stdout.write(`${opencodeBrowserVersion}
12
+ `);
13
+ } else if (invokedAs === "opencode-browser-mcp") {
14
+ const { NodeRuntime } = await import("@effect/platform-node");
15
+ const { runMcpServer } = await import("./mcp-2smdsn8z.mjs");
16
+ runMcpServer.pipe(NodeRuntime.runMain);
17
+ } else if (command === "runtime-install" || command === "runtime-switch") {
18
+ const { runRuntimeInstall, runRuntimeSwitch } = await import("./runtime-update-0mddkfy5.mjs");
19
+ await (command === "runtime-install" ? runRuntimeInstall : runRuntimeSwitch)(process.argv.slice(3));
20
+ } else if (command === "update") {
21
+ const { runUpdateCommand } = await import("./update-cyy1grjj.mjs");
22
+ await runUpdateCommand(process.argv.slice(3));
23
+ } else if (command && setupCommands.has(command)) {
24
+ const { runSetup } = await import("./setup-f2qjnvre.mjs");
25
+ await runSetup(command, process.argv.slice(3));
26
+ } else {
27
+ if (!command || command === "--help" || command === "-h") {
28
+ process.stdout.write(`SETUP
29
+ install [--opencode <path>] Install Browse: choose agents for the browse MCP server, check which browsers
30
+ have the extension and pair it (when none does, open its Chrome Web Store
31
+ page, or from a checkout or a dev install show the folder to load unpacked,
32
+ and wait for it)
33
+ --no-open Print the steps without opening anything or copying the path
34
+ --no-wait Don't wait for the extension to be added or connect
35
+ --wait-seconds <seconds> How long to wait for a connection (default 180 in a terminal, 90 otherwise)
36
+ -a, --agent <names...> Configure named agents (repeatable); '*' or --all-agents selects every supported agent
37
+ -y, --yes Skip the picker; use the calling agent or detected agents
38
+ extension Show where to get the extension (the unpacked folder of a checkout or a dev
39
+ install, or the store page)
40
+ pair [--wait-seconds <seconds>] Start the relay, print a one-time code (valid 10 minutes) and wait for the
41
+ browser that redeems it (default 180 seconds)
42
+ --list Show paired browsers: id, name, profile, when paired and last seen
43
+ --revoke <browser> Unpair a browser (its id, name or profile) and disconnect it;
44
+ \`--revoke legacy\` retires the shared code of earlier versions
45
+ set hostname <address> Where the relay listens: 127.0.0.1 (this computer, the default) or 0.0.0.0
46
+ (browsers on other computers can connect too, after pairing)
47
+ update [--check] Update now. A git clone install pulls the newer commits (fast-forward only)
48
+ and runs setup again; an npm install installs the newest version on its
49
+ channel and switches to it; --check only says whether there's an update
50
+ rollback [--force] npm installs: go back to the version before the last update (and skip
51
+ the one rolled back from until a newer one is published)
52
+ uninstall [--yes] Remove everything install set up (--yes skips confirming that stored
53
+ secret profiles are deleted)
54
+
55
+ `);
56
+ }
57
+ if (command === "status" && !process.argv.includes("--json")) {
58
+ const { printSetupStatus } = await import("./setup-f2qjnvre.mjs");
59
+ printSetupStatus();
60
+ }
61
+ const { runCli } = await import("./cli-b4sbkefj.mjs");
62
+ runCli();
63
+ }