greenbubbles README

The project's README from github.com/bojieli/greenbubbles. As one markdown file: README.md.

GreenBubbles icon

GreenBubbles

Enable your AI agents to access your WeChat history in real time.
Mac CLI + skills for agents. Local storage only.

Install · Get your key · CLI usage · Use with an agent · Docs · Database format · Contribute

CI Release License: MIT Platform: macOS 14+ Status: research alpha

GreenBubbles queries WeChat’s original encrypted databases locally and returns live results to your agent, without maintaining an exported chat database. A separate optional path creates an encrypted backup you can unlock and query later without WeChat.

GreenBubbles is a Mac command-line tool for reading your own WeChat history. It reads the database files WeChat already keeps on your Mac, so there is no export step and no second copy to keep up to date. You can:

Research alpha. Needs a Mac with Apple silicon and macOS 14 or later. Setup copies a key out of your own WeChat app, which needs administrator access. Reading and searching happen entirely on your Mac. If you use a cloud AI, the messages it reads are sent to that AI's provider.

What you can do

GreenBubbles never changes WeChat's files; it only reads them. Backups and notes are created only when you ask for them.

Install

You need macOS 14 or later on Apple silicon. Install the command-line tool with Homebrew:

brew tap bojieli/greenbubbles https://github.com/bojieli/greenbubbles.git
brew install bojieli/greenbubbles/greenbubbles

If Homebrew says the formula is untrusted, run this and then repeat the two commands above. Older Homebrew versions don't have brew trust and don't need it.

brew trust --formula bojieli/greenbubbles/greenbubbles

Prefer an app? Download the DMG from Releases and drag GreenBubbles to Applications. It is Developer ID signed and Apple notarized. Releases also include the command-line tool as a ZIP. See CLI releases and Homebrew to verify downloads or upgrade.

Build from source

You need Swift 6, Xcode's command-line tools, and Rust:

git clone https://github.com/bojieli/greenbubbles.git
cd greenbubbles
cargo build --locked --release --manifest-path Native/GreenBubbles/Cargo.toml
swift build --product greenbubbles-history
swift run greenbubbles-history

The command-line tool is built at Native/GreenBubbles/target/release/greenbubbles. The app asks for this path the first time it runs.

Getting your database key

The account key is captured into a private file on your Mac. That key and the database file’s salt derive the key used for local read-only access to WeChat’s original database.

WeChat encrypts its chat databases. To read them, GreenBubbles needs your account's key, which it copies from your running WeChat app one time.

This one-time setup needs administrator access and re-signs your copy of WeChat. The key setup guide has the steps and troubleshooting help. The key is saved to ~/.greenbubbles-acquire/passphrase.txt, a file only your account can read.

After that, commands work with no extra arguments: they find your WeChat data and key on their own. You need a query profile only to read a second WeChat account or a backup.

Usage

Once the key is set up, these commands read your live WeChat data:

Browse as you would in WeChat: list conversations, then open the one you want. You can use its nickname, remark, alias, or exact ID:

greenbubbles chats
greenbubbles messages list --conversation "Alice"
Command When to use it
greenbubbles messages list --conversation "Alice" Read the newest messages in one chat, including available attachment paths.
greenbubbles chats Browse a page of chats and their IDs.
greenbubbles messages search --query "keyword" Search message text across your chats.
greenbubbles messages search --conversation "Alice" --query "keyword" Search message text within one chat.
greenbubbles chats rank Find your most active conversations, ranked by how many messages you sent, with one-on-one chats first.
greenbubbles chats find "Alice" Find a chat by nickname, remark, alias, or ID; partial names work.
greenbubbles contacts list --details Browse contacts with their nicknames, remarks, and aliases.
greenbubbles message get --conversation <conversation-id> --message <message-id> Fetch one message using its ID from --json output.
greenbubbles source status Check database access and storage sizes without reading message text.

Replace "keyword" with the text to search for. --query "text" supplies it as a command-line argument. For interactive or piped input, use --query-stdin instead: run the command, type the search on the next line, press Return, then Control-D. Choose one input form per search. Run greenbubbles help --all for the full command list, greenbubbles messages list --help for help with a specific command, or greenbubbles version (also -v or --version) to check the installed version.

Replace "Alice" with a chat's nickname, remark, or alias. chats find matches partial names without reading messages. messages list and messages search accept names too; if a name matches several chats, the command shows choices so you can use an exact ID.

messages list and messages search print JSON Lines: a header, then one line per message with who sent it, whether it was you, the local time, and the text. messages list includes local paths for photos, videos, and files when they can be opened. Search results name the chat; use messages list to get attachment paths.

Details: CLI reference.

Prefer a window? Open the app and choose Browse Live or Snapshot…. It reads the same WeChat data as the command-line tool.

You can let a coding agent you already pay for do the reading and writing: Codex, Claude Code, OpenCode, Kimi Code, Gemini CLI, or Grok Build. If you're signed in with a subscription, this usually costs nothing extra.

GreenBubbles gives the agent a skill: a Markdown file of instructions, with helper files next to it. Nothing needs to be installed. With Homebrew, this prints where the skill is:

echo "$(brew --prefix greenbubbles)/libexec/skills/greenbubbles-personal-memory/SKILL.md"

Then tell your agent something like:

Read the GreenBubbles personal-memory SKILL.md at that path. Organize my conversations in the recent month into Markdown notes.

If you use the ZIP or a source checkout, the skill is at skills/greenbubbles-personal-memory/SKILL.md; keep the files around it in place. To have your agent find the skill automatically in future sessions, copy it into the agent's skills folder:

# Replace codex with claude, opencode, kimi, gemini, or grok.
python3 "$(brew --prefix greenbubbles)/libexec/scripts/install-skills.py" --agent codex

The agent reads messages through GreenBubbles and writes notes on your Mac. If the agent uses a cloud model, the messages it reads go to that provider. Never paste your database key or recovery phrase into a prompt.

More help: agent skills guide.

Use the built-in summarizer (optional)

If you don't use a coding agent, GreenBubbles can send chosen chats to Google's Gemini and save a cited summary as memory.md and memory.json. Run it with ai-summarize-direct.

This needs your own GEMINI_API_KEY and is billed by Google separately. Only conversations you have explicitly allowed in a policy file are sent. Each run writes a fresh summary; to keep improving the same set of notes over time, use a coding agent instead.

Setup steps: built-in summarizer guide.

Choose your next step

I want to… Read
Set up and start browsing User guide
Have my agent write notes from my chats Agent skills
Understand how the notes are organized Personal memory
Give an AI access to only some chats Give an AI access to only some chats
Back up and restore my history Recoverable snapshots
Fix a problem FAQ and known limitations
Understand the design Architecture and threat model

Everything else is in the documentation index.

Privacy

Everything GreenBubbles reads or writes stays on your Mac: WeChat's databases, your key file, backups, and notes. There is no telemetry or update check.

Message text leaves your Mac only when you choose a cloud AI:

A coding agent that can run commands has the same access to your files as you do. The skill tells it what to do but cannot restrict it. Notes and backups contain private information, so protect them as carefully as WeChat's own data. Details: PRIVACY.md.

Status

GreenBubbles is a research alpha for technical users reading their own data. WeChat changes its private formats; when GreenBubbles meets data it can't read, it says so instead of guessing. Public builds cannot send messages. See known limitations.

Contributing

Contributions are welcome, especially:

See CONTRIBUTING.md to get started. Use synthetic examples in reports and tests; leave out real messages, databases, keys, and account paths. Report security issues through SECURITY.md.

License

MIT — see LICENSE. Binary releases include third-party notices.

GreenBubbles is an independent project, not affiliated with or endorsed by Tencent. WeChat and other product names are trademarks of their respective owners.

greenbubbles (bojieli/greenbubbles)

Searching Database…

这是什么?GreenBubbles 是一个 Mac 命令行工具(附带可选的应用和智能体技能),直接从微信已经保存在你 Mac 上的数据库文件读取你自己的微信聊天记录,让你可以浏览、搜索、备份,或让编程智能体把选定的对话整理成带引用的 Markdown 笔记。
这是 CLI 工具还是图形界面应用?它主要是通过 Homebrew 安装的 CLI 工具,但也提供一个经 Developer ID 签名并通过公证的 macOS 应用(DMG),其中的 Browse Live 和 Snapshot 窗口读取同一份微信数据。
怎么安装它并开始读取我的聊天记录?用 Homebrew 安装 CLI,或从 Releases 下载 DMG 应用,然后运行一次性的密钥设置,从正在运行的微信应用中复制你的微信解密密钥;之后,greenbubbles chats 这类命令无需任何额外标志即可使用。
它已经适合日常可靠使用了吗?还不适合,它被标注为面向技术用户的研究版 alpha:微信会改动其私有数据库格式,因此遇到无法读取的数据时,GreenBubbles 会如实说明而不是猜测,而且公开构建无法发送消息。
它在 Intel Mac 上也能用吗?不行,它要求搭载 Apple 芯片的 Mac,且系统为 macOS 14 或更高版本。
我的微信数据实际上去了哪里?GreenBubbles 读取或写入的所有内容都留在你的 Mac 上,没有任何遥测或更新检查;只有当你选择让云端 AI 智能体或内置的 Gemini 摘要功能读取消息文本时,文本才会离开你的电脑。
它如何与 Claude Code 或 Codex 配合使用?GreenBubbles 附带一个 SKILL.md Markdown 文件和若干辅助文件;你把编程智能体指向它,让它把选定的对话整理成带引用的 Markdown 笔记,无需额外安装任何东西。
内置的摘要功能是什么?这是一个可选功能,通过 ai-summarize-direct 运行,只把你在策略文件中明确允许的聊天内容发送给 Google Gemini(使用你自己的 API 密钥),并写出带引用的 memory.md/memory.json。
备份是如何保护的?备份经过加密,由 24 个单词的恢复短语保护,因此即使之后没有安装微信,你也能打开聊天记录。
为什么设置需要管理员权限?一次性的密钥提取会从正在运行的微信应用中复制解密密钥,并对你的微信副本重新签名,这需要管理员权限。
Creator
bojieli
Size
3.3 MB
Stars
383
Updated
CommitOct 01
Age
1mo
Commits · 90 Days