Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wechat-archive-cli

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.

Safety

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

Requirements (macOS)

  • Python 3.10+
  • sqlcipher installed (recommended via Homebrew): brew install sqlcipher
  • WeChat for macOS installed and logged in at least once (so local data exists)

Install (from source)

cd wechat-archive-cli
python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -e .

Quick start

1) Discover local WeChat data

wechat-archive discover

2) Archive everything to an external disk

wechat-archive archive --dest /Volumes/MyDisk/WeChatArchive

3) Extract DB key (assisted)

This command prints step-by-step instructions and can parse the key from pasted lldb output:

wechat-archive key-extract assisted --dest /Volumes/MyDisk/WeChatArchive

4) Export readable logs

wechat-archive export --dest /Volumes/MyDisk/WeChatArchive --format json

Commands

  • discover: detect DB + media roots and show candidate accounts
  • archive: copy all detected data into a timestamped snapshot + write a manifest
  • key-extract assisted: guided lldb flow + parser; stores key under state/ in the archive destination
  • export: decrypt message DBs to plaintext SQLite and export chats to JSON (v1)
  • clear-cache: safe cache clear; optional --reinstall (Homebrew cask if available)

Output layout

Within --dest:

  • snapshots/<timestamp>/... copied original directories/files
  • exports/<timestamp>/json/... readable exports
  • manifests/<timestamp>.json snapshot manifest
  • state/ local state (including key file); never commit

Disclaimer

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.

License

MIT — see LICENSE.

Legal note

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.

About

macOS CLI to archive local WeChat data and export readable chat logs

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages