MCPcopy Create free account
hub / github.com/different-ai/opencode-browser / main

Function main

bin/cli.js:329–375  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

327}
328
329async function main() {
330 const command = process.argv[2];
331
332 console.log(`
333${color("cyan", color("bright", "OpenCode Browser v4"))}
334${color("cyan", "Browser automation plugin (native messaging + per-tab ownership)")}
335`);
336
337 if (command === "install") {
338 await install();
339 } else if (command === "update") {
340 await update();
341 } else if (command === "uninstall") {
342 await uninstall();
343 } else if (command === "status") {
344 await status();
345 } else if (command === "agent-install") {
346 await agentInstall();
347 } else if (command === "agent-gateway") {
348 await agentGateway();
349 } else {
350 log(`
351${color("bright", "Usage:")}
352 npx @different-ai/opencode-browser install
353 npx @different-ai/opencode-browser update
354 npx @different-ai/opencode-browser status
355 npx @different-ai/opencode-browser uninstall
356 npx @different-ai/opencode-browser agent-install
357 npx @different-ai/opencode-browser agent-gateway
358
359${color("bright", "Options:")}
360 --extension-id <id> (or OPENCODE_BROWSER_EXTENSION_ID)
361
362${color("bright", "Quick Start:")}
363 1. Run: npx @different-ai/opencode-browser install
364 2. Restart OpenCode
365 3. Use: browser_navigate / browser_click / browser_snapshot
366
367${color("bright", "Agent Mode:")}
368 1. Run: npx @different-ai/opencode-browser agent-install
369 2. Set OPENCODE_BROWSER_BACKEND=agent
370 3. Optionally run: npx @different-ai/opencode-browser agent-gateway
371`);
372 }
373
374 rl.close();
375}
376
377async function install() {
378 header("Step 1: Check Platform");

Callers 1

cli.jsFile · 0.85

Calls 8

colorFunction · 0.85
installFunction · 0.85
updateFunction · 0.85
uninstallFunction · 0.85
agentInstallFunction · 0.85
agentGatewayFunction · 0.85
logFunction · 0.85
statusFunction · 0.70

Tested by

no test coverage detected