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

clawrelay-weixin-server

v1.2.1

Published

Chat with Claude in WeChat using your Claude Code subscription. No API key needed.

Downloads

66

Readme

clawrelay-weixin-server

用你的 Claude Code 订阅账号,直接在微信里和 Claude 对话。无需 API Key。

如果你已经订阅了 Claude Pro/Max,你就已经有了 Claude Code 的使用权限。这个项目让你通过微信与 Claude 聊天——用的是你现有的订阅,而不是额外的 API 计费。

微信用户  <-->  clawrelay-weixin-server  <-->  clawrelay-api  <-->  Claude Code(你的订阅)

为什么用这个

  • 零额外成本 — 使用你的 Claude Code 订阅,不消耗 API 额度
  • 随时随地 — 手机微信就能和 Claude 对话
  • 完整能力 — 文件编辑、Bash 命令、Web 搜索,Claude Code 的全部工具
  • 多模态 — 支持发送图片和文件,Claude 能看懂并处理
  • 多账号 — 同一台机器可连接多个微信号
  • 一行启动npx clawrelay-weixin-server

快速开始

# 1. 安装并启动 clawrelay-api(将 Claude Code CLI 封装为 API)
#    参见: https://github.com/roodkcab/clawrelay-api

# 2. 启动微信桥接服务
npx clawrelay-weixin-server

首次运行会引导你完成:

  1. 配置 — relay API 地址(默认: http://localhost:50009)、工作目录(默认: 当前目录)
  2. 登录 — 用微信扫描终端中的二维码
  3. 开聊 — 在微信里给 Claude 发消息

前置条件

  • Node.js >= 18
  • clawrelay-api 在本地或服务器上运行
  • 一个微信个人账号
  • Claude Pro/Max 订阅(用于 Claude Code 访问)

配置

配置文件位于 ~/.clawrelay-weixin/config.yaml(使用 --profile 时位于 ~/.clawrelay-weixin/<profile>/config.yaml):

relay_url: "http://localhost:50009"    # clawrelay-api 地址
working_dir: "/path/to/project"        # Claude 工作目录
model: ""                              # 模型名(可选)
system_prompt: ""                      # 自定义系统提示词(可选)
allowed_users: []                      # 用户白名单,空 = 不限制
env_vars: {}                           # 传给 Claude 的环境变量

多账号

通过 --profile 参数在同一台机器上运行多个实例,连接不同微信号:

node dist/cli.js                    # 默认 profile
node dist/cli.js --profile work     # 第二个微信
node dist/cli.js --profile bot3     # 第三个微信

每个 profile 拥有独立的配置和登录状态(~/.clawrelay-weixin/<profile>/),互不干扰。

支持的消息类型

| 类型 | 发送到 Claude | 说明 | |------|:---:|------| | 文字 | ✅ | 直接转发 | | 图片 | ✅ | CDN 下载 + AES 解密,以 base64 发送 | | 文件 | ✅ | 支持 PDF、Office、代码等,上限 20MB | | 语音 | ✅ | 自动使用微信语音转文字 | | 视频 | ❌ | 提示暂不支持 |

命令

在微信中发送以下消息控制机器人:

| 命令 | 功能 | |------|------| | reset / new / 新对话 | 开启新的对话 | | help / 帮助 | 显示帮助信息 |

特性

  • 终端二维码扫码登录
  • Token 过期自动重新登录(约 24 小时)
  • 会话管理(2 小时 TTL)
  • 消息去重
  • Claude 思考时显示"正在输入"
  • 单用户并发保护
  • 优雅退出(Ctrl+C)
  • 输入安全清洗(防 prompt 注入)

架构

src/
├── cli.ts           # 入口,--profile 解析,优雅退出
├── config.ts        # YAML 配置读写
├── auth.ts          # 二维码登录 + token 持久化
├── session.ts       # 内存会话管理(2h TTL)
├── relay.ts         # clawrelay-api SSE 流式适配器(支持多模态)
├── weixin.ts        # iLink HTTP 长轮询 + CDN 媒体下载解密
└── orchestrator.ts  # 消息路由、命令处理、安全防护

开发

git clone https://github.com/wxkingstar/clawrelay-weixin-server.git
cd clawrelay-weixin-server
npm install
npm run build
npm test
node dist/cli.js

相关项目

许可证

MIT