whatsapp-web
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWhatsApp Web Skill
WhatsApp Web Skill
Overview
概述
Automates WhatsApp Web interactions including messaging, group management, status updates, and media sharing through browser automation with QR code authentication.
通过浏览器自动化(带二维码验证)实现WhatsApp Web的交互自动化,包括消息发送、群组管理、状态更新和媒体分享。
Quick Install
快速安装
bash
curl -sSL https://canifi.com/skills/whatsapp-web/install.sh | bashOr manually:
bash
cp -r skills/whatsapp-web ~/.canifi/skills/bash
curl -sSL https://canifi.com/skills/whatsapp-web/install.sh | bash或者手动安装:
bash
cp -r skills/whatsapp-web ~/.canifi/skills/Setup
设置
Configure via canifi-env:
bash
undefined通过canifi-env进行配置:
bash
undefinedFirst, ensure canifi-env is installed:
首先,确保已安装canifi-env:
curl -sSL https://canifi.com/install.sh | bash
curl -sSL https://canifi.com/install.sh | bash
canifi-env set WHATSAPP_LINKED "true"
undefinedcanifi-env set WHATSAPP_LINKED "true"
undefinedPrivacy & Authentication
隐私与认证
Your credentials, your choice. Canifi LifeOS respects your privacy.
你的凭证,由你掌控。 Canifi LifeOS尊重你的隐私。
Option 1: Manual Browser Login (Recommended)
选项1:手动浏览器登录(推荐)
If you prefer not to share credentials with Claude Code:
- Complete the Browser Automation Setup using CDP mode
- Login to the service manually in the Playwright-controlled Chrome window
- Claude will use your authenticated session without ever seeing your password
如果你不想与Claude Code共享凭证:
- 使用CDP模式完成浏览器自动化设置
- 在Playwright控制的Chrome窗口中手动登录该服务
- Claude将使用你的已认证会话,且全程不会看到你的密码
Option 2: Environment Variables
选项2:环境变量
If you're comfortable sharing credentials, you can store them locally:
bash
canifi-env set SERVICE_EMAIL "your-email"
canifi-env set SERVICE_PASSWORD "your-password"Note: Credentials stored in canifi-env are only accessible locally on your machine and are never transmitted.
如果你愿意共享凭证,可以将其存储在本地:
bash
canifi-env set SERVICE_EMAIL "your-email"
canifi-env set SERVICE_PASSWORD "your-password"注意:存储在canifi-env中的凭证仅能在你的本地机器上访问,绝不会被传输。
Capabilities
功能特性
- Send and receive text messages
- Share images, videos, and documents
- Create and manage groups
- Update and view status/stories
- Search messages and contacts
- Star and archive chats
- Manage group settings and admins
- Handle broadcast lists
- 发送和接收文本消息
- 分享图片、视频和文档
- 创建和管理群组
- 更新和查看状态/动态
- 搜索消息和联系人
- 标记星标对话和归档对话
- 管理群组设置和管理员
- 处理广播列表
Usage Examples
使用示例
Example 1: Send a Message
示例1:发送消息
User: "Send a WhatsApp message to Sarah asking about dinner plans"
Claude: I'll send that message on WhatsApp.
- Navigate to web.whatsapp.com
- Search for Sarah in contacts
- Open chat and compose message
- Send: "Hey Sarah, what are the dinner plans for tonight?"
- Confirm message delivered (double checkmarks)用户:"给Sarah发一条WhatsApp消息,询问晚餐计划"
Claude:我会在WhatsApp上发送这条消息。
- 导航至web.whatsapp.com
- 在联系人中搜索Sarah
- 打开对话并撰写消息
- 发送:"嘿Sarah,今晚的晚餐计划是什么?"
- 确认消息已送达(双对勾标记)Example 2: Create a Group
示例2:创建群组
User: "Create a WhatsApp group called 'Weekend Trip' with John, Mike, and Lisa"
Claude: I'll create that group.
- Click New Group
- Add John, Mike, and Lisa
- Set group name "Weekend Trip"
- Add group icon if available
- Confirm group created用户:"创建一个名为'周末旅行'的WhatsApp群组,成员包括John、Mike和Lisa"
Claude:我会创建这个群组。
- 点击新建群组
- 添加John、Mike和Lisa
- 设置群组名称为"周末旅行"
- 若有可用图标则添加群组图标
- 确认群组已创建Example 3: Share a File
示例3:分享文件
User: "Send the project proposal PDF to the Work group on WhatsApp"
Claude: I'll share that document.
- Open Work group chat
- Click attach file
- Select and upload proposal PDF
- Add caption if needed
- Send file to group用户:"将项目提案PDF发送到WhatsApp上的'工作'群组"
Claude:我会分享这份文档。
- 打开'工作'群组对话
- 点击附加文件
- 选择并上传提案PDF
- 如有需要添加说明文字
- 将文件发送到群组Example 4: Check Unread Messages
示例4:查看未读消息
User: "Check my unread WhatsApp messages and summarize them"
Claude: I'll check your unread messages.
- Identify chats with unread indicators
- Open each unread chat
- Read and collect new messages
- Present summary of conversations用户:"查看我的未读WhatsApp消息并进行总结"
Claude:我会查看你的未读消息。
- 识别带有未读标记的对话
- 打开每个未读对话
- 读取并收集新消息
- 呈现对话内容总结Authentication Flow
认证流程
- Navigate to web.whatsapp.com via Playwright MCP
- If QR code shown, notify user via iMessage to scan with phone
- Wait for phone authentication (timeout: 60 seconds)
- Verify chat list loads successfully
- Maintain session via local storage
- Re-authenticate if session expires
- 通过Playwright MCP导航至web.whatsapp.com
- 若显示二维码,通过iMessage通知用户用手机扫描
- 等待手机认证(超时时间:60秒)
- 验证对话列表是否成功加载
- 通过本地存储维持会话
- 若会话过期则重新认证
Error Handling
错误处理
- QR Code Timeout: iMessage reminder to scan QR code
- Session Expired: Notify user to re-link device
- Phone Disconnected: Alert user that phone must be online
- Rate Limited: Wait and implement backoff
- Contact Not Found: Search by phone number or name variations
- Group Limit Reached: Notify user of WhatsApp limits (1024 members)
- Media Failed: Check file size and format, retry upload
- Connection Lost: Wait for reconnection, notify if persistent
- 二维码超时:通过iMessage提醒用户扫描二维码
- 会话过期:通知用户重新关联设备
- 手机断开连接:提醒用户手机必须保持在线
- 请求受限:等待并实现退避机制
- 联系人未找到:通过电话号码或名称变体搜索
- 群组人数上限:通知用户WhatsApp的人数限制(1024名成员)
- 媒体上传失败:检查文件大小和格式,重试上传
- 连接丢失:等待重新连接,若持续断开则通知用户
Self-Improvement Instructions
自我改进说明
When encountering new WhatsApp features:
- Document new UI elements and chat patterns
- Add support for new message types (polls, etc.)
- Log successful group management patterns
- Update for new WhatsApp Web features
遇到WhatsApp新功能时:
- 记录新的UI元素和对话模式
- 添加对新消息类型(如投票等)的支持
- 记录成功的群组管理模式
- 针对WhatsApp Web的新功能进行更新
Notes
注意事项
- WhatsApp Web requires phone to be connected to internet
- End-to-end encryption maintained through web interface
- Status/stories expire after 24 hours
- Broadcast lists have recipient limits
- Some features require WhatsApp Business
- Voice and video calls not supported via web automation
- Multi-device beta allows operation without phone online
- WhatsApp Web要求手机连接互联网
- 通过网页界面维持端到端加密
- 状态/动态24小时后过期
- 广播列表有收件人数量限制
- 部分功能需要WhatsApp Business
- 网页自动化不支持语音和视频通话
- 多设备测试版允许在手机不在线的情况下运行