wechat-auto-reply-skill-v5 — wechat-auto-reply-技能-v5
v5监控 WeChat for new messages from specific contacts and auto-reply. Supports macOS (Peekaboo 命令行工具) and Windows (PeekabooWin). Requires Peekaboo 命令行工具 on macOS or PeekabooWin on Windows.
运行时依赖
安装命令
点击复制技能文档
WeChat Auto Reply (Cross-平台 v5)
监控 WeChat for new messages from any specified contact and auto-reply. Supports macOS (Peekaboo 命令行工具) and Windows (PeekabooWin).
Prerequisites macOS (应用le Silicon / Intel) Peekaboo 命令行工具 安装ed: brew 安装 steipete/peekaboo/peekaboo
权限s granted: Screen Recording + 访问ibility peekaboo 权限s
WeChat 运行ning and visible on screen Windows (10 / 11) Node.js 22+ 安装ed: https://nodejs.org node --version # 确认 >= v22.0.0
PeekabooWin 安装ed: git clone https://github.com/FelixKruger/PeekabooWin cd PeekabooWin npm 安装 npm test
设置 环境 variable (告诉脚本 PeekabooWin 在哪里): # 临时设置(当前 PowerShell 窗口有效) $env:PEEKABOO_WIN_DIR = "C:\Users\<你的用户名>\PeekabooWin"
# 永久设置(推荐) [系统.环境]::设置环境Variable("PEEKABOO_WIN_DIR", "C:\Users\<你的用户名>\PeekabooWin", "User")
WeChat (微信) 运行ning and visible on screen (不能最小化) Windows 权限s: 部分操作可能需要以管理员身份运行 PowerShell 确保微信窗口未被"专注助手"屏蔽 Python Python 3.7+ (macOS 和 Windows 均需要) 脚本仅使用标准库,无需额外 pip 安装 Quick 启动 Step 0: 平台 检测ion & Prerequisite 检查
When the user invokes this 技能 for the first time, always 运行 the prerequisite 检查 first. Do NOT 启动 监控ing until all prerequisites are confirmed.
运行 these 检查s using Bash 工具:
# 1. 检测 平台 echo "平台: $(uname -s 2>/dev/null || echo Windows)"
# 2. 检查 Python python3 --version 2>/dev/null || python --version 2>/dev/null
If macOS (Darwin): # 检查 Peekaboo 命令行工具 which peekaboo && peekaboo version
# 检查 权限s peekaboo 权限s
If Peekaboo NOT found, show this message to the user:
Peekaboo 命令行工具 未安装,请先执行以下命令:
brew 安装 steipete/peekaboo/peekaboo
安装后还需要授予权限:
打开 系统设置 → 隐私与安全 → 屏幕录制 → 勾选 Peekaboo 打开 系统设置 → 隐私与安全 → 辅助功能 → 勾选 Peekaboo
安装完成后对我说"监控 XX 的微信"即可。
If 权限s NOT granted, show:
权限未完全授予,请打开以下设置:
系统设置 → 隐私与安全 → 屏幕录制 → 勾选 Peekaboo 系统设置 → 隐私与安全 → 辅助功能 → 勾选 Peekaboo
授权后重新运行 peekaboo 权限s 确认。
If Windows: # 检查 Node.js version (must be >= 22) node --version
# 检查 PEEKABOO_WIN_DIR 环境 variable echo $env:PEEKABOO_WIN_DIR
# 检查 PeekabooWin exists if (Test-Path "$env:PEEKABOO_WIN_DIR\bin\peekaboo-win.js") { echo "PeekabooWin: FOUND" } else { echo "PeekabooWin: NOT FOUND" }
# 验证 PeekabooWin works node "$env:PEEKABOO_WIN_DIR\bin\peekaboo-win.js" --help 2>$null
If Node.js NOT found or version < 22, show this message:
Node.js 未安装或版本过低,请按以下步骤操作:
第 1 步:安装 Node.js 22+
打开 https://nodejs.org 下载 22.x.x LTS 版本(不要下载 20.x 或更低) 运行安装程序,一路点击"Next"完成安装 安装完成后,重新打开 PowerShell,运行 node --version 确认版本 >= v22.0.0
安装完成后对我说"监控 XX 的微信"即可。
If Node.js OK but PeekabooWin NOT found, show this message:
PeekabooWin 未安装,请按以下步骤操作:
第 2 步:安装 PeekabooWin
打开 PowerShell,运行: cd C:\ git clone https://github.com/FelixKruger/PeekabooWin cd PeekabooWin npm 安装 npm test
等待 npm test 全部通过(表示安装成功)
第 3 步:设置环境变量
[系统.环境]::设置环境Variable("PEEKABOO_WIN_DIR", "C:\PeekabooWin", "User")
设置后必须重新打开 PowerShell 才能生效。
全部完成后对我说"监控 XX 的微信"即可。
If PeekabooWin found but node --help fAIls, show:
PeekabooWin 已安装但运行异常,请检查:
Node.js 版本是否 >= 22:node --version 在 PeekabooWin 目录重新安装依赖:cd C:\PeekabooWin && npm 安装 确认没有安全软件拦截 All Prerequisites Met
Once all 检查s pass, proceed to Step 1 below.
Step 1: Ask User for Contact & Style Ask user: "Which contact to 监控?" (required - no default) Ask user: "Reply style/tone?" (default: friendly, match user personality) Take screenshot using the 应用ropriate engine Read screenshot to identify current chat 状态 启动 监控 script with --contact parameter (background) 设置 up 自动化 for auto-reply polling
Example: User says "监控 mini 的微信"
macOS: Contact = "mini" 启动 监控: python3 scripts/wechat_监控.py --contact mini --interval 600 Screenshot: peekaboo image --mode window --应用 微信 --retina --path /tmp/wechat_mon/latest.png Windows: Contact = "mini" 启动 监控: python scripts/wechat_监控.py --contact mini --interval 600 Screenshot: node /bin/peekaboo-win.js screen capture --输出 \wechat_mon\latest.png Core 工作流 Step 1: 检查 Contact & Current 状态
macOS:
peekaboo 列出 应用s --json | grep 微信 peekaboo image --mode window --应用 微信 --retina --path /tmp/wechat_mon/latest.png
Windows:
node \bin\peekaboo-win.js 应用 列出 node \bin\peekaboo-win.js screen capture --输出 %TEMP%\wechat_mon\latest.png
Read the screenshot to:
Identify the current chat contact 检查 for unread messages (red badge on avatar) Note existing messages in the conversation Step 2: Reply to a Message macOS (Peekaboo 命令行工具) # 1. Switch to WeChat peekaboo 应用 switch --to 微信
# 2. 命令行工具ck 输入 box (coords may vary by window position) peekaboo 命令行工具ck --coords 900,780 --应用 微信
# 3. Type the message peekaboo type "你的回复内容" --应用 微信
# 4. 发送 using type --return (NOT press --key return) peekaboo type "" --应用 微信 --return
导入ANT: peekaboo press --key return does NOT reliably trigger WeChat 发送. Alway