whatsapp-wacli-mac
Skill42 starsChanged 8 days agoMITView on GitHub
Use wacli (WhatsApp CLI) to sync, search, send messages, manage contacts/groups, and backfill chat history. REQUIRES AUTHENTICATION FIRST. macOS ARM64 binary.
- Deletes or force-pushes
- Installs packages
In this repository29 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- app-creatorSkill
- bento-slidesSkill
- brochure-designerSkill
- business-card-readerSkill
- claude-designerSkill
- codebase-to-courseSkill
- daily-briefingSkill
- diagram-designSkill
- fable-modeSkill
- ffmpeg-video-processingSkill
- frontend-designSkill
- gamma-presenterSkill
- gitSkill
- hotel-finderSkill
- humanizerSkill
- in-depth-researchSkill
- jclaw-apiSkill
- jira-operationsSkill
- powerpoint-pptxSkill
- research-paper-writer-proSkill
- restaurant-recommenderSkill
- skill-creatorSkill
- ui-ux-pro-maxSkill
- visual-explainerSkill
- whatsapp-wacli-linuxSkill
- writing-standardsSkill
- youtube-transcriptSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 33
Always use this path when invoking commands.
- Very specific: line 45
If it prints needs install, build or install it using one of the methods below, then proceed.
- Very specific: line 80
Use ./skills/whatsapp-wacli-mac/tools/wacli chats list or contacts search to find JIDs.
- Distinctive: line 90
Before executing any wacli command, follow this logic:
- Very specific: line 94
If command fails with auth error: Remove the marker file (rm -f ./skills/whatsapp-wacli-mac/.authenticated) and go to Step 2
- Very specific: line 96
If
.authenticateddoes NOT exist: Check auth status via wacli - Distinctive: line 100
If status shows authenticated: Create marker file and execute command
- Distinctive: line 107
Full authentication flow: Run interactive auth and create marker on success
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Commands
| Command | Description |
auth | Authenticate, check status, logout |
send | Send text messages or files |
messages | List, search, show, and get context around messages |
chats | List and search chats |
contacts | Search, show, and alias contacts |
groups | List, info, rename, join, leave, and manage group invites/participants |
sync | One-time or continuous sync with WhatsApp |
history | Backfill older messages from the primary device |
media | Download media from messages |
doctor | Run diagnostics |
WhatsApp wacli Skill
Binary location: ./skills/whatsapp-wacli-mac/tools/wacli
Always use this path when invoking commands.
Bootstrap (First-time setup)
Before running any wacli command, check whether the binary is present:
test -x ./skills/whatsapp-wacli-mac/tools/wacli && echo "ready" || echo "needs install"If it prints needs install, build or install it using one of the methods below, then proceed.
Option A: Homebrew (recommended — no Go toolchain required)
brew install steipete/tap/wacli
cp "$(brew --prefix)/bin/wacli" ./skills/whatsapp-wacli-mac/tools/wacli
chmod +x ./skills/whatsapp-wacli-mac/tools/wacliOption B: Build from source (requires Go 1.25+ with CGO enabled)
git clone --depth 1 https://github.com/steipete/wacli /tmp/wacli-src \
&& cd /tmp/wacli-src \
&& CGO_ENABLED=1 go build -tags sqlite_fts5 -o /tmp/wacli-bin ./cmd/wacli \
&& cp /tmp/wacli-bin ./skills/whatsapp-wacli-mac/tools/wacli \
&& chmod +x ./skills/whatsapp-wacli-mac/tools/wacli \
&& rm -rf /tmp/wacli-src /tmp/wacli-binNote: builds natively for the current architecture (darwin/arm64 on Apple Silicon).
Once the binary is present, proceed to Authentication below.
CRITICAL: Phone Number Format
Phone numbers must be digits only with country code, without the + prefix:
- Correct:
[PHONE_NUMBER] - Wrong:
+[PHONE_NUMBER](causes timeout/resolution errors)
For groups, use JID format: [PHONE_NUMBER]@g.us
Use ./skills/whatsapp-wacli-mac/tools/wacli chats list or contacts search to find JIDs.
Authentication Flow
The skill uses a .authenticated marker file in the skill directory (./skills/whatsapp-wacli-mac/.authenticated) to track authentication state and optimize subsequent calls.
Authentication Decision Flow
Before executing any wacli command, follow this logic:
- Check for
.authenticatedmarker (test -f ./skills/whatsapp-wacli-mac/.authenticated)- If EXISTS: Proceed directly to execute the requested command
- If command fails with auth error: Remove the marker file (
rm -f ./skills/whatsapp-wacli-mac/.authenticated) and go to Step 2
- If
.authenticateddoes NOT exist: Check auth status via wacli./skills/whatsapp-wacli-mac/tools/wacli auth status- If status shows authenticated: Create marker file and execute command
touch ./skills/whatsapp-wacli-mac/.authenticated # then execute requested command - If status shows NOT authenticated: Go to Step 3
- If status shows authenticated: Create marker file and execute command
- Full authentication flow: Run interactive auth and create marker on success
./skills/whatsapp-wacli-mac/tools/wacli auth # User scans QR code... # On success: touch ./skills/whatsapp-wacli-mac/.authenticated
Complete Auth Logic Example
# Step 1: Check if .authenticated marker exists
result = exec({"command": "test -f ./skills/whatsapp-wacli-mac/.authenticated && echo 'marker_exists' || echo 'no_marker'"})
if result contains 'marker_exists':
# Proceed with command
result = exec({"command": "./skills/whatsapp-wacli-mac/tools/wacli <REQUESTED_COMMAND>"})
# If command fails due to auth issues
if result contains 'unauthorized' or 'not authenticated':
exec({"command": "rm -f ./skills/whatsapp-wacli-mac/.authenticated"})
# Fall through to check status
else:
# Command succeeded, return result
return result
# Step 2: Check actual auth status
status = exec({"command": "./skills/whatsapp-wacli-mac/tools/wacli auth status --json"})
if status contains '"status": "authenticated"':
# User is already authenticated, create marker and execute
exec({"command": "touch ./skills/whatsapp-wacli-mac/.authenticated"})
result = exec({"command": "./skills/whatsapp-wacli-mac/tools/wacli <REQUESTED_COMMAND>"})
return result
else:
# Step 3: Need to authenticate
print("Please scan the QR code with WhatsApp to authenticate...")
auth_result = exec({"command": "./skills/whatsapp-wacli-mac/tools/wacli auth", "timeout": 120})
# Verify auth succeeded
verify = exec({"command": "./skills/whatsapp-wacli-mac/tools/wacli auth status --json"})
if verify contains '"status": "authenticated"':
exec({"command": "touch ./skills/whatsapp-wacli-mac/.authenticated"})
# Now execute the requested command
result = exec({"command": "./skills/whatsapp-wacli-mac/tools/wacli <REQUESTED_COMMAND>"})
return result
else:
return "Authentication failed. Please try again."Authentication Management
Check auth status:
./skills/whatsapp-wacli-mac/tools/wacli auth statusLogout (also removes .authenticated marker):
./skills/whatsapp-wacli-mac/tools/wacli auth logout && rm -f ./skills/whatsapp-wacli-mac/.authenticatedDiagnostics:
./skills/whatsapp-wacli-mac/tools/wacli doctorSending Messages
Text message
./skills/whatsapp-wacli-mac/tools/wacli send text --to [PHONE_NUMBER] --message "Hello!"File (image/video/audio/document)
./skills/whatsapp-wacli-mac/tools/wacli send file --to [PHONE_NUMBER] --file /path/to/photo.jpgOptional flags:
--caption "Description"— caption for images/videos/documents--filename report.pdf— override the display filename--mime image/jpeg— override auto-detected MIME type
Messages
List messages in a chat
./skills/whatsapp-wacli-mac/tools/wacli messages list --chat [PHONE_NUMBER]@s.whatsapp.net --limit 20Optional: --after 2025-01-01 --before 2025-12-31
Search messages (full-text)
./skills/whatsapp-wacli-mac/tools/wacli messages search "keyword" --limit 20Optional filters:
--chat <JID>— restrict to a specific chat--from <JID>— restrict to a specific sender--after 2025-01-01/--before 2025-12-31— date range--type image|video|audio|document— media type filter
Show a specific message
./skills/whatsapp-wacli-mac/tools/wacli messages show --chat <JID> --id <MESSAGE_ID>Show context around a message
./skills/whatsapp-wacli-mac/tools/wacli messages context --chat <JID> --id <MESSAGE_ID> --before 5 --after 5Chats
List chats
./skills/whatsapp-wacli-mac/tools/wacli chats list --limit 20Search chats by name/number
./skills/whatsapp-wacli-mac/tools/wacli chats list --query "name or number"Show a specific chat
./skills/whatsapp-wacli-mac/tools/wacli chats show --jid [PHONE_NUMBER]@s.whatsapp.netContacts
Search contacts
./skills/whatsapp-wacli-mac/tools/wacli contacts search "name" --limit 20Show a specific contact
./skills/whatsapp-wacli-mac/tools/wacli contacts show --jid [PHONE_NUMBER]@s.whatsapp.netSet a local alias for a contact
./skills/whatsapp-wacli-mac/tools/wacli contacts alias set --jid [PHONE_NUMBER]@s.whatsapp.net --alias "Mom"Remove an alias
./skills/whatsapp-wacli-mac/tools/wacli contacts alias rm --jid [PHONE_NUMBER]@s.whatsapp.netRefresh contacts from session store
./skills/whatsapp-wacli-mac/tools/wacli contacts refreshGroups
List groups
./skills/whatsapp-wacli-mac/tools/wacli groups listRefresh groups (live from WhatsApp)
./skills/whatsapp-wacli-mac/tools/wacli groups refreshGet group info
./skills/whatsapp-wacli-mac/tools/wacli groups info --jid <GROUP_JID>Rename a group
./skills/whatsapp-wacli-mac/tools/wacli groups rename --jid <GROUP_JID> --name "New Name"Join a group by invite code
./skills/whatsapp-wacli-mac/tools/wacli groups join --code <INVITE_CODE>Leave a group
./skills/whatsapp-wacli-mac/tools/wacli groups leave --jid <GROUP_JID>Manage group invite links
./skills/whatsapp-wacli-mac/tools/wacli groups invite --jid <GROUP_JID>Manage group participants
./skills/whatsapp-wacli-mac/tools/wacli groups participants --jid <GROUP_JID>Sync
One-time sync (sync until idle, then exit)
./skills/whatsapp-wacli-mac/tools/wacli sync --onceContinuous sync (keeps running)
./skills/whatsapp-wacli-mac/tools/wacli sync --followOptional flags:
--download-media— download media files during sync--refresh-contacts— refresh contacts from session store--refresh-groups— refresh group list from WhatsApp--idle-exit 30s— exit after idle period (with--once)
History Backfill
Request older messages for a specific chat from the primary device:
./skills/whatsapp-wacli-mac/tools/wacli history backfill --chat <JID> --requests 10 --count 50Flags:
--count 50— messages per request (recommended: 50)--requests 10— number of requests to attempt--wait 1m— time to wait per request for a response--idle-exit 5s— exit after idle
Note: Best-effort. Primary device must be online. WhatsApp may not return full history.
Media
Download media from a message
./skills/whatsapp-wacli-mac/tools/wacli media download --chat <JID> --id <MESSAGE_ID>Optional: --output /path/to/save
Global Flags (available on all commands)
| Flag | Purpose |
--json | Output JSON instead of human-readable text |
--store DIR | Custom store directory (default: ~/.wacli) |
--timeout 5m | Command timeout for non-sync commands |
Environment Variables
| Variable | Purpose |
WACLI_DEVICE_LABEL | Linked device label shown in WhatsApp |
WACLI_DEVICE_PLATFORM | Override device platform (default: CHROME) |
Exec Tool Examples
# Send text (NO + prefix on phone number)
exec({"command": "./skills/whatsapp-wacli-mac/tools/wacli send text --to [PHONE_NUMBER] --message 'Hello!'"})
# Send file
exec({"command": "./skills/whatsapp-wacli-mac/tools/wacli send file --to [PHONE_NUMBER] --file /tmp/report.pdf --caption 'Monthly report'"})
# Search messages (JSON for parsing)
exec({"command": "./skills/whatsapp-wacli-mac/tools/wacli messages search 'invoice' --json"})
# List recent chats
exec({"command": "./skills/whatsapp-wacli-mac/tools/wacli chats list --limit 10"})
# One-time sync
exec({"command": "./skills/whatsapp-wacli-mac/tools/wacli sync --once", "timeout": 60})
# Check auth status
exec({"command": "./skills/whatsapp-wacli-mac/tools/wacli auth status"})Important Notes
- Phone numbers: digits only, no + prefix — e.g.,
[PHONE_NUMBER]not+[PHONE_NUMBER] - Auth flow: The skill follows a three-step authentication flow (marker check → status check → interactive auth) to optimize subsequent calls
.authenticatedmarker file — stored in./skills/whatsapp-wacli-mac/.authenticated; created after successful auth to bypass checks on future calls- Auth failure handling — If a command fails due to auth issues, the marker is automatically removed and the flow restarts
- Primary device must be online — phone needs WhatsApp running for sync/send
- Store lock — only one wacli process can run at a time. If you get a lock error, wait or kill the other process
- Rate limits — respect WhatsApp's sending limits
- Third-party tool — not affiliated with WhatsApp/Meta; uses WhatsApp Web protocol
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

