Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wechat-skills

Windows WeChat desktop automation via Python keyboard simulation. Send text messages, images, and take screenshots — from Windows or WSL.

Features

  • 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 .env file

Prerequisites

  • Windows 10/11
  • WeChat for Windows — installed and logged in
  • Windows Python 3.8+ (not WSL Python)

Quick Start

1. Clone

git clone https://github.com/BESTBBZED/wechat-skills.git
cd wechat-skills

2. Install dependencies

Using Windows Python (PowerShell or CMD):

pip install pyautogui pyperclip Pillow pywin32 python-dotenv

3. Configure

cp .env.example .env

Edit .env to set your WeChat shortcut path:

WECHAT_EXE_PATH=C:\ProgramData\Microsoft\Windows\Start Menu\Programs\WeChat\WeChat.lnk

4. Run

# 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 "你好"

API

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")

CLI Arguments

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)

Environment Variables

Variable Description
WECHAT_EXE_PATH Path to WeChat .exe or .lnk shortcut (required)

How It Works

  1. Launches WeChat via the configured Start Menu shortcut
  2. Opens search with Ctrl+F, pastes the contact name
  3. Sends text by copying to clipboard → Ctrl+VEnter
  4. Sends images by copying to clipboard as BMP DIB → Ctrl+VEnter

Important Notes

  • 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

Kiro Skill

This project also ships as a Kiro agent skill. See SKILL.md for agent-specific instructions including automatic Python detection and installation.

License

Apache 2.0 — see LICENSE.

About

Windows WeChat automation — send messages and images via pyautogui keyboard simulation. Works from Windows Python (or WSL calling Windows Python). Use when asked to send WeChat messages, share images via WeChat, or automate WeChat on Windows.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages