Skip to content
GitHub stars

Configuration

Config File

Default location:

PlatformPath
macOS / Linux~/.msgvault/config.toml
WindowsC:\Users\<you>\.msgvault\config.toml

Override the data directory with the MSGVAULT_HOME environment variable or the --home flag (see below).

[data]
# Base data directory (default: ~/.msgvault)
data_dir = "/path/to/msgvault/data"
# Database URL (default: {data_dir}/msgvault.db)
database_url = "/path/to/msgvault.db"
[oauth]
# Path to Google OAuth client secrets JSON (required)
client_secrets = "/path/to/client_secret.json"
[sync]
# Gmail API rate limit (requests per second)
rate_limit_qps = 5
[server]
# API server settings (used by `msgvault serve`)
api_port = 8080
bind_addr = "127.0.0.1"
api_key = "your-secret-key"
[remote]
# Remote msgvault endpoint for CLI remote mode
url = "http://nas-ip:8080"
api_key = "remote-api-key"
allow_insecure = true
# Scheduled sync accounts
[[accounts]]
email = "you@gmail.com"
schedule = "0 * * * *"
enabled = true

Windows Paths

TOML treats backslashes inside double-quoted strings as escape characters. On Windows, this means native paths like "C:\Users\you\..." will cause a parse error.

Use one of these formats instead:

# Forward slashes (recommended)
client_secrets = "C:/Users/you/Downloads/client_secret.json"
# Single-quoted string (backslashes are literal)
client_secrets = 'C:\Users\you\Downloads\client_secret.json'

Sections

[data]

KeyDefaultDescription
data_dir~/.msgvaultBase directory for all data
database_url{data_dir}/msgvault.dbSQLite database path

Attachments and OAuth tokens are stored in subdirectories of data_dir (attachments/ and tokens/ respectively). These paths are not independently configurable.

[oauth]

KeyDefaultDescription
client_secretsPath to Google OAuth client_secret.json (required)

[sync]

KeyDefaultDescription
rate_limit_qps5Gmail API requests per second

[server]

Settings for the web server started by msgvault serve. See Web Server for endpoint documentation.

KeyDefaultDescription
api_port8080Port the server listens on
bind_addr127.0.0.1Bind address
api_keyAPI key for authentication
allow_insecurefalseAllow non-loopback binding without api_key
cors_origins[]Allowed CORS origins
cors_credentialsfalseAllow credentials in CORS requests
cors_max_age0CORS preflight cache duration in seconds

[remote]

When set, CLI commands read from the remote server by default for supported operations.

KeyDefaultDescription
urlRemote API base URL (e.g. http://nas-ip:8080)
api_keyAPI key used by remote commands
allow_insecurefalseAllow HTTP remote connections

Affected CLI commands: search, show-message, stats, list-accounts.

[[accounts]]

Scheduled sync accounts for the web server. Each [[accounts]] entry defines a cron schedule for automatic background syncing.

KeyDefaultDescription
email(required)Gmail account email address
scheduleCron expression for sync schedule (e.g., 0 * * * *)
enabledtrueWhether scheduled sync is active for this account

Overriding the Home Directory

By default, msgvault stores everything under ~/.msgvault (macOS/Linux) or C:\Users\<you>\.msgvault (Windows). To use a different location, you have two options:

--home flag (per-command):

Terminal window
msgvault sync --home /mnt/data/msgvault

MSGVAULT_HOME environment variable (persistent):

Terminal window
export MSGVAULT_HOME=/mnt/data/msgvault

Both options are equivalent: config.toml is loaded from the specified directory, and all data (database, tokens, attachments) is stored there. The --home flag takes priority over MSGVAULT_HOME.

Environment Variables

VariableDescription
MSGVAULT_HOMEBase directory for all data (default: ~/.msgvault)
MSGVAULT_REMOTE_URLRemote URL for export-token (flag > env > config)
MSGVAULT_REMOTE_API_KEYRemote API key for export-token (flag > env > config)

File Locations

All data lives under the msgvault home directory (~/.msgvault on macOS/Linux, C:\Users\<you>\.msgvault on Windows). The directory is created automatically on first use.

FileDescription
config.tomlConfiguration file
msgvault.dbSQLite database (system of record)
attachments/Content-addressed attachment files
tokens/OAuth tokens per account
analytics/Parquet cache files for TUI