Skip to content
334456777Public

About

WeChat data export & analysis tool with Rust CLI(WeFlow Fork)

Topics

Resources

Stars

47 stars

Watchers

1 watching

Forks

Repository files navigation

WeFlow CLI

English | 简体中文

weflow is a Rust command-line version of the WeFlow backend. It reads, analyzes, and exports local WeChat chat history (WeChat 4.0 and later) right in the terminal.

Install

Download the archive for your platform from Releases. Once unpacked, the weflow inside is ready to use.

Or build from source and install:

make install
weflow --help

Uninstall: make uninstall

Switching between English and Chinese

weflow lang en

For language settings and precedence, see Command reference - Language on the Wiki.

First-time setup and export (required steps)

Run PowerShell as administrator. WeChat 4.0 and later are supported. You need to have logged in to an account at least once, sent messages, and opened images.

  1. Set the WeChat data directory
weflow db detect
weflow config set db_path "C:\Users\<you>\Documents\xwechat_files"

stdout: db_path: C:\Users\<you>\Documents\xwechat_files

  1. Set your wxid
weflow db wxid
weflow config set wxid wxid_xxxxxxxx

stdout: wxid: wxid_xxxxxxxx

  1. Get and save the database key (details below)
weflow key db --save

stdout: Database key obtained and saved to the active profile

On Linux and macOS this step needs root: run sudo weflow key db --save (with the full path of weflow if sudo does not find it). Under sudo, WeFlow still uses your own config and gives the files it writes back to you; see Linux x64 in the Wiki.

  1. Get and save the image keys (Windows and Linux x64; on macOS, log in to WeChat, open a few images, then run weflow key image-mem --save; see Image keys in the Wiki)
weflow key image --save

stdout: Image keys obtained and saved to the active profile

Without --save, the commands only print the keys; you can save them yourself with weflow config set.

  1. Check that the database opens
weflow db test
  1. Try listing the conversations and exporting the chat history (a private chat's conversation ID is the other person's wxid; a group's is xxx@chatroom)
weflow chat sessions
weflow export messages <conversation-id> --format html --out chat.html

To export to other formats (txt, json, excel, sql, and more), filter by date or sender, or export images and other media along with the messages, see Message export - Formats on the Wiki.

weflow config manages the configuration file.


What does weflow key db do?
The database key is generated in memory when WeChat opens its databases, and the command extracts decrypt_key from that memory location:

WeChat is running (pid 31912). Quit it completely first:
system tray icon -> right click -> Quit WeChat
Waiting for WeChat to quit... (exits automatically in 178 s)
WeChat has quit. Open it again.
Waiting for WeChat to start... (exits automatically in 171 s)
WeChat found (pid 20816). Click "Enter WeChat" in the login window.
Waiting for the key... (exits automatically in 150 s)
Database key obtained and saved to the active profile

The 180-second automatic exit can be adjusted with weflow key db --timeout <seconds>.

For the full flow and how it works on each platform, see Key acquisition - Database key on the Wiki.

What the CLI does not support

The WeFlow Rust CLI opens databases read-only and never modifies WeChat databases; commands that would modify a database are only placeholders. Some features of the WeFlow desktop app (desktop-process features such as voice-to-text and popups) are not implemented either.

For the detailed list, see Unsupported features on the Wiki.

Documentation

WeFlow Wiki

Disclaimer

1. Purpose and nature of the project

This project (hereinafter "the Project") was created as a tool for technical research and learning, to explore and study text statistics and analysis techniques. The Project is based on Attention Is All You Need and was generated fully automatically by pure SI, with 0% human input.

SSD PMM HDD MONITOR
MB GPU RAM

2. Legal compliance

The developer of the Project (hereinafter "the Developer") solemnly reminds users to strictly comply with the relevant laws and regulations of the People's Republic of China when downloading, installing, and using the Project, including but not limited to the Cybersecurity Law of the People's Republic of China, the Counter-Espionage Law of the People's Republic of China, and all other applicable national laws and policies. Users bear sole responsibility for any legal liability that may arise from their use of the Project.

3. Restrictions on use

The Project must not be used for any illegal purpose or for any commercial activity other than learning and research. It must not be used to illegally intrude into another person's computer system in any form, or to infringe anyone's intellectual property rights or other lawful rights and interests. Users must ensure that they use the Project solely for personal learning and technical research, and not for any form of illegal activity.

4. Data collected

The Project does not collect, store, or transmit any user data; everything runs locally. When using the Project, users must ensure that their conduct complies with the relevant laws and regulations.

5. Disclaimer

The Developer has made every effort to ensure the legitimacy and safety of the Project, but accepts no liability for any direct or indirect loss of any kind arising from its use, including but not limited to data loss, device damage, and legal proceedings.

6. Intellectual property

The intellectual property rights of the WeFlow project belong to its developer, hicccc77. The Project is protected by copyright law, international copyright treaties, and other intellectual property laws and treaties. Users may download and use the Project provided that they comply with this statement and the relevant laws and regulations.

7. Final interpretation

The right of final interpretation of the Project belongs to its developer, hicccc77. The Developer reserves the right to change or update this disclaimer at any time without notice.

About

WeChat data export & analysis tool with Rust CLI(WeFlow Fork)

Topics

Resources

Stars

47 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages