Skills

Wechat Claude Code

微信消息桥接 - 在微信中与 Claude Code 聊天。支持文字对话、图片识别、实时进度推送、斜杠命令。

Install

npx skills add Wechat-ggGitHub/wechat-claude-code --skill wechat-claude-code -g -a claude-code -y
Category
AI and agents
Updated
4mo ago
License
MIT
Context cost
Lightabout 700 tokens
Runs scripts
No, instructions only

What it does

微信消息桥接 - 在微信中与 Claude Code 聊天。支持文字对话、图片识别、实时进度推送、斜杠命令。

WeChat Claude Code Bridge

通过个人微信与本地 Claude Code 进行对话。

前置条件

  • Node.js >= 18
  • macOS(daemon 使用 launchd 管理)
  • 个人微信账号(需扫码绑定)
  • 已安装 Claude Code(@anthropic-ai/claude-agent-sdk)

安装

方式一:通过 skills CLI(推荐)

npx skills add Wechat-ggGitHub/wechat-claude-code

首次触发时 skill 会自动克隆完整项目源码并安装依赖。

方式二:手动克隆

git clone https://github.com/Wechat-ggGitHub/wechat-claude-code.git ~/.claude/skills/wechat-claude-code
cd ~/.claude/skills/wechat-claude-code && npm install

触发场景

用户提到"微信桥接"、"微信聊天"、"wechat bridge"、"连接微信"、"微信状态"、"停止微信"等与微信桥接相关的话题时触发。

触发后的执行流程

被触发时,不要直接执行任何操作,先探查当前状态再给出可用操作。

按顺序检查以下状态:

第 1 步:检查项目是否完整安装

test -f ~/.claude/skills/wechat-claude-code/package.json && echo "source_ok" || echo "source_missing"
  • 如果 source_missing:需要从 GitHub 克隆完整项目。执行:

    git clone https://github.com/Wechat-ggGitHub/wechat-claude-code.git /tmp/wechat-claude-code-install && cp -r /tmp/wechat-claude-code-install/{src,scripts,*.ts,*.json,*.md,LICENSE} ~/.claude/skills/wechat-claude-code/ && rm -rf /tmp/wechat-claude-code-install
    

    然后继续检查依赖。

  • 如果 source_ok:继续检查依赖。

cd ~/.claude/skills/wechat-claude-code && test -d node_modules && echo "deps_ok" || echo "deps_missing"
  • 如果 deps_missing:执行 cd ~/.claude/skills/wechat-claude-code && npm install 安装依赖,然后继续。
  • 如果 deps_ok:继续下一步。

第 2 步:检查是否已绑定微信账号

ls ~/.wechat-claude-code/accounts/*.json 2>/dev/null | head -1
  • 如果没有账号文件:提示用户需要先执行 setup 扫码绑定,询问是否现在执行。
  • 如果有账号文件:继续下一步。

第 3 步:检查 daemon 运行状态

cd ~/.claude/skills/wechat-claude-code && npm run daemon -- status

第 4 步:根据状态展示信息

如果 daemon 未运行:

微信桥接已绑定但未运行。

可用操作:
  setup    重新扫码绑定(换号或过期时使用)
  start    启动服务
  logs     查看上次运行的日志

如果 daemon 正在运行:

微信桥接正在运行(PID: xxx)。

可用操作:
  stop     停止服务
  restart  重启服务(代码更新后使用)
  logs     查看运行日志
Read the whole SKILL.md on GitHub

More in AI and agents