npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vite-plugin-opencode-assistant

v1.1.69

Published

Embed OpenCode Web UI in your Vite dev server for real-time code modification and preview

Readme

vite-plugin-opencode-assistant

在 Vite 开发环境中嵌入 OpenCode AI 助手,边聊天边改代码,HMR 实时预览。

快速开始

前置条件

安装 OpenCode CLI(AI 引擎,必须):

curl -fsSL https://opencode.ai/install | bash

1. 安装插件

npm install -D vite-plugin-opencode-assistant

2. 配置 Vite

// vite.config.ts
import { defineConfig } from "vite";
import opencodeAssistant from "vite-plugin-opencode-assistant";

export default defineConfig({
  plugins: [opencodeAssistant()],
});

3. 启动开发服务器

npm run dev

Vite 插件会自动启动 OpenCode Web 服务并创建当前项目的 AI 会话。

4. 安装浏览器扩展

  1. 下载扩展包
  2. 打开 Chrome,地址栏输入 chrome://extensions/
  3. 打开右上角**「开发者模式」**开关
  4. 解压下载的 .zip,点击**「加载已解压的扩展程序」**,选择解压后的文件夹
  5. 用 Chrome 打开 localhost 开发页面,点击工具栏中的 OpenCode 图标即可开始对话

Edge / Arc / Brave 操作步骤相同,入口分别是 edge://extensions/ / arc://extensions/ / brave://extensions/。

工作原理

┌────────────────┐      ┌────────────────┐      ┌─────────────┐
│  Vite 插件       │      │  浏览器扩展      │      │  OpenCode   │
│  启动 Web 服务   │◀────▶│  侧边栏面板      │◀────▶│  AI 引擎    │
│  代理跨域        │      │  页面上下文同步   │      │  会话管理    │
└────────────────┘      └────────────────┘      └─────────────┘
  • Vite 插件在项目启动时自动拉起 OpenCode Web 服务
  • 浏览器扩展检测到 localhost 页面后自动连接该服务
  • 实时同步页面 URL、标题等上下文给 AI
  • 多标签页自动切换对应项目的会话

文档

完整使用指南请访问 在线文档。

License

MIT