Peter Steinberger – WhatsApp CLI: 동기화, 검색, 전송
Source: Hacker News
wacli — WhatsApp CLI: sync, search, send
WhatsApp CLI는 whatsmeow 위에 구축되었으며 다음에 중점을 둡니다:
- 메시지 기록의 최선의 노력 로컬 동기화 + 지속적인 캡처
- 빠른 오프라인 검색
- 메시지 전송
- 연락처 및 그룹 관리
이 도구는 whatsmeow를 통해 WhatsApp Web 프로토콜을 사용하는 제3자 도구이며 WhatsApp과 제휴되지 않았습니다.
Status
핵심 구현이 완료되었습니다. 전체 설계 노트는 docs/spec.md를 참고하세요.
Recent updates (0.2.0)
- Messages: 검색/목록에 반응, 답장, 미디어 유형에 대한 표시 텍스트가 포함됩니다.
- Send:
wacli send file --filename옵션으로 표시 이름을 재정의할 수 있습니다. - Auth: 선택적
WACLI_DEVICE_LABEL/WACLI_DEVICE_PLATFORM환경 변수 오버라이드.
Install / Build
Option A: Install via Homebrew (tap)
brew install steipete/tap/wacli
Option B: Build locally
go build -tags sqlite_fts5 -o ./dist/wacli ./cmd/wacli
Run (local build only):
./dist/wacli --help
Quick start
기본 저장소 디렉터리는 ~/.wacli이며 --store DIR 옵션으로 재정의할 수 있습니다.
1) Authenticate (shows QR), then bootstrap sync
pnpm wacli auth
# or, after a local build:
./dist/wacli auth
2) Keep syncing (never shows QR; requires prior auth)
pnpm wacli sync --follow
Diagnostics
pnpm wacli doctor
Sending messages
Send a text message
pnpm wacli send text --to 1234567890 --message "hello"
Send a file
pnpm wacli send file --to 1234567890 --file ./pic.jpg --caption "hi"
# Override display name
pnpm wacli send file --to 1234567890 --file /tmp/abc123 --filename report.pdf
Group management
pnpm wacli groups list
pnpm wacli groups rename --jid 123456789@g.us --name "New name"
Searching messages
pnpm wacli messages search "meeting"
History backfill
채팅의 오래된 메시지를 백필(최선의 노력; 기본 기기가 온라인이어야 함):
pnpm wacli history backfill --chat 1234567890@s.whatsapp.net --requests 10 --count 50
Media download
동기화 후 메시지의 미디어를 다운로드:
pnpm wacli media download --chat 1234567890@s.whatsapp.net --id
Prior Art / Credit
이 프로젝트는 Vicente Reig의 훌륭한 whatsapp-cli에 크게 영감을 받았습니다.
High‑level UX
wacli auth: 인터랙티브 로그인(QR 코드 표시) 후 즉시 초기 데이터 동기화를 수행합니다.wacli sync: 비인터랙티브 동기화 루프(QR 코드를 표시하지 않으며, 인증되지 않으면 오류 발생).- 출력은 기본적으로 사람이 읽기 쉬운 형태이며, 기계가 읽을 수 있는 JSON이 필요하면
--json을 전달합니다.
Storage
기본값은 ~/.wacli이며 --store DIR 옵션으로 재정의할 수 있습니다.
Environment overrides
WACLI_DEVICE_LABEL: WhatsApp에 표시되는 연결된 기기 라벨을 설정합니다.WACLI_DEVICE_PLATFORM: 연결된 기기 플랫폼을 오버라이드합니다(설정되지 않았거나 잘못된 경우 기본값은CHROME).
Backfilling older history
wacli sync는 WhatsApp Web이 제공하는 데이터를 기회적으로 저장합니다. 기본 기기(휴대폰)에서 오래된 메시지를 가져오려면 온‑디맨드 히스토리 동기화 요청을 사용합니다.
Important notes
- 이는 최선의 노력이며, WhatsApp이 전체 기록을 반환하지 않을 수 있습니다.
- 기본 기기가 온라인이어야 합니다.
- 요청은 채팅당(1:1 대화 또는 그룹) 이루어집니다.
wacli는 해당 채팅에서 가장 오래된 로컬 메시지를 기준점으로 사용합니다. - 권장
--count값은 요청당50입니다.
Backfill one chat
pnpm wacli history backfill --chat 1234567890@s.whatsapp.net --requests 10 --count 50
Backfill all chats (script)
pnpm -s wacli -- --json chats list --limit 100000 \
| jq -r '.[].JID' \
| while read -r jid; do
pnpm -s wacli -- history backfill --chat "$jid" --requests 3 --count 50
done
License
See LICENSE.