WeChat CLI Export
Export WeChat group member lists to CSV/JSON usingwechat-cli, with automatic fixes for Windows GBK encoding issues (emoji crashes).
Prerequisites
wechat-climust be installed and initialized (wechat-cli init)- Python 3.10+
Usage
Quick Export (Single Group)
~/群成员_26常工院NEC-RC主赛.csv— 三字段表格~/members_26常工院NEC-RC主赛.json— 完整原始数据
Options
Direct wechat-cli Usage
If the bundled script is insufficient, callwechat-cli directly with encoding fixes:
PYTHONIOENCODING=utf-8 before running wechat-cli on Windows to prevent emoji-related GBK crashes.
Output Fields (CSV)
Windows Encoding Fix
The bundled script automatically:- Sets
PYTHONIOENCODING=utf-8for the subprocess - Falls back to GBK decoding if UTF-8 fails
- Outputs CSV with UTF-8-BOM for Excel compatibility
wechat-cli manually on Windows and seeing UnicodeEncodeError: 'gbk' codec can't encode character, apply the fix in wechat_cli/output/formatter.py: