macOS-first CLI to archive local WeChat files (DBs + media) to an external disk and export readable chat logs (via SQLCipher decryption), while also preserving the original encrypted databases.
- This tool is designed for local personal backup.
- It does not upload your data anywhere.
- Destructive operations (wipe cache / reinstall) are opt-in and require explicit flags.
- Python 3.10+
sqlcipherinstalled (recommended via Homebrew):brew install sqlcipher- WeChat for macOS installed and logged in at least once (so local data exists)
cd wechat-archive-cli
python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -e .wechat-archive discoverwechat-archive archive --dest /Volumes/MyDisk/WeChatArchiveThis command prints step-by-step instructions and can parse the key from pasted lldb output:
wechat-archive key-extract assisted --dest /Volumes/MyDisk/WeChatArchivewechat-archive export --dest /Volumes/MyDisk/WeChatArchive --format jsondiscover: detect DB + media roots and show candidate accountsarchive: copy all detected data into a timestamped snapshot + write a manifestkey-extract assisted: guided lldb flow + parser; stores key understate/in the archive destinationexport: decrypt message DBs to plaintext SQLite and export chats to JSON (v1)clear-cache: safe cache clear; optional--reinstall(Homebrew cask if available)
Within --dest:
snapshots/<timestamp>/...copied original directories/filesexports/<timestamp>/json/...readable exportsmanifests/<timestamp>.jsonsnapshot manifeststate/local state (including key file); never commit
WeChat’s local database formats and encryption can change across versions. This tool aims to be robust, but may require updates for future WeChat releases.
MIT — see LICENSE.
Use this tool only with WeChat data you own and are allowed to access. The format of local databases can change without notice; exports may be incomplete after WeChat updates. This project is not affiliated with Tencent or WeChat.