OpenCode / Inspector

Visual feedback, structured for agents

Point. Describe. Ship.

Capture exact elements, responsive context, and implementation intent without translating screenshots into vague prompts.

Command builder
Mode
Context

On this page

Install · First run · Options · Security

Install once. Use everywhere.

Choose the adapter that matches your OpenCode version.

opencode2 plugin add @frontendxlab/opencode-visual-inspector

V2 registers /inspect, the legacy /inpect alias, and visual.inspect. Local TUI, desktop, and web clients share the server plugin.

Open a running interface.

/inspect http://localhost:5173

Run /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
Syntax is validated in both adapters. A model with current context shows a yellow warning. Model switching and fork execution still depend on the active host session API.

From element to implementation.

  1. Toggle Inspect on and select an element.
  2. Describe the requested visual change.
  3. Add it to a responsive batch or send it live.
  4. 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.

Stop tracking stops inspector tracking only. It does not cancel the agent.

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=1

Private 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.