wechat-cli  by freestylefly

Query local WeChat data via CLI for LLM integration

Created 1 week ago

New!

428 stars

Top 69.2% on SourcePulse

GitHubView on GitHub
Project Summary

A command-line interface (CLI) tool for querying local WeChat data, including chat history, contacts, and favorites. It is specifically designed for integration with Large Language Models (LLMs), offering programmatic access to personal WeChat data while ensuring privacy and enabling advanced analytics.

How It Works

The tool operates by first extracting necessary encryption keys from the WeChat process memory via an init command. It then performs on-the-fly, page-level AES-256-CBC decryption of the SQLCipher-encrypted SQLite databases where WeChat stores its data. All data querying and processing occur locally on the user's machine, ensuring data privacy and eliminating network transmission.

Quick Start & Requirements

Installation is straightforward: npm install -g @canghe_ai/wechat-cli is recommended, requiring Node.js. Alternatively, pip install wechat-cli needs Python >= 3.10. The tool supports macOS, Windows, and Linux. macOS users must grant Full Disk Access to their terminal application and may need to re-sign the WeChat application to allow process memory access, a process detailed in the README. Linux installations require root privileges.

Highlighted Details

  • AI-first design with JSON output for seamless LLM agent integration.
  • Fully local operation ensures data privacy; no data leaves the machine.
  • Provides rich analytics, including top senders, message type breakdowns, and activity charts.
  • Supports flexible data export to Markdown or plain text with time range filtering.
  • Offers 11 distinct commands for comprehensive data access.

Maintenance & Community

The provided README does not detail specific maintenance contributors, community channels (like Discord/Slack), or a public roadmap.

Licensing & Compatibility

The project is licensed under the Apache License 2.0, which is permissive for commercial use and integration into closed-source projects.

Limitations & Caveats

Compatibility is specifically tied to certain WeChat for Mac versions (≥ 26.3.1, ≤ 4.1.8.100); other versions may not function. macOS requires specific security permissions (Full Disk Access, potential WeChat re-signing) due to process memory access restrictions. Linux requires root privileges. The tool is strictly read-only and does not modify WeChat data or automate actions. Re-signing WeChat on macOS might impact its auto-update functionality.

Health Check
Last Commit

6 days ago

Responsiveness

Inactive

Pull Requests (30d)
2
Issues (30d)
8
Star History
430 stars in the last 8 days

Explore Similar Projects

Feedback? Help us improve.