Install once. Use everywhere.
Choose the adapter that matches your OpenCode version.
opencode2 plugin add @frontendxlab/opencode-visual-inspectorV2 registers /inspect, the legacy /inpect alias, and visual.inspect. Local TUI, desktop, and web clients share the server plugin.
npm install @frontendxlab/opencode-visual-inspectorConfigure @frontendxlab/opencode-visual-inspector/v1. V1 exposes visual_inspect and uses the included commands/inspect.md template for /inspect.
Open a running interface.
/inspect http://localhost:5173Run /inspect without a URL to detect a local development server. The plugin refuses unreachable URLs before opening the browser.
Control how changes land.
- Model
--model provider/model-id - Mode
--mode batch|quick - Context
--context default|fork - Alias
--context:fork
From element to implementation.
- Toggle Inspect on and select an element.
- Describe the requested visual change.
- Add it to a responsive batch or send it live.
- Route the work to the main agent or a subagent.
Turn Inspect off to use forms, login controls, links, and menus normally. Press Alt+Shift+I to annotate the focused element.
Review responsive intent.
- Desktop
1440x900 - Laptop
1280x800 - iPhone 16 Pro
393x852 - Pixel 9
412x915
Custom dimensions range from 320 through 7680 wide and 320 through 4320 high. Only actual measured dimensions are recorded.
Watch a change happen.
Change live sends one annotation and streams submitting, working, succeeded, failed, or cancelled states. Success reloads the page. Correlation is best effort because OpenCode session events do not expose a dedicated run identifier.
Configure trusted targets.
export OPENCODE_INSPECT_URL=http://localhost:5173
export OPENCODE_INSPECT_BROWSER=/usr/bin/google-chrome
export OPENCODE_INSPECT_ALLOW_PRIVATE=1
export OPENCODE_INSPECT_ALLOW_PUBLIC=1Private and public opt-ins are independent and process-wide.
A local, explicit trust boundary.
The proxy binds to loopback, validates Host, authenticates control requests, bounds payloads, strips sensitive headers, keeps a target-scoped cookie jar, and rejects cross-origin redirects.
The injected client runs inside the inspected page. Only inspect applications you control. External identity-provider redirects and browser-origin authorization headers are not supported.
The browser launches on the OpenCode server host. Remote GUI use is not supported.
Common fixes.
The inspector does not open
Reopen the TUI or restart OpenCode, verify the target is reachable, and set OPENCODE_INSPECT_BROWSER if browser discovery fails.
Viewport resizing is unavailable
Use Chrome or Chromium. The default-browser fallback cannot control viewport dimensions.
Login redirects fail
Same-origin cookie login works. Redirects to external identity providers are intentionally blocked.
Live tracking appears stuck
Check the OpenCode session directly. Live completion uses best-effort event correlation and times out after ten minutes.