Install
OpenCode V2
opencode2 plugin add 'git+https://github.com/frontendxlab/opencode-annotate.git#main'Use opencode2 plugin list to verify. The V2 plugin registers /inspect, /inpect, and visual.inspect. The TUI, local desktop app, and local web app share the server plugin.
OpenCode V1
npm install opencode-visual-inspector{ "plugin": ["opencode-visual-inspector/v1"] }V1 exposes visual_inspect. Copy commands/inspect.md into .opencode/commands/inspect.md when a V1 command is desired.
Open the inspector
/inspect http://localhost:5173Use /inspect for automatic target detection. The misspelled /inpect alias remains supported.
Validated options
/inspect http://localhost:5173 --model openai/gpt-5.6-luna --mode quick --context=fork--model provider/model-id--mode batch|quick, defaulting tobatch--context default|fork, defaulting todefault--context:forkis accepted as an alias
Duplicate options, malformed model identifiers, invalid values, and multiple URLs are rejected before the browser opens. A model with context=default displays a yellow warning that the current session model will change.
Browser workflow
- Toggle Inspect on.
- Hover and select an element, or focus it and press
Alt+Shift+I. - Describe the requested change.
- Choose Add to batch or Change live.
- Use viewport presets or custom dimensions.
- Send the batch to the main agent, a contextual subagent, or a fresh subagent.
Turn inspection off to use login forms, links, menus, and normal navigation without capture.
Viewports
- Desktop:
1440x900 - Laptop:
1280x800 - iPhone 16 Pro:
393x852 - Pixel 9:
412x915
Custom width is limited to 320 through 7680 and height to 320 through 4320. The inspector records the actual measured viewport.
Live changes
Change live sends one annotation and reports submitting, working, succeeded, failed, or cancelled states over authenticated SSE. Success reloads the page. Stop tracking stops inspector tracking only and does not remotely cancel the agent.
Security and login
Only loopback targets are allowed by default. The injected client runs inside the target page, so inspect only applications you control.
export OPENCODE_INSPECT_ALLOW_PRIVATE=1export OPENCODE_INSPECT_ALLOW_PUBLIC=1Private and public access are independent. The proxy is loopback-only, token-authenticated, host-validated, same-origin for redirects, and maintains a target-scoped cookie jar. External identity-provider redirects and page-origin authorization headers are not supported.
GUI behavior
The proxy and browser run on the OpenCode server host. Local V2 TUI, desktop, and web clients can use it through the same server. Remote GUI use is not supported.
Troubleshooting
- Reopen the TUI or restart OpenCode after installation.
- Use an explicit reachable HTTP or HTTPS URL.
- Set
OPENCODE_INSPECT_BROWSERwhen browser discovery fails. - Use Chrome or Chromium for viewport resizing.
- Check login flows when external redirects are involved.