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

opencode-meme

v0.0.2

Published

OpenCode plugin: floating meme overlay for task progress

Readme

opencode-meme


✨ 简介

opencode-meme 是 OpenCode CLI 的插件,通过在 OpenCode 执行过程中显示浮动动画覆盖层,让编码过程更有趣。

它以长驻进程的方式运行,监听 OpenCode 的各类事件(会话创建、工具调用、消息更新等),并通过 stdin/stdout JSON 与 meme-overlay 桌面应用通信,实时显示当前任务进度。

⚠️ 前置依赖: 本插件需要 meme-overlay 桌面应用配合使用。


✨ 功能特性

  • 长驻插件 — 作为 OpenCode 插件持续运行,响应实时事件
  • stdin/stdout IPC — 通过标准输入输出 JSON 与 overlay 通信
  • 自动管理 — 自动启动 overlay 进程,会话结束自动隐藏
  • 自定义动画 — 通过配置文件为不同事件分配不同动画和文本
  • 多阶段覆盖 — 支持会话、消息、工具等多种生命周期事件

支持的事件钩子

| 钩子事件 | 触发时机 | 默认文本 | |---------|---------|---------| | session.created | 会话创建时 | "Starting..." | | session.idle | 会话空闲/完成时 | "Done" | | session.error | 会话发生错误时 | "Error" | | message.part.updated | 消息更新时 | "Processing..." | | tool.execute.before | 工具执行前 | 工具名称 | | tool.execute.after | 工具执行后 | "Done" |


🚀 使用

1. 安装 meme-overlay

请参考 meme-overlay 仓库完成桌面应用的安装和导入动画。

2. 配置 OpenCode

编辑 OpenCode 配置文件 ~/.config/opencode/opencode.json,添加插件路径:

{
  "plugin": ["opencode-meme"]
}

3. 启动 OpenCode

配置完成后,正常启动 OpenCode CLI 即可。动画覆盖层会在任务执行时自动出现。


📦 安装

前置条件

| 依赖 | 版本 | 说明 | |------|------|------| | Node.js | 18+ | 运行插件 | | OpenCode | 1.3+ | AI 编码助手 | | meme-overlay | 0.1+ | 浮动动画桌面应用 |

方式一:从 npm 安装

npm install -g opencode-meme

方式二:从源码安装

git clone https://github.com/wuyouMaster/opencode-meme.git
cd opencode-meme
npm install
npm run build

⚙️ 配置

配置文件

配置文件位于 ~/.config/meme-overlay/config.json

{
  "opencode": {
    "hook_assignments": {
      "session.created": {
        "animation": "thinking",
        "custom_text": "Initializing..."
      },
      "session.idle": {
        "animation": "success",
        "custom_text": "Done"
      },
      "tool.execute.before": {
        "animation": "coding",
        "custom_text": null
      },
      "tool.execute.after": {
        "animation": "coding",
        "custom_text": null
      }
    }
  }
}

环境变量

| 变量 | 说明 | 示例 | |------|------|------| | OVERLAY_BIN | 自定义 overlay 可执行文件路径 | /usr/local/bin/meme-overlay |


🛠️ 开发

# 安装依赖
npm install

# 构建
npm run build

# 直接运行(调试)
node dist/opencode-meme.js

项目结构

opencode-plugin/
├── opencode-meme.ts    # 插件入口
├── package.json
└── tsconfig.json

工作原理

OpenCode CLI
      │
      │  Plugin Hook (长驻进程)
      │  stdin/stdout JSON
      ▼
  opencode-meme.ts
      │
      │  spawn 子进程, stdin pipe
      ▼
  meme-overlay 可执行文件
      │
      ▼
  透明浮动动画窗口

opencode-meme 作为 OpenCode 的长驻插件运行,通过 @opencode-ai/plugin 接口接收事件,然后以 JSON 格式向 overlay 子进程的 stdin 发送命令。


🔧 故障排除

| 问题 | 排查步骤 | |------|---------| | overlay 未显示 | 确认 ~/.config/meme-overlay/bin/meme-overlay 存在且可执行 | | 插件未加载 | 检查 opencode.json 中 plugin 路径是否为绝对路径 | | 动画不显示 | 检查 ~/.config/meme-overlay/animations/ 中是否有动画文件 | | 依赖缺失 | 运行 npm install 安装 @opencode-ai/plugin |


📄 许可证

MIT