Skip to content
GitHub stars

Multi-Account

One Secret, Many Tokens

A single client_secret.json supports all your Gmail accounts. You do not need to create separate OAuth credentials or edit your config between accounts. Each add-account call authorizes one account and stores a separate token file.

Diagram showing one OAuth client secret creating separate token files for each account

See the OAuth Setup Guide for the full setup walkthrough.

Adding Accounts

Terminal window
# Gmail accounts (OAuth)
msgvault add-account personal@gmail.com
msgvault add-account work@company.com
# IMAP accounts (password)
msgvault add-imap --host imap.fastmail.com --username you@fastmail.com

Gmail accounts open a browser for OAuth authorization. IMAP accounts prompt for a password and test the connection. All accounts share the same SQLite database and attachment storage.

Syncing

Sync all accounts at once by omitting the email argument:

Terminal window
# Full sync all accounts
msgvault sync-full
# Incremental sync all accounts
msgvault sync

Or sync a specific account:

Terminal window
msgvault sync-full personal@gmail.com
msgvault sync work@company.com

If a token expires during sync, msgvault prints the re-authorization URL with the account name so you can select the correct Google account. It will not auto-launch a browser during re-auth to prevent accidentally authorizing the wrong account.

Search queries run across all accounts by default:

Terminal window
msgvault search "quarterly report"

Use --account to limit results to a specific account:

Terminal window
msgvault search "quarterly report" --account work@company.com

TUI Filtering

Filter the TUI to a specific account:

Terminal window
msgvault tui --account work@company.com

Or press a in the TUI to cycle through account filters interactively.