by mrliuzhiyu
通过微信远程操控 Claude Code CLI,在手机上写代码、执行命令、管理项目 | Control Claude Code from WeChat
# Add to your Claude Code skills
git clone https://github.com/mrliuzhiyu/Wechat-Claude-botGuides for using ai agents skills like Wechat-Claude-bot.
Last scanned: 5/30/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-05-30T17:02:43.037Z",
"npmAuditRan": true,
"pipAuditRan": false
}Wechat-Claude-bot is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by mrliuzhiyu. 通过微信远程操控 Claude Code CLI,在手机上写代码、执行命令、管理项目 | Control Claude Code from WeChat. It has 102 GitHub stars.
Yes. Wechat-Claude-bot passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/mrliuzhiyu/Wechat-Claude-bot" and add it to your Claude Code skills directory (see the Installation section above).
Wechat-Claude-bot is primarily written in Python. It is open-source under mrliuzhiyu on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh Wechat-Claude-bot against similar tools.
No comments yet. Be the first to share your thoughts!
跟普通聊天机器人的区别? CowAgent/QClaw 只能文字对话。本项目通过 Claude Code / Open Interpreter 让 AI 真正操作你的电脑——读写文件、执行命令、修改代码、运行测试。PyQt6 桌面客户端,支持多 AI 引擎切换,极简高级设计风格。
📖 正在读取文件: src/app.js)/new 重置对话、/model 切换模型、/cwd 切换项目目录、/send 发送文件、/status 查看状态微信官方的 OpenClaw 是一个功能丰富的 AI 智能体框架,支持接入多种模型后端并通过 ClawBot 协议连接微信。它是一个完整的平台级方案,适合需要自定义 AI 能力的场景。
但如果你的目标是 通过微信远程操控本机 Claude Code,OpenClaw 并不是最优解。以下是两者的核心差异:
| 对比维度 | OpenClaw | 本项目 (WeChat Claude Code Bot) |
|---|---|---|
| 定位 | 通用 AI 智能体框架,支持多种模型和插件 | 专注一件事:微信连本机 AI 引擎 |
| 安装 | 框架本身 + API Key + 模型配置 + 插件系统 + 依赖链 | 3 步:git clone → pip install → python main.py |
| 依赖 | 框架庞大,依赖众多,安装易出问题 | 5 个核心依赖(PyQt6 / requests / cryptography / qrcode / python-dotenv) |
| 维护 | 框架更新频繁,需跟进升级,版本兼容容易踩坑 | 代码简洁透明,核心逻辑约 3600 行 |
这是最关键的区别:
| OpenClaw | 本项目 | |
|---|---|---|
| 计费方式 | 每次对话调用 Claude API,按 Token 计费 | 使用本机 Claude Code CLI,走订阅额度 |
| 成本特点 | 长对话、代码分析、多轮交互 Token 消耗大,费用不可控 | 零额外 Token 费用,已有 Claude Code 订阅即可 |
| API Key | 必须配置 | Claude Code 引擎不需要(其他引擎可选) |
本项目之所以选择连接 Claude Code CLI 而非直接调 API,是因为 Claude Code 本身提供了 API 调用无法替代的能力:
这些能力通过 API 调用 + 自行实现工具链也能做到,但 Claude Code CLI 已经是一个打磨好的成熟产品,没必要重复造轮子。
OpenClaw = 功能齐全的 AI 框架,适合需要自定义 AI 能力的通用场景,但重、贵、装起来费劲
本项目 = 轻量 Python 桌面客户端、零额外成本、专注做一件事:让你在微信里远程操控 AI
本项目基于微信官方 iLink Bot (ClawBot) 协议,通过微信扫码建立连接:
启动客户端后 GUI 显示二维码,用微信扫码即可连接。连接后即使退出微信,Bot 仍持续运行并处理消息,重新打开微信即可看到回复。
┌──────────┐ ┌──────────────────┐ ┌───────────────┐
│ 微信用户 │ ──消息──▶│ iLink Bot API │ ──轮询──▶│ 本机 Bot │
│ (手机端) │ ◀─回复── │ (weixin.qq.com) │ ◀─发送── │ (PyQt6 客户端) │
└──────────┘ └──────────────────┘ └──────┬────────┘
│
│ 调用适配器
▼
┌─────────────────────┐
│ Claude Code CLI │
│ Open Interpreter │
│ Direct API │
│ (三选一) │
└─────────────────────┘
npm install -g @anthropic-ai/claude-code)— 使用 Claude Code 引擎时需要# 1. 克隆项目
git clone https://github.com/mrliuzhiyu/Wechat-Claude-bot.git
cd Wechat-Claude-bot
# 2. 安装依赖
pip install -r requirements.txt
# 3. (可选) 配置工作目录
cp .env.example .env
# 编辑 .env 设置 CLAUDE_CWD 为你的项目路径
# 4. 启动客户端
python main.py
首次登录后 Token 会自动保存,下次启动无需重复扫码(除非 Token 过期)。
通过 .env 文件或环境变量配置:
| 变量 | 说明 | 默认值 |
|---|---|---|
CLAUDE_CWD |
Claude Code 的默认工作目录 | 当前工作目录 |
每个用户可通过
/cwd命令独立切换工作目录,不影响其他用户。默认模型为 Sonnet。
在客户端设置页面可以:
在微信中直接用自然语言描述你的需求,Claude Code 会自动执行:
你: 看看项目结构
Bot: 🤖 收到,正在处理...
Bot: 🔍 正在搜索文件: **/*
Bot: 项目结构如下:
├── src/
│ ├── components/
│ ├── pages/
│ └── utils/
├── package.json
└── README.md
Claude Code 执行操作时,你会收到实时进度反馈:
📖 正在读取文件: src/app.js
✏️ 正在编辑文件: src/utils.js
⚡ 正在执行命令: npm test
🔍 正在搜索文件: **/*.ts
🔍 正在搜索内容: handleClick
📝 正在创建文件: src/helper.js
📋 正在规划任务
当 Claude Code 的回复超过 4000 字时,消息会被智能拆分:
(续 2/3)同事反馈线上有个紧急 Bug,你正在地铁上。
你: 看看 src/api/auth.js 的 login 函数
Bot: [显示代码内容]
你: 第 42 行的 token 校验逻辑有问题,过期时间应该用 > 而不是 >=
Bot: ✏️ 正在编辑文件: api/auth.js
Bot: 已修改,将 >= 改为 >
你: 跑一下测试
Bot: ⚡ 正在执行命令: npm test
Bot: 全部 23 个测试通过 ✓
你: 提交改动,消息写"fix: 修复 token 过期判断边界条件"
Bot: 已提交并推送到远程仓库
周末在外面,突然有个灵感想快速加个功能。
你: 在 src/components 下创建一个 ThemeToggle 组件,支持深色/浅色模式切换
Bot: 📝 正在创建文件: components/ThemeToggle.jsx
Bot: ✏️ 正在编辑文件: App.jsx
Bot: 已创建 ThemeToggle 组件并在 App.jsx 中引入...
接手一个新项目,想快速了解代码结构。
你: 这个项目的整体架构是什么样的?
Bot: [分析项目结构、主要模块、技术栈...]
你: 数据库连接的逻辑在哪里?
Bot: 🔍 正在搜索内容: database|connection|mongoose
Bot: 数据库连接在 src/config/db.js 中...
在外面需要检查服务状态。
你: 看看 docker 容器运行状态
Bot: ⚡ 正在执行命令: docker ps
Bot: [显示容器列表...]
你: 看看最近的日志有没有报错
Bot: ⚡ 正在执行命令: docker logs --tail 50 my-app
Bot: [显示日志...]
| 命令 | 说明 |
|---|---|
/help |
显示帮助信息 |
/new |
重置对话,开始新会话 |
/model |
切换模型(sonnet / opus / haiku),默认 Sonnet |
/cwd <路径> |
切换工作目录/项目(每用户独立) |
/send <路径> |
发送本机文件到微信(支持图片、文件、视频,上限 50MB) |
/send <路径> | 说明 |
带说明文字发送 |
/status |
查看 Bot 状态(版本、模型、目录、运行时间) |
除斜杠命令外,所有消息都会发送给 AI 引擎处理。Claude Code 读取或创建的媒体文件会自动发送到微信。
Wechat-Claude-bot/
├── main.py # PyQt6 应用入口
├── core/ # 核心逻辑
│ ├── config.py # 全局配置(路径、常量、模型定义)
│ ├── weixin_api.py # 微信 iLink Bot API 封装
│ ├── media.py # 媒体收发(CDN + AES-128-ECB 加解密)
│ └── bot_engine.py # Bot 引擎(消息路由、会话管理、并发控制)
├── adapters/ # AI 模型适配器
│ ├── base.py # 抽象基类 ModelAdapter
│ ├── claude_code.py # Claude Code CLI 适配器
│ ├── open_interpreter.py # Open Interpreter 适配器
│ ├── direct_api.py # 纯 API 适配器(Anthropic/OpenAI/DeepSeek)
│ └── registry.py # 适配器注册中心(工厂 + 引擎检测)
├── ui/ # PyQt6 界面
│ ├── main_window.py # 主窗口(5 视图 + 自定义组件)
│ └── theme.py # 极简高级主题(颜色令牌 + QSS)
├── requirements.txt # Python 依赖
├── .env.example # 环境变量示例
├── DESIGN.md