opencode-browser  by different-ai

Browser automation for AI agents

Created 3 months ago
330 stars

Top 83.0% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

This project provides an OpenCode plugin for automating control of a real Chromium browser instance, including Chrome, Brave, Arc, and Edge. It targets developers and AI agents needing to interact with existing browser profiles, leveraging logins, cookies, and bookmarks without the complexities of the DevTools Protocol or security prompts. The primary benefit is reliable, predictable multi-session browser automation integrated directly into the OpenCode workflow.

How It Works

The architecture relies on Chrome Native Messaging, establishing communication between the OpenCode plugin and a local host process. A central broker manages multiple OpenCode sessions, forwarding requests to the Chrome extension and strictly enforcing per-tab ownership to prevent conflicts. This design avoids common issues like WebSocket port conflicts and eliminates the need for DevTools Protocol, enhancing stability and simplifying setup.

Quick Start & Requirements

Installation is straightforward via bunx @different-ai/opencode-browser@latest install. The plugin supports macOS, Linux, and Windows, integrating with Chrome, Edge, Brave, and Chromium browsers. Post-installation, users must configure their OpenCode setup by adding "@different-ai/opencode-browser" to their opencode.json or opencode.jsonc file. The installer guides users through loading the extension and setting up the native messaging host.

Highlighted Details

  • A CLI tool runner (npx @different-ai/opencode-browser tool ...) allows direct execution of browser tools for local debugging.
  • The project includes a build process (bun run build:cws) to create packages suitable for the Chrome Web Store.
  • An experimental "Agent Browser" mode is available, utilizing Playwright for headless browser automation, distinct from the profile-reusing extension mode.
  • Tab ownership is managed per session, with claims automatically expiring after a configurable period of inactivity.

Maintenance & Community

No specific details regarding maintainers, community channels (e.g., Discord, Slack), or project roadmaps were found in the provided README.

Licensing & Compatibility

The README does not explicitly state the project's license. This omission requires further investigation for commercial use or integration into closed-source projects.

Limitations & Caveats

The "Agent Browser" backend is currently in alpha status. The browser_set_file_input tool has limitations with the extension backend for large file uploads. Users encountering "native host not available" errors are advised to re-run the installer or specify a custom extension ID. Tab ownership errors typically indicate a tab is claimed by another session.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
5
Star History
99 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.