OpenEyes is a browser extension that allows you to select any element on a web page and send it—along with its HTML source and a cropped screenshot—directly to a running OpenCode session.
It's designed to bridge the gap between your browser and your development environment, making it easy to share UI components, bug reports, or layout snippets with your AI-assisted coding tools.
- Visual Element Picker: Click any element on the page to select it.
- Contextual Capture: Automatically captures the element's HTML, CSS selector, and page metadata.
- Smart Screenshots: Captures a precise, cropped screenshot of the selected element.
- Direct Integration: Sends captured data to the OpenCode API (defaults to
http://127.0.0.1:4096). - Flexible Controls: Toggle whether to include the source code or the screenshot before sending.
Firefox Chrome - TBD
-
Clone the repository:
git clone https://github.com/your-username/openeyes.git cd openeyes -
Install dependencies: The project uses
web-extfor development andjustas a command runner.# Ensure you have 'just' installed (https://just.systems/man/en/installation.html) # Ensure you have 'bun' or 'npm' for running web-ext
-
Run in Development Mode: This will launch Firefox with the extension loaded.
just dev
- Open your browser's extension management page (
about:debuggingin Firefox,chrome://extensionsin Chrome). - Enable "Developer mode" if required.
- Click "Load Temporary Add-on" (Firefox) or "Load unpacked" (Chrome).
- Select the relevant extension directory in this project.
- Start OpenCode: Ensure your OpenCode server is running with a specified port (i.e.
opencode --port 4096). - Configure: Click the OpenEyes icon in your browser toolbar to set your Server URL and Auth Password (if applicable), and select a session (defaults to latest).
- Pick an Element:
- Click the Pick Element button in the popup.
- Hover over the page to highlight elements.
- Click to select an element.
- Send to OpenCode:
- Add an instruction (e.g., "Explain this component" or "Refactor this button").
- Toggle Source and/or Screenshot options.
- Press Send or
Ctrl+Enter.
The relevant information is then send to the opencode session you selected, and you can continue the conversation in the terminal as usual.
Settings are persisted in local storage:
- Server URL: The base URL of your OpenCode instance (default:
http://127.0.0.1:4096). - Session ID: Which session to send messages to. "Auto" picks the most recently updated session.
- Auth Password: Used for Basic Auth if your OpenCode instance requires it.
Tip
To automatically start the opencode cli with the port 4096, update your opencode configuration with the following information:
{
"$schema": "https://opencode.ai/config.json",
"server": { "port": 4096 }
}The project includes a justfile for common tasks:
just run: Launches the extension in Firefox for testing.just lint: Lints the extension code usingweb-ext.just build: Packages the extension intodist/openeyes.zip.just xpi: Builds a signed or unsigned.xpifile for distribution.just clean: Removes thedist/directory.
Currently I did not succeed in finding relevant entry points in either Claude Code or Codex (relevant issue). Alternatively we could enable sending one-off messages.
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) - see the LICENSE file for details.