@different-ai/opencode-browser 1.0.2 → 1.0.4
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/bin/cli.js +20 -2
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -102,6 +102,9 @@ ${color("bright", "Usage:")}
|
|
|
102
102
|
npx @different-ai/opencode-browser start Run MCP server
|
|
103
103
|
npx @different-ai/opencode-browser uninstall Remove installation
|
|
104
104
|
|
|
105
|
+
${color("bright", "With bun:")}
|
|
106
|
+
bunx @different-ai/opencode-browser install
|
|
107
|
+
|
|
105
108
|
${color("bright", "For scheduled jobs:")}
|
|
106
109
|
Run 'daemon-install' to enable browser tools in background jobs.
|
|
107
110
|
`);
|
|
@@ -250,8 +253,20 @@ ${color("bright", JSON.stringify(mcpConfig, null, 2))}
|
|
|
250
253
|
}
|
|
251
254
|
}
|
|
252
255
|
} else {
|
|
253
|
-
|
|
254
|
-
|
|
256
|
+
const shouldCreate = await confirm(`No opencode.json found. Create one with browser config?`);
|
|
257
|
+
|
|
258
|
+
if (shouldCreate) {
|
|
259
|
+
try {
|
|
260
|
+
const config = { "$schema": "https://opencode.ai/config.json", mcp: mcpConfig };
|
|
261
|
+
writeFileSync(opencodeJsonPath, JSON.stringify(config, null, 2) + "\n");
|
|
262
|
+
success("Created opencode.json with browser MCP config");
|
|
263
|
+
shouldUpdateConfig = true;
|
|
264
|
+
} catch (e) {
|
|
265
|
+
error(`Failed to create opencode.json: ${e.message}`);
|
|
266
|
+
}
|
|
267
|
+
} else {
|
|
268
|
+
log(`Add the config above to your project's opencode.json manually.`);
|
|
269
|
+
}
|
|
255
270
|
}
|
|
256
271
|
|
|
257
272
|
header("Installation Complete!");
|
|
@@ -278,6 +293,9 @@ ${color("bright", "Available tools:")}
|
|
|
278
293
|
browser_execute - Run JavaScript
|
|
279
294
|
|
|
280
295
|
${color("bright", "Logs:")} ~/.opencode-browser/logs/
|
|
296
|
+
|
|
297
|
+
${color("bright", "Test it out:")}
|
|
298
|
+
Open OpenCode and try: ${color("cyan", '"Navigate to google.com and take a snapshot"')}
|
|
281
299
|
`);
|
|
282
300
|
}
|
|
283
301
|
|
package/package.json
CHANGED