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

v1.6.0

Published

OpenCode 微信机器人 - 通过官方 ilink API 将 OpenCode 集成到微信

Downloads

4,287

Readme

OpenCode 微信机器人

基于腾讯官方 ilink API,将 OpenCode AI 集成到微信,让微信变成你的 AI 助手。

功能特性

  • 微信官方 ilink API 接入,安全稳定
  • 支持 Windows、macOS、Linux 平台
  • 扫码登录,Token 持久化,自动重连
  • 文本对话、图片识别、语音转文字
  • 多模型切换(/m)、多 Agent 切换(/a)
  • 后台服务模式运行,日志输出
  • 单实例锁,防止重复启动
  • 长文本自动分段发送

安装

npm install -g opencode-wechat-bot

快速开始

1. 扫码登录

首次使用需要扫码登录微信:

opencode-wechat --login

用微信扫描终端显示的二维码,登录成功后账号会自动保存。

2. 启动机器人

前台运行(可看到实时输出):

opencode-wechat

后台服务模式(推荐):

opencode-wechat --daemon

3. 管理服务

opencode-wechat --status          # 查看服务状态
opencode-wechat --stop            # 停止后台服务
opencode-wechat --daemon --log /path/to/log.log  # 指定日志文件

命令列表

在微信聊天中发送以下命令:

| 命令 | 说明 | |------|------| | /new | 创建新会话 | | /m | 选择模型供应商和模型 | | /a | 选择 Agent | | /d | 显示当前工作目录 | | /cd <目录> | 切换工作目录 | | /s | 列出所有会话 | | /c | 取消当前操作 | | /h | 显示帮助信息 |

直接发送文字消息即可与 AI 对话,发送图片会自动识别,发送语音会自动转文字。

命令行选项

opencode-wechat                   前台运行
opencode-wechat --login           扫码登录微信
opencode-wechat --daemon          后台服务模式启动
opencode-wechat --stop            停止后台服务
opencode-wechat --status          查看服务状态
opencode-wechat --log <file>      指定日志文件(默认 opencode-wechat.log)
opencode-wechat --url <URL>       连接到已有的 opencode 服务
opencode-wechat --help            显示帮助信息

环境变量

| 变量 | 说明 | |------|------| | OPENCODE_API_KEY | opencode API 密钥(使用 --url 时需要) |

注意事项

  • 建议使用新注册的微信小号作为机器人
  • 遵守微信使用条款和相关法律法规
  • 后台模式运行时,日志默认输出到当前目录的 opencode-wechat.log
  • 同一目录下只能运行一个实例,重复启动会提示已有进程

从源码运行

cd packages/wechat
bun install
bun run src/cli.ts

License

MIT