Windows WeChat desktop automation via Python keyboard simulation. Send text messages, images, and take screenshots — from Windows or WSL.
- Send text messages to any contact or group
- Send images (PNG, JPG, BMP) via clipboard
- Take screenshots of the current screen
- WSL compatible — call Windows Python from WSL
- Configurable — WeChat path via
.envfile
- Windows 10/11
- WeChat for Windows — installed and logged in
- Windows Python 3.8+ (not WSL Python)
git clone https://github.com/BESTBBZED/wechat-skills.git
cd wechat-skillsUsing Windows Python (PowerShell or CMD):
pip install pyautogui pyperclip Pillow pywin32 python-dotenvcp .env.example .envEdit .env to set your WeChat shortcut path:
WECHAT_EXE_PATH=C:\ProgramData\Microsoft\Windows\Start Menu\Programs\WeChat\WeChat.lnk
# Send a text message
python scripts/main.py --name "Contact Name" --message "Hello!"
# Send an image
python scripts/main.py --name "Contact Name" --image_path "C:\Users\me\photo.png"
# Send both
python scripts/main.py --name "Contact Name" --message "Check this" --image_path "C:\Users\me\photo.png"From WSL:
WIN_PYTHON="/mnt/c/Users/<username>/AppData/Local/Programs/Python/Python312/python.exe"
"$WIN_PYTHON" scripts/main.py --name "张三" --message "你好"| Function | Description |
|---|---|
open_wechat() |
Launch WeChat via configured shortcut |
search_friend(name) |
Search and open a chat by contact/group name |
send_message(message) |
Send text to the active chat |
send_image(image_path) |
Send an image to the active chat |
take_screenshot(save_path) |
Capture the screen and save to file |
from scripts.main import open_wechat, search_friend, send_message, take_screenshot
open_wechat()
search_friend("Alice")
send_message("Hello from Python!")
take_screenshot("screen.png")| Argument | Required | Description |
|---|---|---|
--name |
Yes | Contact or group name (exact match) |
--message |
At least one | Text message to send |
--image_path |
At least one | Path to image file (Windows path) |
| Variable | Description |
|---|---|
WECHAT_EXE_PATH |
Path to WeChat .exe or .lnk shortcut (required) |
- Launches WeChat via the configured Start Menu shortcut
- Opens search with
Ctrl+F, pastes the contact name - Sends text by copying to clipboard →
Ctrl+V→Enter - Sends images by copying to clipboard as BMP DIB →
Ctrl+V→Enter
- Must use Windows Python — WSL Python cannot access the Windows GUI or clipboard
- Do not touch mouse/keyboard during execution
- Contact name must match exactly as displayed in WeChat (including Chinese characters)
- WeChat must be logged in and running on the desktop
This project also ships as a Kiro agent skill. See SKILL.md for agent-specific instructions including automatic Python detection and installation.
Apache 2.0 — see LICENSE.