Hacker News 中文摘要

RSS订阅

Wacli – WhatsApp 命令行工具:同步、搜索、发送 -- Wacli – WhatsApp CLI: sync, search, send

文章摘要

该项目是WhatsApp的命令行界面工具wacli,由开发者steipete在GitHub上开源,旨在提供通过命令行操作WhatsApp的功能。

文章总结

WhatsApp 命令行工具 wacli 项目简介

项目概述

wacli 是一个基于 whatsmeow 开发的 WhatsApp 命令行工具,主要功能包括: - 消息历史记录的本地同步和持续捕获 - 快速离线搜索 - 消息发送 - 联系人和群组管理

该项目是使用 WhatsApp Web 协议的第三方工具,与 WhatsApp 官方无关。

项目状态

核心功能已实现,完整设计说明可查看 docs/spec.md 文件。

最新更新 (0.2.0 版本)

  • 消息搜索/列表显示现在包含回复、反应和媒体类型的显示文本
  • 发送功能新增 --filename 参数可覆盖显示名称
  • 认证功能新增 WACLI_DEVICE_LABELWACLI_DEVICE_PLATFORM 环境变量覆盖选项

安装与构建

通过 Homebrew 安装 (推荐)

brew install steipete/tap/wacli

本地构建

go build -tags sqlite_fts5 -o ./dist/wacli ./cmd/wacli

快速入门

默认存储目录为 ~/.wacli (可通过 --store DIR 参数修改)

```shell

1) 认证(显示二维码)并初始化同步

pnpm wacli auth

2) 持续同步(不会显示二维码,需先认证)

pnpm wacli sync --follow

诊断

pnpm wacli doctor

搜索消息

pnpm wacli messages search "会议"

补充历史消息(需要主设备在线)

pnpm wacli history backfill --chat 1234567890@s.whatsapp.net --requests 10 --count 50

下载媒体文件

./wacli media download --chat 1234567890@s.whatsapp.net --id <消息ID>

发送消息

pnpm wacli send text --to 1234567890 --message "你好"

发送文件

./wacli send file --to 1234567890 --file ./pic.jpg --caption "嗨"

或覆盖显示名称

./wacli send file --to 1234567890 --file /tmp/abc123 --filename report.pdf

管理群组

pnpm wacli groups list pnpm wacli groups rename --jid 123456789@g.us --name "新名称" ```

技术细节

  • 存储:默认 ~/.wacli 目录
  • 环境变量:
    • WACLI_DEVICE_LABEL:设置设备标签
    • WACLI_DEVICE_PLATFORM:覆盖设备平台(默认为 CHROME)

历史消息补充说明

wacli sync 仅同步 WhatsApp Web 发送的数据。要获取更早的历史消息,需要向主设备(手机)发送同步请求。

注意事项: - 这是尽力而为的操作,WhatsApp 可能不会返回完整历史 - 主设备必须在线 - 请求是按聊天(DM 或群组)进行的 - 推荐每次请求 --count 50

项目信息

  • 许可证:见 LICENSE 文件
  • 官网:wacli.sh
  • 相关技术:Go, CLI, WhatsApp

项目目前获得 1.1k stars,有 177 个 forks 和 13 位 watchers。最新版本为 v0.6.0 (发布于 2026年4月14日)。

评论总结

以下是评论内容的总结:

  1. 对WhatsMeow的积极评价

    • 认为这是一个急需的集成工具,赞赏开发者Peter仍在推出工具。
    • 引用评论1:"This is such a sorely needed point of integration. Cool to see Peter still shipping tools."
    • 引用评论3:"The offline search with FTS5 is really nice... Being able to just grep through everything locally would be a huge upgrade."
  2. 对Telegram的偏好

    • 部分用户更倾向于使用Telegram,认为其机器人功能更易用且免费。
    • 引用评论2:"I just use telegram... It's all working reasonably well for me, this makes your life so much better."
    • 引用评论15:"Relative to Whatsapp and Slack, Matrix is stupidly easy to integrate... Refreshingly easy."
  3. 对WhatsApp第三方客户端的风险警告

    • 多位用户提到使用非官方客户端可能导致账号被封禁,风险较高。
    • 引用评论5:"I got banned for just logging in with a third-party client... that's a big risk."
    • 引用评论6:"Beware that if this does not use a real web browser then it's likely to get your whatsapp account suspended."
  4. 对AI和机器人的担忧

    • 担心AI代理滥用WhatsApp可能导致大量机器人消息。
    • 引用评论7:"If AI agents can proficiently use whatsapp I would assume that two-thirds of the people chatting with me are actually just bots."
    • 引用评论15:"I want to get rid of any kind of friction around bot related plumbing."
  5. 对CLI工具的兴趣

    • 部分用户对CLI工具在现实平台(如WhatsApp)中的应用表示兴趣。
    • 引用评论12:"It's fascinating because I rarely open my laptop now... Who are these people using the cli?"
    • 引用评论15:"But now I want a Matrix cli that can do admin, message sending, and all the rest."
  6. 对欧盟立法的疑问

    • 有用户质疑WhatsApp是否因欧盟新法规必须支持互操作性。
    • 引用评论16:"Doesn't Whatsapp have to be interoperable now (at least in the EU due to new legislation)?"
  7. 负面情绪

    • 个别用户对开发者或工具表示不喜欢。
    • 引用评论4:"for some reason, I don't like this guy."

总结:评论中既有对WhatsMeow的期待和赞赏,也有对第三方客户端风险的担忧,同时Telegram和Matrix等替代平台的支持者表达了对其易用性和开放性的偏好。AI和机器人的潜在影响以及CLI工具的实用性也是讨论的焦点。