waidrop-cli
Query the WhatsApp archive written by the WAiDrop Chrome extension into a Dropbox App Folder. Fetch messages for one or more conversations — by phone number, contact name (wildcards supported), chat hash or JID — over a date- or hour-precise window.
The CLI talks only to Dropbox and runs entirely locally. It decrypts encrypted archives with your archive key; no server is involved.
Companion extension: the WAiDrop Chrome extension is required to create the archive. The store link will be added here.
Requirements
- Python ≥ 3.10.
- An encrypted WhatsApp archive created by the WAiDrop Chrome extension.
- The archive key generated by the extension.
- A Dropbox account connected to the same Dropbox app. The built-in app key is used by default.
On Windows, the tzdata package is installed automatically so --tz can use
IANA timezones.
Install
pip install waidrop-cli
Other installers:
uv tool install waidrop-cli
pipx install waidrop-cli
From source:
git clone https://github.com/thabiger/waidrop-cli.git
cd waidrop-cli
uv sync
uv run waidrop --help
Upgrade or remove:
pip install --upgrade waidrop-cli
uv tool upgrade waidrop-cli
pip uninstall waidrop-cli
uv tool uninstall waidrop-cli
Dropbox setup
The CLI uses OAuth 2.0 with PKCE and the same Dropbox app as the Chrome extension, so both see the same App Folder. The built-in app key is a public client id; no client secret is involved for the built-in app. Each user authorizes once and the CLI stores a long-lived refresh token locally.
Connect the CLI
waidrop auth
This opens a browser (or prints a URL), asks you to click Allow on Dropbox,
and prompts for the authorization code. Credentials are stored at
~/.config/waidrop/credentials.json (file mode 0600, directory 0700).
On Windows the default is %APPDATA%\waidrop\credentials.json.
On headless hosts or over SSH:
waidrop auth --no-browser # print URL only
waidrop auth --code <CODE> # non-interactive (pass the code)
waidrop auth --loopback # localhost callback (desktop)
For --loopback, register http://127.0.0.1:53682/callback as a redirect URI
in the Dropbox App Console. The paste flow needs no redirect URI.
Check or remove the connection:
waidrop auth --status # human-readable
waidrop auth --status --json # machine-readable
waidrop auth --revoke # revoke remote access + delete local credentials
auth --revoke only deletes local credentials after a successful remote
revoke. If Dropbox cannot be reached, the local credentials are kept and the
command exits with code 5.
Custom Dropbox apps
The built-in app key is ydtsl7okrf4xuee. To use your own app, create a
Scoped access app with App folder access in the
Dropbox App Console, enable and
submit these permissions:
account_info.read(account display)files.metadata.read(list folders/files)files.content.read(downloads; used by this CLI)files.content.write(uploads + folder creation; used by the extension)
Use PKCE; never ship a client secret. Set the app key with
--dropbox-app-key or WAIDROP_DROPBOX_APP_KEY.
Production note: Dropbox apps in development mode are limited to test users, and some scopes require review. Verify the app status and scopes before announcing the CLI publicly.
Old archives: a Dropbox App Folder is namespaced per app. If your archive was created with a different app key, pass
--dropbox-app-key <old-key>or setWAIDROP_DROPBOX_APP_KEYso the CLI looks in the matching folder.
Archive format
The CLI reads account=<alias>/_format.json before fetching data. Only
encrypted archives are supported:
- encrypted — objects use
.encenvelopes and keyed HMAC path hashes.--key/WAIDROP_KEYis required. - legacy v2 — an archive without
_format.jsonis treated as encrypted and still requires a key.
Plaintext archives are not supported. An archive whose _format.json declares
"mode": "plaintext" is rejected with a clear error.
Configuration
Flags override environment, which overrides the credentials file.
| Setting | Flag | Env | Default |
|---|---|---|---|
| Dropbox access token | --dropbox-token |
WAIDROP_DROPBOX_TOKEN |
credentials file |
| Dropbox refresh token | --dropbox-refresh-token |
WAIDROP_DROPBOX_REFRESH_TOKEN |
credentials file |
| Dropbox app key | --dropbox-app-key |
WAIDROP_DROPBOX_APP_KEY |
built-in / credentials file |
| Dropbox app secret | --dropbox-app-secret |
WAIDROP_DROPBOX_APP_SECRET |
— (not needed for built-in) |
| credentials file | --credentials-file |
WAIDROP_CREDENTIALS |
~/.config/waidrop/credentials.json |
| archive encryption key | --key |
WAIDROP_KEY |
required |
| account alias | --account |
WAIDROP_ACCOUNT |
primary |
| subfolder in app folder | --folder |
WAIDROP_FOLDER |
app-folder root |
| timezone for bounds | --tz |
— | system local |
| HTTP timeout (s) | --timeout |
— | 60 |
| part guard | --max-parts |
— | 1000 |
An explicit access or refresh token (flag/env) disables the credentials file so secrets injected by a host are never overwritten. The archive key is the base64 32-byte key generated by the extension. It is required; without it the archive cannot be decrypted.
Prefer environment variables or the credentials file over command-line secrets:
--dropbox-token, --key and --code can appear in shell history and process
listings.
Usage
# store the archive key and account for MCP and headless use
waidrop config
# list chats (no messages fetched): names, phones, hashes, jids
waidrop chats
waidrop chats --name "*Family*"
# by contact name (glob/substring, case-insensitive) for a date range
waidrop query --name "Alice*" --from 2026-10-01 --to 2026-10-17
# by phone number (any format) for an hour-precise window
waidrop query --number "+1 555 0100" --from "2026-10-17 08:00" --to "2026-10-17 18:00"
# rolling window
waidrop query --name "Alice*" --last 36h
waidrop query --name "Alice*" --last 7d --format text
# all chats, recent window (no selectors)
waidrop query --last 1h
waidrop query --from "2026-10-17 08:00" --to "2026-10-17 18:00" --format csv
# export full-resolution images/stickers/GIFs plus manifest.ndjson
waidrop query --name "*" --last 24h --media-out ./waidrop-media
# multiple selectors / formats / output file
waidrop query --name "Alice*" --name "*Family*" --number +15550100 \
--from 2026-10-01 --to 2026-10-17 --format csv --out october.csv
# direct targeting
waidrop query --chat 0123456789abcdef --jid 15550100@c.us --last 2w
# per-chat conversation chunks for an analysis window
waidrop context --from 2026-10-01 --to 2026-10-17 --format text
waidrop context --name "Alice*" --last 6h --context-before 30m \
--max-chars 12000 --format text
# context chunks plus exported images/stickers/GIFs and their local paths
waidrop context --last 6h --media-out ./waidrop-media --format text
Bounds
--from / --to accept, in local time (or --tz):
| Input | Meaning |
|---|---|
2026-10-01 |
date precision: from = 00:00; to includes the whole day |
2026-10-01T14 |
hour precision: to includes 14:00–14:59:59.999 |
2026-10-01T14:30 |
minute precision: to includes 14:30–14:30:59.999 |
2026-10-01T14:30:45 |
second precision |
--from is required unless --last is used. --to defaults to now.
--last accepts m (minutes), h (hours), d (days), w (weeks) and cannot be
combined with --from/--to.
With no selectors, query and context cover all chats (e.g.
--last 1h). Chats whose firstSeen/lastSeen cannot overlap the window are
skipped, and only part objects whose [firstTs, lastTs] interval can overlap
the window are downloaded (legacy parts without lastTs use a start-anchor
heuristic). --max-parts still caps the selected parts. --context-before
expands the fetched window and therefore counts toward --max-parts.
Output
--format ndjson(default): archive records, one JSON object per line.--format text:2026-10-17 12:00 ← Alice / Alice: message…--format csv:msgId,ts,chatName,chatPhone,senderName,direction,type,text--out FILEwrites to a file with mode0600; progress goes to stderr (--quietsilences it).--media-out DIRdownloads and decodes (or decrypts) full-resolution media referenced by the selected records intoDIR, plusDIR/manifest.ndjson(override with--media-manifest). Files are written0600, directory0700, and names are derived from the timestamp and message id only.--media-max-bytes(default 25 MiB) skips larger objects;--media-fail-fastaborts on the first decode/download error. Media records whose status is notstoredare reported as skipped.
Text output escapes control characters. CSV output prefixes cells that start
with =, +, -, @, tab or carriage return with ' to reduce spreadsheet
formula injection. CSV files still contain untrusted chat data; open them with
care.
Context output
context returns conversation-oriented chunks instead of flat records:
--format ndjson(default): one JSON object per chat chunk, withchat,window,part/parts,contextBeforeMs,oversizedand the full message records (inWindowmarks messages inside the analysis window).--format text: delimited per-chat blocks with=== CHAT … ===/=== END CHAT (i/n) ===; newlines inside messages are escaped as\n.--context-before DURATIONincludes earlier messages as context (default0). Those messages appear in the chunk but are markedinWindow: falseand[context]in text output.--max-chars Nsplits a chat intopart i/nat message boundaries when its rendered message lines exceedNcharacters (default0= one chunk per chat); headers/footers are not counted. A single oversized message is kept whole in its own part and flaggedoversized: true.--media-out DIRdecodes or decrypts full-resolution images, stickers and GIFs referenced by the emitted chunks intoDIRand adds amediaExportobject to each NDJSON media message:{ "status": "exported", "file": "/abs/path/...jpg", "error": null }. Paths are absolute. Text output appends(file: "…")for exported media and(media: <status>)or(media: not exported)otherwise. The manifest defaults toDIR/manifest.ndjson;--media-max-bytesand--media-fail-fastbehave likequery. Media from--context-beforemessages is included.- Chats with no messages inside the analysis window are omitted, even if they have context-only messages.
Exit codes: 0 ok, 2 usage/config error, 3 no matched chats / no messages in
window, 4 --max-parts guard tripped, 5 Dropbox/network/archive read error.
Running on a headless host
The CLI auto-refreshes access tokens from the stored refresh token, so no manual
rotation is needed. Run waidrop auth once on the host (or copy the
credentials file). Then store the archive key in the environment file:
waidrop config
It prompts for the key without echoing it, then for the account alias. On a
rerun, values already in the env file are offered as defaults: press Enter to
keep the existing key (shown as [keep existing], never printed) or the
existing alias. It writes ~/.config/waidrop/env with mode 0600 (directory
0700). Use --account work to set a non-primary alias, --env-file PATH for
a custom location, or set WAIDROP_KEY / WAIDROP_ACCOUNT to skip the
corresponding prompt. The file contains:
# ~/.config/waidrop/env (must be 0600)
WAIDROP_KEY=<base64 archive key from the extension>
WAIDROP_ACCOUNT=primary
On Windows the default is %APPDATA%\waidrop\env. On macOS and Linux the file
must not be readable or writable by group or others; the CLI and MCP server
reject insecure files and read only WAIDROP_* keys. chats, query, and
context load the file automatically, so nothing needs to be exported in your
shell; explicit flags and shell environment variables take precedence. The file
next to a custom --credentials-file is used when one is passed.
A cron or agent wrapper can still source the file (set -a; . ~/.config/waidrop/env; set +a) before running other tools:
waidrop context --last 6h --context-before 30m --max-chars 12000 --format text
Health check:
waidrop auth --status --json # exit 0 = ok, 2 = missing scopes
If the refresh token is ever revoked, re-run waidrop auth on the host.
Rotate the archive key only with a re-encryption plan (key loss means unreadable
history). Never put access tokens in env files or cron lines; the credentials
file handles them.
MCP server (optional)
Install waidrop-cli[mcp] to expose a local, read-only MCP stdio server:
pip install "waidrop-cli[mcp]"
waidrop-mcp --print-setup
The server exposes list_chats and get_context, backed by the same archive
reader as the CLI. It works with any MCP-compatible client and does not contact
an AI service; selected text is returned only to the connected client. See
docs/mcp.md.
Security and privacy
- The CLI never uploads archive content and has no telemetry. Archives are decrypted in memory.
- The optional MCP server is also local and read-only. It returns selected archive text to the connected MCP client over stdio; it does not send content to any AI service itself. A cloud-backed client may transmit that data.
- Dropbox credentials are stored in
~/.config/waidrop/credentials.json(0600; parent0700). The refresh token grants access to the archive, so protect the file. - Output files (
--out,--media-out, manifests) are written with private permissions. Remove them when they are no longer needed. waidrop auth --revokerevokes Dropbox access and removes local credentials. If the remote revoke fails, local credentials are kept.- Text output escapes terminal control characters. CSV output reduces spreadsheet formula injection but remains untrusted data.
- Report vulnerabilities using the process in SECURITY.md.
Disclaimer: this project is not affiliated with WhatsApp or Meta. Use it only for conversations you are authorized to access. Archiving may violate WhatsApp's Terms of Service; use at your own risk. The software is provided without warranty under the Apache-2.0 license.
Troubleshooting
missing_scope: enable the listed scope in the Dropbox App Console → Permissions → Submit, then re-authorize. Existing tokens do not gain scopes.invalid_access_token: token revoked/expired; re-authorize withwaidrop auth.chat index could not be decrypted/cannot decrypt …: wrong archive key for the archive.plaintext archives are no longer supported: re-export the archive with encryption enabled.archive is encrypted; encryption key required: provide--keyorWAIDROP_KEY.archive format marker is invalid/unsupported archive format: verify_format.jsonor updatewaidrop-cli.chat directory is empty: nothing has been uploaded yet (connect the extension and upload once).- No chats found: if the archive was created with a different Dropbox app
key, pass
--dropbox-app-key <old-key>. - Dates look shifted by a day:
dt=is the capturing browser's local date; the CLI pads ±1 day and filters by exactts, so this is handled automatically — ensure--tzmatches how you want bounds interpreted.
Limitations
- LID chats (
@lid) have no phone number in the jid; number search works only when the archive recoveredchatPhone. Otherwise select by name. - Phone formats should include the country code; digits are compared.
- Names are snapshots inside message records;
chatsshows the latest name from the archive index. - DOM-only records with no
chatIdare grouped bychatNameincontextoutput. Duplicate names cannot be mapped reliably, so they remain separate name-only chats withhash: null. - Only
storedmedia can be exported.context --media-outreportsnot_downloaded,pending,view_once,too_largeand failed records as media messages without files. Capture is passive by default: only media WhatsApp already downloaded is stored;not_downloadedrecords have only the preview. Video, audio and documents remain metadata/placeholders. Records written before media capture cannot be backfilled from the archive. - Exported media files are unencrypted.
context --media-outwrites full-resolution files toDIR; keep it private (files are0600, directory0700) and remove it after analysis if it is no longer needed.
Development
uv sync
uv run pytest -q # MCP server tests skip without the extra
uv sync --extra mcp
uv run pytest -q # includes the MCP server tests
uv run ruff check .
uv run ruff format --check .
uv build
uvx twine check dist/*
Tests run against a local fake Dropbox server (stdlib http.server) with
encrypted fixtures and the shared cross-language crypto vector. No Dropbox
account is needed.
The crypto contract is shared with the extension. Do not change the envelope magic, version bytes, HKDF salt, or key derivation without updating both projects.
Release
See RELEASING.md.
Contributing
See CONTRIBUTING.md.
Changelog
See CHANGELOG.md.
License
Metadata
Release files for waidrop-cli 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| waidrop_cli-1.0.0.tar.gz | 157.8 kB | With provenance | Details for waidrop_cli-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| waidrop_cli-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for waidrop_cli-1.0.0-py3-none-any.whl |
Total release size: 215.0 kB
Release files / waidrop_cli-1.0.0.tar.gz
| Download URL | waidrop_cli-1.0.0.tar.gz |
|---|---|
| Size | 157.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
933ead70af8554f89575aba6b9a490208758b868534ad699d8863b7549209f63
|
|
BLAKE2b-256 checksum How to use checksums |
449ad2d281926072d5467c2c0717fcc14716e1169cc5db286133dda956f5fda9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logRelease files / waidrop_cli-1.0.0-py3-none-any.whl
| Download URL | waidrop_cli-1.0.0-py3-none-any.whl |
|---|---|
| Size | 57.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3123c3b5057f74e938e639e5e4e630575127cfe20f1138b8fbb5c7984df54c0a
|
|
BLAKE2b-256 checksum How to use checksums |
d5a7d3a51b9fffad6e675037e58b18b7318cf2753324f553ff1b853938038db0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logSecurity for waidrop-cli 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for waidrop_cli-1.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.