A Vite plugin that embeds an OpenCode AI assistant panel directly into your dev server page, enabling real-time code modification through chat and instant preview via HMR. Current stable version is 1.0.53, released with a weekly cadence. Key differentiators: automatic session management, element selector for component source context, proxy service for cross-origin iframe support, and Chrome DevTools MCP warmup. Requires the OpenCode CLI to be installed separately and Vite >=4.0.0 as a peer dependency. Ships TypeScript types and supports configuration for theme, hotkeys, and language.
npm install vite-plugin-opencode-assistantVerified import paths — ran on the pinned version, not inferred.
Minimal Vite config with opencode-assistant plugin and customizable options for OpenCode Web UI integration.
Upgrade Vite to >=4.0.0.
Install OpenCode CLI: curl -fsSL https://opencode.ai/install | bash
Use default import: import opencodeAssistant from 'vite-plugin-opencode-assistant'
Configure distinct ports or ensure proxyPort is available.
Run `npm install -D vite-plugin-opencode-assistant` in your project root.
Use `import opencodeAssistant from 'vite-plugin-opencode-assistant'` instead of `import { opencodeAssistant } from ...`Switch to ESM (use import statement) or configure your project to support ESM.