@different-ai/opencode-browser 1.0.3 → 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.
Files changed (2) hide show
  1. package/bin/cli.js +17 -2
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -253,8 +253,20 @@ ${color("bright", JSON.stringify(mcpConfig, null, 2))}
253
253
  }
254
254
  }
255
255
  } else {
256
- log(`No opencode.json found in current directory.`);
257
- log(`Add the config above to your project's opencode.json manually.`);
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
+ }
258
270
  }
259
271
 
260
272
  header("Installation Complete!");
@@ -281,6 +293,9 @@ ${color("bright", "Available tools:")}
281
293
  browser_execute - Run JavaScript
282
294
 
283
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"')}
284
299
  `);
285
300
  }
286
301
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@different-ai/opencode-browser",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Browser automation for OpenCode via Chrome extension + Native Messaging. Inspired by Claude in Chrome.",
5
5
  "type": "module",
6
6
  "bin": {