Skip to content

2233admin/qqcli-rs

Repository files navigation

qqcli

qqcli

CI Downloads Crates.io Platform License

English  ·  简体中文


The Story

Three years of frustration. Three times searching for something I knew I'd sent before.

2019 │ Looking for an address a friend sent me once
     │ Open QQ → scroll → scroll → scroll → forget which year → give up
     │
2020 │ Looking for a file shared in a group chat
     │ Open QQ → scroll → scroll → scroll → don't remember filename → give up
     │
2021 │ Looking for a work message
     │ Open QQ → scroll → scroll → scroll → wrong group → give up

The third time, I wrote a tool.

Now:

qq search "keyword"     # 0.3 seconds. No QQ. No scrolling.

Features

Command Description
qq sessions List recent chat sessions
qq history <id> View chat history with timestamps
qq history <id> --since 2024-01-01 Filter by date range
qq index Build full-text search index
qq search "keyword" Search across all messages
qq export <id> -o chat.md Export as Markdown
qq export <id> --format jsonl Export as JSONL
qq bundle <id> -o images.zip Download all images
qq plugin send <id> "message" Send message via NapCat

Quick Start

Download

Platform Download
Windows Download qq.exe from Releases
Linux/macOS Download qqcli binary

Run

# View recent sessions
qq sessions

# Search everything
qq index && qq search "meeting"

# Export a chat
qq export 123456789 -o chat.md

Tech Stack

┌─────────────────────────────────────────────────────────────┐
│                         qqcli                              │
├─────────────────────────────────────────────────────────────┤
│  Rust · rusqlite · DuckDB · tokio · clap                   │
├─────────────────────────────────────────────────────────────┤
│  QQ NT local database: Documents\Tencent Files\{QQ}\        │
│                          nt_qq\nt_db\nt_msg.db             │
└─────────────────────────────────────────────────────────────┘

FAQ

Q: Database not found?

Make sure QQ NT has been run at least once.

Q: Database encrypted?

Use qq-nt-decrypt to decrypt.

Q: Search is slow?

Run qq index first to build the search index.

Q: Where is the database?

Default location: Documents\Tencent Files\{QQ}\nt_qq\nt_db\nt_msg.db

Custom path: export QQCLI_DB_PATH=/path/to/nt_msg.db


Contributing

Contributions welcome! See CONTRIBUTING.md for setup instructions.

License

MIT


Star History

Time saved from scrolling can be used for something else.

About

本地QQ聊天记录命令行工具 - 搜索、导出、备份聊天记录

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages