ASIMOV module for WhatsApp. Data import for WhatsApp account!
- To be determined!
- Rust 1.85+ (2024 edition) if building from source code
Installation with the ASIMOV CLI
asimov module install whatsapp -vcargo install asimov-whatsapp-moduleasimov-whatsapp-authorizer - authorize WhatsApp account via QR code or pair code (phone number).
Check status:
asimov-whatsapp-authorizer --statusReset local DB:
asimov-whatsapp-authorizer --resetAuthorize via QR code:Authorize via QR code:
asimov-whatsapp-authorizerAuthorize via pair code (phone number):
asimov-whatsapp-authorizer --phone 15551234567asimov-whatsapp-cataloger - list all WhatsApp groups and members.
List all groups:
asimov-whatsapp-cataloger wa:groupsList members of a group:
asimov-whatsapp-cataloger wa:group/<GROUP_JID>/membersasimov-whatsapp-fetcher - fetch WhatsApp contacts and groups metadata.
Fetch group metadata:
asimov-whatsapp-fetcher wa:group/<GROUP_JID>Fetch contact by phone number:
asimov-whatsapp-fetcher wa:contact/<PHONE_DIGITS>Fetch contact by JID (LID or phone JID):
asimov-whatsapp-fetcher wa:contact-jid/<JID>asimov-whatsapp-emitter - stream incoming WhatsApp messages to STDOUT as JSONL.
By default emits only inbound (messages sent to you). Use --outbound to also include outbound (messages sent by you).
By default emits a minimal JSON shape for text-like messages only. Use --full to emit the full raw payload.
Examples:
Minimal (inbound only):
asimov-whatsapp-emitter | jq .Minimal + include outbound:
asimov-whatsapp-emitter --outbound | jq .Full payload (message + message_info):
asimov-whatsapp-emitter --full | jq .All scripts read the database path from WA_DB.
export WA_DB="$PWD/whatsapp.db"asimov-whatsapp-authorizerasimov-whatsapp-catalogerasimov-whatsapp-emitterasimov-whatsapp-fetcher
asimov-whatsapp-authorizer
Usage: asimov-whatsapp-authorizer [OPTIONS]
Options:
-d, --debug Enable debugging output
--license Show license information
-v, --verbose... Enable verbose output (may be repeated for more verbosity)
-V, --version Print version information
--db <PATH> Path to the SQLite DB. If omitted, uses WA_DB env var
-p, --phone <PHONE> If set, authorizes via Pair Code (instead of QR)
--timeout <TIMEOUT> Login wait timeout in seconds [default: 180]
--reset Delete the DB file (if it exists) and exit
--status Print DB path + whether it exists, then exit
-h, --help Print help
asimov-whatsapp-cataloger
Usage: asimov-whatsapp-cataloger [OPTIONS] <RESOURCE>
Arguments:
<RESOURCE> Resource URL (e.g. wa:groups, wa:group/<jid>/members)
Options:
-d, --debug Enable debugging output
--license Show license information
-v, --verbose... Enable verbose output (may be repeated for more verbosity)
-V, --version Print version information
--db <PATH> Path to the SQLite DB. If omitted, uses WA_DB env var
-n, --limit <COUNT> Maximum number of items to output
--timeout <TIMEOUT> Connection wait timeout in seconds [default: 30]
-h, --help Print help
asimov-whatsapp-emitter
Usage: asimov-whatsapp-emitter [OPTIONS]
Options:
-d, --debug Enable debugging output
--license Show license information
-v, --verbose... Enable verbose output (may be repeated for more verbosity)
-V, --version Print version information
--db <PATH> Path to the SQLite DB. If omitted, uses WA_DB env var
--full Print full payload (message + message_info) instead of minimal shape
--outbound Include outbound (messages from me). Inbound is always included
--timeout <TIMEOUT> Connection wait timeout in seconds [default: 30]
-h, --help Print help
asimov-whatsapp-fetcher
Usage: asimov-whatsapp-fetcher [OPTIONS] <RESOURCE>
Arguments:
<RESOURCE> Resource URL (e.g. wa:group/<jid>, wa:contact/<digits>, wa:contact-jid/<jid>)
Options:
-d, --debug Enable debugging output
--license Show license information
-v, --verbose... Enable verbose output (may be repeated for more verbosity)
-V, --version Print version information
--db <PATH> Path to the SQLite DB. If omitted, uses WA_DB env var
--timeout <TIMEOUT> Connection wait timeout in seconds [default: 30]
-h, --help Print help
git clone https://github.com/asimov-modules/asimov-whatsapp-module.git