平时泡不少 Discord 社区( crypto 、开源项目、AI 讨论组),消息量大、翻找困难。Discord 自带搜索不支持正则,也没法离线查看。于是写了 discord-cli——一个 local-first 的 Discord 命令行工具:
GitHub: https://github.com/jackwener/discord-cli
PyPI: https://pypi.org/project/kabi-discord-cli/
# 提取并保存本地 Discord token
discord auth --save
# 发现所有可见文字频道并同步
discord dc sync-all -n 500
# 增量同步(只拉新消息)
discord dc sync-all
retry_after / X-RateLimit-Remaining header ,不会触发封号)~/Library/Application Support/discord-cli/messages.db# 全文搜索
discord search "rust" -c general
# 今天的消息
discord today
# 按小时统计活跃度
discord timeline --by hour
# 谁发言最多
discord top --hours 24
# 各频道消息量
discord stats
# JSON / YAML 输出
discord search "release" --json
discord today -c general --yaml
# 导出为文件
discord export general -f json -o out.json
# 安装 AI 依赖
uv tool install 'kabi-discord-cli[ai]'
export ANTHROPIC_API_KEY=...
# 频道 AI 分析
discord analyze general --hours 24
# 全局摘要
discord summary --hours 12
# 推荐
uv tool install kabi-discord-cli
# 或 pipx
pipx install kabi-discord-cli
Python 3.10+ 即可,依赖很少( httpx + click + rich + PyYAML )。
discord summary 生成 AI 摘要,快速了解今天社区讨论了什么timeline / top / stats 了解社区活跃度这是我做的社交平台 CLI 系列的一部分,同样的 local-first 思路:
| 工具 | 平台 | GitHub |
|---|---|---|
| twitter-cli | Twitter/X | https://github.com/jackwener/twitter-cli |
| bilibili-cli | 哔哩哔哩 | https://github.com/jackwener/bilibili-cli |
| xiaohongshu-cli | 小红书 | https://github.com/jackwener/xiaohongshu-cli |
| tg-cli | Telegram | https://github.com/jackwener/tg-cli |
Apache-2.0 开源,欢迎 Star ⭐ 和反馈 🙏
有什么想法或者需要支持的功能,欢迎在 Issues 里提。