CLI parameters

March 9, 2026 ยท View on GitHub

parametertypedescription
--log-levelstringSet logging level: finest, debug, info (default), error, critical
--batch-sizeintegerConcurrent threads count, default: 5
--auto-batchAutomatically adjust batch size to maximize throughput without hitting rate limits (starts from --batch-size, increases slowly, reduces on rate limit)
--service-account-key-filepathfilepathJSON service account file path, see more Service Account Setup
--service-account-emailstringService account email address
--credentials-filepathstringOAUTH credentials json, see more OAuth setup
--timezonestringTimezone
--workdirstringStorage directory path, default: ./data
--dryDry mode (not modify on server, not modify in local storage)
--oauth-bind-addressstringOAuth bind address, default is 0.0.0.0. See more google_auth_oauthlib.flow
--oauth-portintOAuth port, default is 0 (random). See more google_auth_oauthlib.flow
--oauth-redirect-hoststringOAuth redirect host, default is localhost. See more google_auth_oauthlib.flow
<service>serviceService ID, eg. gmail

service types

Currently only gmail is supported.

gmail service

... gmail <command> ...

backup command

parametertypedescription
--emailstringemail account for backup (REQUIRED, can be specified multiple times for parallel multi-account backup)
--quick-syncQuick sync mode: fetches all message IDs but only downloads new messages and marks deleted ones. Skips re-downloading existing messages. Can be combined with --quick-sync-days.
--quick-sync-daysintQuick syncing mode. The value is number of retroactive days. (It does not delete messages from local storage.) When combined with --quick-sync, checks label/metadata changes for messages within the specified period.

--quick-sync combined with --quick-sync-days: When both flags are used together, the backup fetches the full message list from the server, downloads only new messages (raw format), marks deleted messages, and additionally checks label/metadata changes for existing messages within the last N days (minimal format). Messages older than N days are skipped entirely. This provides a good balance between speed and completeness.

FlagsServer queryDownloadMarks deleted
(none)All messagesNew (raw) + existing (minimal)Yes
--quick-sync-days NLast N daysNew (raw) + existing (minimal)No
--quick-syncAll messagesOnly new (raw)Yes
--quick-sync --quick-sync-days NAll messagesNew (raw) + existing within N days (minimal)Yes

restore command

parametertypedescription
--emailstringemail account for restore (REQUIRED, can be specified multiple times for parallel multi-account restore)
--to-emailstringdestination email account; if not specified, --email is used as the destination (cannot be used with multiple --email accounts)
--restore-deletedRestore deleted message (The message has been marked as deleted in the local storage.)
--restore-missingRestore missing message (The backup has not been run before, but the message no longer exists on the server.)
--filter-date-fromdate or datetimeFilter message from date, e.g. "2023-01-01" or "2023-01-01 05:33:00"
--filter-date-todate or datetimeFilter message to date, e.g. "2023-01-01" or "2023-01-01 05:33:00"

deleted vs missing: The missing message means that the message exists in the local storage, but no longer on the server, but the backup has not been run yet, so its status has not been deleted. The deleted message is when the backup detected the deletion of the message on the server and marked it in the local storage.

access-init and access-check commands

parametertypedescription
--emailstringemail account for check or init access (can be specified multiple times)