personal-wechat
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePersonal WeChat via Wisdom
通过Wisdom操作个人微信
Use the user's self-hosted Wisdom service to operate their personal WeChat
account. Wisdom runs on a Windows host with WeChat Desktop logged in and exposes
an HTTP API.
Credentials are injected by the BYOC connector:
personalwechat- — Wisdom server base URL, e.g.
PERSONALWECHAT_BASE_URL.http://82.156.126.14:8000 - — Wisdom
PERSONALWECHAT_API_TOKEN. Secret — never echo, print, or log it.API_TOKEN
The helper sends the token as ; it never puts the
token in the URL. For queued UI operations such as search and send, the helper
submits the task and waits for before printing the final
result.
Authorization: Bearer .../api/tasks/{id}This is the user's real personal WeChat account. Read operations can run
directly. Sending messages or files must be dry-run first, then performed only
after the user explicitly approves the exact target and content.
使用用户自托管的Wisdom服务操作其个人微信账号。Wisdom运行在已登录微信桌面版的Windows主机上,并提供HTTP API。
凭证由 BYOC连接器注入:
personalwechat- — Wisdom服务器基础URL,例如
PERSONALWECHAT_BASE_URL。http://82.156.126.14:8000 - — Wisdom的
PERSONALWECHAT_API_TOKEN。属于机密信息——绝不要回显、打印或记录它。API_TOKEN
辅助工具会将令牌以的形式发送;绝不会将令牌放入URL中。对于搜索和发送等需要排队的UI操作,辅助工具会提交任务并等待接口返回后再打印最终结果。
Authorization: Bearer .../api/tasks/{id}这是用户的真实个人微信账号。读取操作可直接执行。发送消息或文件必须先进行试运行,仅在用户明确批准确切的接收对象和内容后才可执行。
CLI
CLI
The skill ships a stdlib-only helper:
bash
WX=$SKILL_DIR/scripts/personal_wechat.py该技能附带一个仅依赖标准库的辅助工具:
bash
WX=$SKILL_DIR/scripts/personal_wechat.pyVerify Connection First
先验证连接状态
Always start with status when the user asks to use WeChat:
bash
python3 $WX statusExpected healthy shape:
json
{"auth":{"logged_in":true,"wechat_running":true,"page":"logged_in"}}If , tell the user to open the Wisdom web UI / RDP and scan the
WeChat QR code. If the API returns 401, ask the user to reconnect the Personal
WeChat connector with the current Wisdom API token.
logged_in=false当用户要求使用微信时,始终先检查状态:
bash
python3 $WX status预期的健康状态返回格式:
json
{"auth":{"logged_in":true,"wechat_running":true,"page":"logged_in"}}如果,告知用户打开Wisdom网页UI/RDP并扫描微信二维码。如果API返回401,请用户使用当前Wisdom API令牌重新连接Personal WeChat连接器。
logged_in=falseRead Workflows
读取类工作流
Current Account
当前账号信息
bash
python3 $WX accountbash
python3 $WX accountContacts
联系人列表
bash
python3 $WX contacts --limit 50bash
python3 $WX contacts --limit 50Recent Conversations
最近会话
Use the normal conversations endpoint first; it prefers WeChat DB when ready and
falls back to Wisdom's app DB.
bash
python3 $WX conversations --limit 20For decrypted local WeChat history sessions:
bash
python3 $WX conversations --history --limit 20优先使用常规会话接口;当微信数据库就绪时会优先调用它,否则回退到Wisdom的应用数据库。
bash
python3 $WX conversations --limit 20如需获取解密后的本地微信历史会话:
bash
python3 $WX conversations --history --limit 20Messages in a Conversation
会话中的消息
First list conversations, then use the as :
idconversation_idbash
python3 $WX messages "34642176898@chatroom" --limit 50 --order asc先列出会话,然后将会话作为使用:
idconversation_idbash
python3 $WX messages "34642176898@chatroom" --limit 50 --order ascHistorical Messages
历史消息
Read from Wisdom's decrypted WeChat local databases:
bash
python3 $WX history --limit 50
python3 $WX history --talker "34642176898@chatroom" --limit 50
python3 $WX history --limit 20 --offset 20从Wisdom解密后的微信本地数据库读取:
bash
python3 $WX history --limit 50
python3 $WX history --talker "34642176898@chatroom" --limit 50
python3 $WX history --limit 20 --offset 20Raw SQL, Read-Only Only
仅允许只读的原始SQL
Wisdom permits only and :
SELECTPRAGMAbash
python3 $WX sql MicroMsg.db 'SELECT count(*) AS cnt FROM Session'Use raw SQL only for diagnostics or targeted metadata queries. Do not dump large
message tables unless the user explicitly asks.
Wisdom仅允许执行和语句:
SELECTPRAGMAbash
python3 $WX sql MicroMsg.db 'SELECT count(*) AS cnt FROM Session'仅在诊断或针对性元数据查询时使用原始SQL。除非用户明确要求,否则不要导出大型消息表。
Refresh History DB
刷新历史数据库
If history looks stale, refresh the decrypted DB snapshot:
bash
python3 $WX refresh-history如果历史记录看起来过时,刷新解密后的数据库快照:
bash
python3 $WX refresh-historySearch
搜索
bash
python3 $WX search "Alice"Search drives the WeChat UI, so it may be slower than local DB history reads.
bash
python3 $WX search "Alice"搜索操作会调用微信UI,因此可能比读取本地数据库历史记录慢。
Sending Messages — GATED
发送消息——受管控
send--confirm--unattended-confirmbash
python3 $WX send "Alice" "今晚 8 点开会吗?"默认情况下命令会执行试运行。除非添加参数,或者AceDataCloud定时任务已预先授权该技能并使用参数,否则绝不会发送消息。
send--confirm--unattended-confirmbash
python3 $WX send "Alice" "今晚 8 点开会吗?"-> {"dry_run": true, ...}
-> {"dry_run": true, ...}
Show the dry-run output to the user and ask for explicit approval of the exact
recipient and text. Only then run:
```bash
python3 $WX send "Alice" "今晚 8 点开会吗?" --confirmNever add in the first attempt. Never infer consent from vague text.
The user must clearly approve sending this exact message.
--confirm
将试运行结果展示给用户,并请求其明确批准确切的接收人和消息内容。仅在获得批准后再运行:
```bash
python3 $WX send "Alice" "今晚 8 点开会吗?" --confirm首次尝试绝不要添加参数。绝不要从模糊的文本中推断用户同意。用户必须明确批准发送这条确切的消息。
--confirmScheduled-task unattended confirmation
定时任务无人值守确认
When running inside an AceDataCloud scheduled task, the platform may pre-authorize
specific Skills for unattended execution. If all of these are true:
AICHAT_UNATTENDED_MODE=true- is
AICHAT_ACTIVE_SKILLorpersonal-wechatacedatacloud/personal-wechat - appears in
AICHAT_ACTIVE_SKILLAICHAT_UNATTENDED_ALLOWED_SKILLS
then the user has pre-authorized this Skill for that scheduled task. In that
case, use:
bash
python3 $WX send "Alice" "今晚 8 点开会吗?" --unattended-confirmIf the helper returns , do not retry with
; report the dry-run and explain that the task needs this Skill to be
selected in its unattended authorization settings.
unattended_confirmation_denied--confirm在AceDataCloud定时任务中运行时,平台可能会预先授权特定技能进行无人值守执行。当以下所有条件都满足时:
AICHAT_UNATTENDED_MODE=true- 为
AICHAT_ACTIVE_SKILL或personal-wechatacedatacloud/personal-wechat - 出现在
AICHAT_ACTIVE_SKILL中AICHAT_UNATTENDED_ALLOWED_SKILLS
则用户已预先授权该技能用于该定时任务。此时使用:
bash
python3 $WX send "Alice" "今晚 8 点开会吗?" --unattended-confirm如果辅助工具返回,不要尝试使用重试;请告知用户试运行结果,并说明该定时任务需要在无人值守授权设置中选中此技能。
unattended_confirmation_denied--confirmSafety Rules
安全规则
- Never print .
PERSONALWECHAT_API_TOKEN - Treat as full remote control of the user's WeChat.
PERSONALWECHAT_BASE_URL + API_TOKEN - For normal chat write/send operations: dry-run first, ask for explicit approval, then re-run with .
--confirm - For scheduled-task unattended writes: use only when the platform env says this Skill is pre-authorized.
--unattended-confirm - Do not call logout/restart endpoints from the skill unless the user explicitly asks to repair the Wisdom service.
- If Wisdom returns 503 for history, run once, then retry the read.
python3 $WX refresh-history - If the server is unreachable, ask the user to check the Windows host / security group / port 8000.
- 绝不要打印。
PERSONALWECHAT_API_TOKEN - 将视为对用户微信的完全远程控制权。
PERSONALWECHAT_BASE_URL + API_TOKEN - 对于常规聊天写入/发送操作:先执行试运行,请求明确批准,然后添加参数重新运行。
--confirm - 对于定时任务无人值守写入:仅当平台环境表明该技能已预先授权时,才使用参数。
--unattended-confirm - 除非用户明确要求修复Wisdom服务,否则不要从技能中调用注销/重启接口。
- 如果Wisdom返回503错误(历史记录相关),运行一次,然后重试读取操作。
python3 $WX refresh-history - 如果服务器无法访问,请用户检查Windows主机/安全组/8000端口。
Endpoint Mapping
端点映射
The helper wraps these Wisdom endpoints:
GET /api/statusGET /api/auth/statusGET /api/accountGET /api/contacts?version=2.0GET /api/conversationsGET /api/conversations/historyGET /api/messagesGET /api/messages/historyPOST /api/messages/history/queryPOST /api/messages/history/refreshPOST /api/search- (only after
POST /api/messages/sendor verified--confirm)--unattended-confirm
辅助工具封装了以下Wisdom端点:
GET /api/statusGET /api/auth/statusGET /api/accountGET /api/contacts?version=2.0GET /api/conversationsGET /api/conversations/historyGET /api/messagesGET /api/messages/historyPOST /api/messages/history/queryPOST /api/messages/history/refreshPOST /api/search- (仅在添加
POST /api/messages/send或验证通过的--confirm参数后调用)--unattended-confirm