Back to Skills

wx-cli

wx-cli — 从本地微信数据库查询聊天记录、联系人、会话、收藏等。用户提到微信聊天记录、联系人、消息历史、群成员、收藏内容时,使用此 skill 安装并调用 wx-cli。

3,659stars1,403forksUpdated 6/25/2026

Security Assessment

Low Risk(75/100)

Detected risks:

Agent-reviewed override(curl|bash is the tool's own documented install.sh; sudo/LaunchD are macOS Full Disk Access setup for a local WeChat-data CLI. Legitimate installer flow, not malicious.)
Security Score75/100

About wx-cli

A command-line tool for querying chat history, contacts, sessions, favorites, and related data from a locally installed WeChat desktop database. It is invoked when a user mentions WeChat messages, message history, contacts, group members, group nicknames, or saved favorites, and it installs and drives the wx CLI to answer those requests. It runs on macOS (Apple Silicon or Intel) or Linux, requires WeChat desktop 4.x installed and logged in, and needs Node.js 14 or newer for npm installation or curl for the shell installer.

Setup is a one-time process. The tool installs via npm install of the wx-cli package or a curl-piped install script. On macOS the documented order is to re-sign WeChat with codesign, clear stale macOS TCC privacy authorizations with tccutil resets for services like ScreenCapture, Camera, and Microphone so new csreq records are regenerated, restart WeChat, and then run sudo wx init; on Linux it is simply sudo wx init. Initialization detects the WeChat data directory, scans process memory to extract database keys, and writes a config file under the home directory; after that, commands run without sudo and a daemon starts automatically on first use.

The command surface is broad and defaults to token-efficient YAML output with a json option. Session and message commands include sessions, unread with a filter for private, group, official, or folded, new-messages, history, and a full-database search, all carrying a chat_type field and supporting a limit for result counts. Contact and group commands list contacts and group members with stable identity fields like username, display, and group nickname. Moments commands cover interaction notifications, a cached feed, and full-text search, while biz-articles reads official-account article pushes from separate database shards. Attachment commands list image attachments and extract and decrypt them, documenting legacy XOR, V1 fixed-AES, and V2 AES-plus-XOR decoder tiers, and a favorites command lists saved items. Output wrappers expose metadata and freshness statuses such as possibly stale to signal when results may be incomplete.

FAQ

What platforms and prerequisites does wx-cli need?

It runs on macOS (Apple Silicon or Intel) or Linux with WeChat desktop 4.x installed and logged in, plus Node.js 14 or newer for npm install or curl for the shell installer.

Why does macOS setup involve codesign and tccutil steps?

WeChat must be re-signed with codesign, and because macOS TCC validates by bundle id plus csreq, old authorizations are reset with tccutil so macOS regenerates csreq from the new signature before running sudo wx init.

Do I need sudo for every command?

No. Only the first wx init needs sudo to scan memory and extract database keys; afterward all commands run without sudo and a daemon starts automatically on first use.

What output format do the commands use?

Commands default to YAML to save tokens and stay readable, with a json flag to switch to JSON for tooling like jq.

Can it extract images from chats?

Yes. The attachments command lists image attachments with an attachment id, and extract decrypts a single resource to a path, supporting legacy XOR, V1 fixed-AES, and V2 AES-plus-XOR decoders.

All Files

68 files
src/crypto/mod.rs5.6 KB
View
src/ipc.rs7.1 KB
View
src/daemon/meta.rs8.7 KB
View
src/scanner/linux.rs5.3 KB
View
src/scanner/macos.rs13.2 KB
View
src/scanner/mod.rs7.7 KB
View
src/scanner/windows.rs6.6 KB
View
src/daemon/server.rs10.1 KB
View
src/daemon/query.rs175.0 KB
View
src/cli/contacts.rs0.4 KB
View
src/cli/favorites.rs0.8 KB
View
src/cli/init.rs7.7 KB
View
src/cli/output.rs3.4 KB
View
src/cli/sessions.rs0.4 KB
View
src/cli/sns_search.rs0.8 KB
View
src/config.rs15.6 KB
View
src/daemon/cache.rs22.2 KB
View
src/main.rs0.2 KB
View
src/daemon/mod.rs6.0 KB
View
.claude/settings.local.json0.7 KB
View
.gitignore0.4 KB
View
SKILL.md9.1 KB
View
docs/macos-permission-guide.md8.4 KB
View
install.sh1.5 KB
View
npm/platforms/linux-x64/package.json0.2 KB
View
npm/platforms/win32-x64/package.json0.2 KB
View
src/attachment/decoder/v1_xor.rs5.3 KB
View
src/attachment/image_key/linux.rs0.3 KB
View
src/attachment/image_key/windows.rs7.1 KB
View
src/attachment/mod.rs1.0 KB
View
src/cli/export.rs3.3 KB
View
src/cli/daemon_cmd.rs2.7 KB
View
src/cli/history.rs2.6 KB
View
src/cli/members.rs0.4 KB
View
src/cli/new_messages.rs2.0 KB
View
src/cli/sns_notifications.rs0.8 KB
View
src/cli/unread.rs0.7 KB
View
.github/workflows/release.yml4.8 KB
View
config.example.json0.2 KB
View
README.md10.6 KB
View
docs/macos-3x-vs-4x-decryption-guide.md10.6 KB
View
npm/platforms/darwin-arm64/package.json0.2 KB
View
Cargo.lock35.8 KB
View
npm/wx-cli/install.js0.8 KB
View
src/attachment/decoder/mod.rs4.0 KB
View
src/attachment/decoder/v2.rs4.4 KB
View
src/attachment/image_key/macos.rs14.2 KB
View
src/attachment/resolver.rs14.1 KB
View
src/cli/biz_articles.rs0.8 KB
View
src/cli/extract.rs0.6 KB
View
src/cli/mod.rs13.6 KB
View
src/cli/search.rs1.0 KB
View
src/cli/sns_feed.rs0.7 KB
View
src/cli/stats.rs0.7 KB
View
src/crypto/wal.rs2.3 KB
View
src/cli/transport.rs14.1 KB
View
AGENTS.md0.9 KB
View
Cargo.toml1.6 KB
View
CLAUDE.md1.6 KB
View
LICENSE11.1 KB
View
install.ps11.6 KB
View
npm/platforms/darwin-x64/package.json0.2 KB
View
npm/platforms/linux-arm64/package.json0.2 KB
View
npm/wx-cli/bin/wx.js1.4 KB
View
npm/wx-cli/package.json0.8 KB
View
src/attachment/attachment_id.rs4.5 KB
View
src/attachment/image_key/mod.rs9.7 KB
View
src/cli/attachments.rs1.2 KB
View

Install wx-cli

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill