Skip to content

About

A WeChat plugin for kimi work users

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

WeChat Assistant — Kimi Plugin

A Kimi Desktop plugin that lets the AI operate your WeChat (Weixin) desktop client: read chats and messages, send replies, listen for new messages, and more — all through the official desktop client, no account hacking, no unofficial protocols.

⚠️ Disclaimer: Automating personal WeChat accounts may be subject to WeChat's Terms of Service. Use at your own risk. This plugin only drives the official client's UI like a human would — it does not inject code, hook processes, or use reverse-engineered protocols.

Features

Feature Windows (WeChat 4.x) Windows (WeChat 3.9.x) Linux (WeChat 4.x)
Connection status ✅ ✅ ✅ experimental
List chats ✅ ✅ ✅ experimental
Read messages (incl. scroll-back history) ✅ ✅ ✅ experimental
Send text messages ✅ ✅ ✅ experimental
Listen for new messages (real-time polling) ✅ ✅ ✅ experimental
Send files 🔜 planned ✅ 🔜 planned
@mentions in groups 🔜 planned ✅ 🔜 planned
Friend requests (list/accept) 🔜 planned ✅ 🔜 planned
Contact list 🔜 planned ✅ 🔜 planned

How it works (architecture)

WeChat 4.x (Qt-based) does not expose its UI to Windows UI Automation — the window is accessibility-dark. This plugin uses three backends, auto-detected:

  • win4 (Windows, WeChat 4.x): visual automation — captures the window with PrintWindow (works even when the window is behind others), reads it with OCR (RapidOCR, Chinese + Latin support), and acts with coordinate clicks + clipboard paste. Restores minimized windows automatically. Scrolls the message pane to read conversation history page by page.
  • win (Windows, WeChat 3.9.x classic): UI Automation (uiautomation) — full feature set.
  • linux (Linux, official WeChat 4.x): AT-SPI accessibility (pyatspi) — experimental.

Force a backend with --backend win|win4|linux or the WX_BACKEND environment variable.

Requirements

  • Kimi Desktop
  • WeChat desktop, logged in, main window open (it may be in the background):
    • Windows: WeChat 4.x (current version) or 3.9.x classic
    • Linux: official WeChat 4.x from linux.weixin.qq.com (experimental)
  • Python dependencies:
    pip install uiautomation pywin32 comtypes rapidocr-onnxruntime pillow numpy opencv-python
    Linux additionally: sudo apt install python3-pyatspi (or your distro's equivalent — not available via pip).

Installation

  1. Clone this repository to a permanent location (the plugin registers from this path — don't delete it):
    git clone <your-repo-url> wechat-assistant
  2. Register it into Kimi's personal plugin market:
    kimi-daimon kimi-plugin register-personal /path/to/wechat-assistant
    (Or simply ask Kimi: "register the plugin at /path/to/wechat-assistant".)
  3. In Kimi Desktop, open the Plugins page → 「个人」 (Personal) tab → click + on WeChat Assistant to install it. No restart needed.
  4. Open WeChat and log in (keep the main window open; it can stay in the background).

Usage

Just talk to Kimi naturally:

  • "Do I have new WeChat messages?"
  • "Read the latest messages from my chat with Anna"
  • "Reply to Anna that I'm on my way" — Kimi will show you the exact text and ask for confirmation before sending.
  • "Let me know if Carlos writes me in the next 10 minutes"
  • "Read the conversation history with File Transfer going back 10 pages" — scroll-back via OCR.

All write operations (send, accept friend, etc.) require explicit confirmation — the CLI enforces --confirm yes.

CLI reference (what the agent calls)

python scripts/wx_cli.py status                     # connection status
python scripts/wx_cli.py chats                      # list chats
python scripts/wx_cli.py messages --chat "Anna" --count 30 [--pages 5]
python scripts/wx_cli.py send --chat "Anna" --text "Hi!" --confirm yes
python scripts/wx_cli.py listen --chat "Anna" --timeout 300
python scripts/wx_cli.py send-file --chat "Anna" --file report.pdf --confirm yes   # win 3.9
python scripts/wx_cli.py at --chat "Group" --who "Anna" --text "look" --confirm yes # win 3.9
python scripts/wx_cli.py contacts / friends-new / friend-accept                     # win 3.9
python scripts/wx_cli.py tree                       # debug: UI tree / raw OCR dump
python scripts/wx_cli.py screenshot --path out.png  # debug: window capture (win4)

All output is JSON on stdout. Errors are actionable: {"ok": false, "error": "...", "hint": "..."}.

Safety & privacy

  • The agent will never send a message without your explicit confirmation (enforced by the CLI).
  • Read messages stay local — the plugin has no network code at all.
  • Windows session must be unlocked while sending (clicks need an active session).
  • If WeChat is minimized to the system tray, click its tray icon to restore the main window before use.

Limitations

  • WeChat Web is not supported (Tencent blocks web login server-side for most accounts — not a plugin limitation).
  • win4 backend relies on OCR: very small text or emoji may be misread; WeChat UI layout changes may require adjustments.
  • Images/videos/voice messages are detected as markers (e.g. [图片]), their content can't be read.
  • Linux backend is experimental (core messaging only).

Project layout

├── kimi.plugin.json            # plugin manifest
├── skills/wechat-assistant/
│   └── SKILL.md                # agent instructions (Spanish)
└── scripts/
    ├── wx_cli.py               # CLI entry point (backend auto-detection)
    ├── wx_engine_win4.py       # WeChat 4.x visual/OCR backend (Windows)
    ├── wx_engine.py            # WeChat 3.9.x UIA backend (Windows)
    └── wx_engine_linux.py      # WeChat 4.x AT-SPI backend (Linux, experimental)

License

MIT

About

A WeChat plugin for kimi work users

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages