← all repositories
huohuoer/wechat-cli

Your WeChat data, decrypted and CLI-queryable

A tool that scans WeChat's process memory to extract encryption keys, then lets you query chat history, contacts, and favorites locally — built for LLM agents.

wechat-cli
Velocity · 7d
+21
★ / day
Trend
steady
star history

What it does

WeChat CLI reads your local WeChat database by extracting encryption keys from running process memory, then exposes 11 commands to query chats, contacts, favorites, and statistics. Output is JSON by default, with optional Markdown or plain text export. It is essentially a packaged wrapper around wechat-decrypt with a command-line interface and AI-agent ergonomics.

The interesting bit

The init command performs on-the-fly memory scanning to find SQLCipher keys — on macOS this requires sudo and may trigger automatic re-signing of WeChat.app with com.apple.security.get-task-allow entitlements. The tool is explicitly designed as an “AI agent tool”: installation instructions are split into “For Humans” and “For AI Agents,” and the README suggests pasting a Chinese prompt into Claude Code to install it.

Key highlights

  • 11 commands: sessions, history, search, contacts, members, stats, export, favorites, unread, new-messages, init
  • Message type filtering: text, image, voice, video, sticker, location, link, file, call, system
  • Incremental message checking via new-messages with state saved to ~/.wechat-cli/last_check.json
  • Time-range filtering and per-chat statistics with 24-hour activity distribution
  • Claims fully local operation: no network transmission, read-only access

Caveats

  • macOS arm64 binary ships with npm; other platforms fall back to pip install from source
  • macOS requires WeChat ≤ 4.1.8.100 and macOS ≥ 26.3.1 — newer versions may break compatibility
  • Re-signing WeChat may disable its auto-update mechanism; official reinstall required to restore
  • task_for_pid failed errors on macOS require either automatic or manual codesign intervention

Verdict

Useful if you want to pipe your WeChat history into LLM context windows or build local automation. Skip it if you expect polished cross-platform binaries or are uncomfortable with memory-scanning and re-signing a chat app.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.