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-wechat

v0.1.1

Published

WeChat ClawBot plugin for OpenCode

Readme

opencode-wechat

OpenCode 的微信 ClawBot 插件。通过 iLink Bot API 将微信消息桥接到 OpenCode AI 会话。

功能

  • 微信扫码登录
  • 双向消息桥接(微信 <-> OpenCode AI)
  • 通过微信命令管理多项目、多会话
  • CDN 媒体加解密(AES-128-ECB)
  • 文件锁单例机制 — 支持全局插件配置(多项目实例下仅运行一个轮询循环)

安装

Agent 驱动安装(推荐)

在 OpenCode 会话中粘贴以下内容:

Install and configure opencode-wechat by following the instructions here:
https://raw.githubusercontent.com/AllenZhZeng/opencode-wechat/refs/heads/main/docs/installation.md?t=1

手动安装

bunx opencode-wechat install

此命令会:

  1. "opencode-wechat" 添加到全局配置文件的 plugin 数组(~/.config/opencode/opencode.json
  2. 提示用户手动运行扫码登录命令

CLI 命令

bunx opencode-wechat install   # 注册插件并提示登录命令
bunx opencode-wechat login     # 仅扫码登录
bunx opencode-wechat status    # 查看 token 状态

微信命令

用户在微信中发送以下命令来管理项目和会话:

| 命令 | 别名 | 说明 | |------|------|------| | /projects | /ps | 列出所有项目 | | /sessions | /ss | 列出当前项目的会话 | | /use <序号\|名称> | | 按序号或名称切换项目 | | /switch <序号\|标题> | /sw | 按序号或标题切换会话 | | /new [标题] | | 创建新会话 | | /current | /cur | 显示当前项目和会话 | | /help | /h | 显示帮助信息 |

其他消息将转发到当前 OpenCode AI 会话。

插件配置项

通过 plugin 配置传递选项:

{
  "plugin": [
    ["opencode-wechat", {
      "baseUrl": "https://ilinkai.weixin.qq.com",
      "cdnBaseUrl": "https://novac2c.cdn.weixin.qq.com/c2c"
    }]
  ]
}

架构

微信用户
  │
  ├── /命令 ──> 命令解析器 ──> SDK (project.list, session.list 等)
  │
  └── 普通消息 ──> Bridge ──> SDK session.prompt() ──> OpenCode AI
                     │
                     └── Event hook <── tool 完成事件 ──> 微信回复

核心模块:

| 模块 | 说明 | |------|------| | src/plugin.ts | 插件入口,生命周期管理 | | src/bridge.ts | 会话映射、命令分发、消息路由 | | src/monitor/poll.ts | 微信消息长轮询循环 | | src/monitor/lock.ts | 跨实例文件锁单例 | | src/api/client.ts | iLink Bot HTTP 客户端 | | src/cdn/ | AES-128-ECB 媒体加解密 | | src/auth/ | 扫码登录与 token 持久化 | | src/messaging/ | 入站解析、出站格式化、命令解析 | | src/cli/ | CLI 入口(install、login、status) |

环境变量

| 变量 | 默认值 | 说明 | |------|--------|------| | WECHAT_BASE_URL | https://ilinkai.weixin.qq.com | iLink Bot API 地址 | | WECHAT_BOT_TYPE | 3 | 二维码生成时使用的 Bot 类型 |

Token 存储

Token 保存在 ~/.opencode/wechat/token.json,文件权限 0600

许可证

MIT