/gmail/.
For Google OAuth setup, see Google Workspace Setup.
Config
Filesystem Layout
INBOX, SENT, STARRED). User-created labels
use their label name with spaces replaced by underscores.
Date Directories
Inside each label, messages are grouped into date subdirectories formatted asYYYY-MM-DD. The date is derived from the message’s
internalDate (epoch milliseconds) converted to a calendar date.
Message Files
Each message is stored as a.gmail.json file. The filename shape is:
__ and before
.gmail.json.
Attachments
Messages that have attachments get a companion subdirectory with the same base name (without.gmail.json). Decoded attachment
files are placed inside:
Cache
The Gmail resource usesIndexCacheStore (same as Slack, Discord,
and other resources). Index entries store label IDs, message IDs,
and message metadata. There is no separate content cache — file
content caching is handled by the workspace IOResult mechanism.
Example
examples/gmail/gmail.py for the full working example.
Finding IDs
Resource-specific commands require message IDs. These can be extracted from the filesystem:Working with Large Labels
Labels with many messages are split into date directories. Tips for efficient access:Shell Commands
Standard commands available on the mounted Gmail tree:
Acting on Gmail (send, reply, forward, triage, raw API calls) goes
through the gws CLI when installed.