Help us shape the future of Go! Take the 2026 Go Developer Survey

wa-cli

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 1 Imported by: 0

README

wa-cli

A WhatsApp client for your terminal, built in Go on top of whatsmeow.

Status: v1.0.0 — stable and cross-platform, with a couple of documented known limitations rather than zero known bugs; see ROADMAP.md for exactly what's done and what's known to still need work.

Docs: browse this repo's docs as a site at codebyoketch.github.io/wa-cli, or generated API docs at pkg.go.dev/github.com/codebyoketch/wa-cli.

Why

Scriptable, fast, terminal-first WhatsApp: send and receive messages, manage chats/contacts/groups/media, all from the command line — with --json output for scripting and automation, and a full-screen TUI (wa, no subcommand) for everyday use.

Install

Prebuilt binaries (Linux/macOS/Windows, amd64/arm64) are on the Releases page. Download the archive for your platform, extract it, and put the wa binary somewhere on your PATH.

# Homebrew (macOS/Linux)
brew install codebyoketch/tap/wa-cli

# Scoop (Windows)
scoop bucket add wa-cli https://github.com/codebyoketch/scoop-bucket
scoop install wa-cli

# Docker
docker run -it -v wa-data:/data ghcr.io/codebyoketch/wa-cli:latest login

Homebrew on Linux: if you don't already have brew, it isn't preinstalled — get it from brew.sh first (/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"). The installer prints a "Next steps" section with a PATH line you need to run before brew works in your current shell — usually eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv bash)", added to ~/.bashrc (or your shell's equivalent) so it persists across terminals. It also asks for build-essential and bubblewrap via apt, needed to install some formulae on Linux.

Or with Go 1.25+ installed:

go install github.com/codebyoketch/wa-cli@latest

Or build from source:

git clone https://github.com/codebyoketch/wa-cli.git
cd wa-cli
make build   # binary at ./bin/wa

For quick local iteration without a build step, use go run . in place of wa anywhere below.

Getting started

wa login              # scan the QR code with WhatsApp on your phone
wa status             # confirm you're logged in
wa chat list           # sync and list your chats

Run wa with no subcommand to open the full-screen terminal UI instead of using individual commands.

Usage

Chats

wa chat list [--no-sync]        # list chats, most recent first
wa chat search <query>          # search chats by name
wa chat info <jid-or-name>      # details for one chat
wa chat open <jid-or-name>      # show local message history
wa chat send <recipient> <message...>
wa chat reply <recipient> <message-ref> <message...>
wa chat forward <from-chat> <message-ref> <to-recipient>
wa chat mute / unmute <chat>    # suppress desktop notifications per chat

Receiving

wa watch                        # long-running: print incoming messages live

Contacts

wa contact list
wa contact search <query>
wa contact info <name-or-jid>

Groups

wa group list
wa group info <name-or-jid>
wa group create <name> <participant...>
wa group add / remove <group> <participant...>

Media

wa media send image/video/audio/document/sticker <recipient> <file>
wa media download <chat> <message-ref> [output-path]
wa media list <chat>            # media messages in a chat's local history

image send/download are verified against a real account; the other media types are implemented but not yet confirmed end-to-end — see Phase 8 in ROADMAP.md.

Config

wa config get [key]             # print all settings, or one
wa config set <key> <value>     # change and save one setting
wa config edit                  # open config.json in $EDITOR
wa config init                  # write out defaults

Extensions

wa extension install <git-url>
wa extension list
wa extension run <name> [-- args...]
wa extension remove <name>

Other

wa status                       # login status
wa version
wa completion bash|zsh|fish|powershell
JSON output

Every list/read command above (chat list/search/info/open, contact list/search/info, group list/info, media list, status, extension list) supports --json for scripting:

wa chat list --json | jq '.[] | .name'

Set it as the default instead of passing the flag every time:

wa config set jsonOutput true
Notifications

Desktop notifications fire from wa watch and the TUI when a new message arrives (not from one-shot commands). Configurable via wa config set:

wa config set notifyEnabled true|false
wa config set notifyGroups true|false        # group chats opt-in separately from DMs
wa config set notifyShowPreview true|false   # include message text in the notification
wa chat mute <chat>                          # suppress notifications for one chat

Development

make build   # compile ./bin/wa
make test    # go test ./...
make lint    # golangci-lint run
make fmt     # gofmt -w .

Roadmap

See ROADMAP.md for the full phase-by-phase plan, what's done, what's in progress, and known issues.

Architecture

See ARCHITECTURE.md for a map of the codebase — package layout and how the pieces fit together.

Examples

See docs/EXAMPLES.md for worked examples: scripting with --json, a daily unread-chats digest, piping wa watch, sending from a script without hitting an interactive prompt, exporting chat history, and writing a minimal extension.

Contributing

See CONTRIBUTING.md.

Security

See SECURITY.md for how to report vulnerabilities.

License

MIT

Documentation

Overview

wa-cli is a WhatsApp client for your terminal, built on go.mau.fi/whatsmeow. It links as a WhatsApp Web device (no browser needed) and gives you chats, contacts, groups, and media send/receive from the command line — plus a split-pane TUI (run wa with no subcommand), --json output for scripting, and a plugin system (wa extension).

See README.md for installation and a full command list, ARCHITECTURE.md for how the pieces fit together, and docs/EXAMPLES.md for worked scripting examples. The actual command implementations live in the cmd package; this file just wires up Cobra's entrypoint.

Directories

Path Synopsis
Package cmd implements wa-cli's Cobra command tree: one file per command or command group (chat.go, contact.go, group.go, media.go, config.go, extension.go, completion.go, login.go, logout.go, status.go, send.go/reply.go/forward.go, watch.go, version.go), each self-registering onto rootCmd from its own init().
Package cmd implements wa-cli's Cobra command tree: one file per command or command group (chat.go, contact.go, group.go, media.go, config.go, extension.go, completion.go, login.go, logout.go, status.go, send.go/reply.go/forward.go, watch.go, version.go), each self-registering onto rootCmd from its own init().
internal
app
Package app wires together wa-cli's shared dependencies (config, logger).
Package app wires together wa-cli's shared dependencies (config, logger).
chatstore
Package chatstore persists a local index of WhatsApp chats (JID, name, last message preview/time, unread count) so `wa chat` commands have something to read across separate CLI invocations, without needing an always-on connection.
Package chatstore persists a local index of WhatsApp chats (JID, name, last message preview/time, unread count) so `wa chat` commands have something to read across separate CLI invocations, without needing an always-on connection.
cli
Package cli is a small, dependency-free command router that mimics the parts of Cobra's UX wa-cli needs (Use/Short/Long, --help, subcommands).
Package cli is a small, dependency-free command router that mimics the parts of Cobra's UX wa-cli needs (Use/Short/Long, --help, subcommands).
config
Package config loads and saves wa-cli's user configuration.
Package config loads and saves wa-cli's user configuration.
errors
Package errors provides wa-cli's shared error types and sentinels.
Package errors provides wa-cli's shared error types and sentinels.
extension
Package extension implements wa-cli's plugin system.
Package extension implements wa-cli's plugin system.
logger
Package logger configures wa-cli's structured logger.
Package logger configures wa-cli's structured logger.
msgstore
Package msgstore persists a rolling window of recent messages per chat, so `wa chat open` can show numbered history and `wa chat reply`/ `wa chat forward` can reference a specific message by that number or by its raw WhatsApp message ID.
Package msgstore persists a rolling window of recent messages per chat, so `wa chat open` can show numbered history and `wa chat reply`/ `wa chat forward` can reference a specific message by that number or by its raw WhatsApp message ID.
notify
Package notify sends OS desktop notifications for incoming WhatsApp messages.
Package notify sends OS desktop notifications for incoming WhatsApp messages.
qr
Package qr renders WhatsApp pairing codes as ASCII QR codes for the terminal.
Package qr renders WhatsApp pairing codes as ASCII QR codes for the terminal.
ratelimit
Package ratelimit enforces send-rate limits for wa-cli, persisted to disk so the limits hold across separate CLI invocations (each `wa` run is a short-lived process, so an in-memory-only limiter would reset every time).
Package ratelimit enforces send-rate limits for wa-cli, persisted to disk so the limits hold across separate CLI invocations (each `wa` run is a short-lived process, so an in-memory-only limiter would reset every time).
safety
Package safety provides lightweight guardrails around outbound sending so wa-cli behaves like a normal personal WhatsApp client rather than a bulk-messaging tool.
Package safety provides lightweight guardrails around outbound sending so wa-cli behaves like a normal personal WhatsApp client rather than a bulk-messaging tool.
store
Package store manages wa-cli's local WhatsApp session/device data, backed by whatsmeow's SQLite device store.
Package store manages wa-cli's local WhatsApp session/device data, backed by whatsmeow's SQLite device store.
tui
Package tui implements wa-cli's full-screen terminal interface, launched by running `wa` with no subcommand.
Package tui implements wa-cli's full-screen terminal interface, launched by running `wa` with no subcommand.
version
Package version exposes build-time metadata for wa-cli.
Package version exposes build-time metadata for wa-cli.
whatsapp
Package whatsapp wraps go.mau.fi/whatsmeow with a smaller, wa-cli-shaped API (Client.ListChats, SendImage, GroupInfo, and so on) rather than leaking whatsmeow's types everywhere.
Package whatsapp wraps go.mau.fi/whatsmeow with a smaller, wa-cli-shaped API (Client.ListChats, SendImage, GroupInfo, and so on) rather than leaking whatsmeow's types everywhere.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL