gmail.readonly OAuth scope.
The agent uses a dedicated gmail-reader subagent to triage your inbox —
surfacing actionable emails while filtering out noise.
You can also query Gmail directly from the CLI.
Prerequisites
- Google OAuth configured with the
gmail.readonlyscope (see Google OAuth setup) credentials.jsonin~/.ollim-bot/state/from the Google Cloud Consoletoken.jsonin~/.ollim-bot/state/(auto-generated on first auth)
Setup
Gmail shares the same OAuth flow as Google Tasks and Google Calendar. If you already have Google integration working, Gmail is available automatically — no additional setup required.Gmail access is strictly read-only. ollim-bot cannot send, delete, or modify emails.
Usage
- CLI
- Agent
The Output format:The Displays From, To, date, subject, and the message body.
Bodies longer than 3000 characters are truncated.
The reader prefers Uses standard Gmail search query syntax.
The Lists all Gmail labels with their IDs and names.
ollim-bot gmail command provides four subcommands for direct inbox access.List unread emails
--max flag limits results (default: 20).Read an email
text/plain content and falls back
to text/html with tags stripped.Search emails
--max flag limits results (default: 20).List labels
CLI reference
| Subcommand | Arguments | Default | Description |
|---|---|---|---|
unread | --max N | 20 | List unread emails |
read | <id> | — | Read a full email by message ID |
search | "<query>", --max N | 20 | Search with Gmail query syntax |
labels | — | — | List all labels |
Troubleshooting
Gmail commands return no messages
Gmail commands return no messages
Verify that your OAuth token includes the
gmail.readonly scope.
If you added Gmail after the initial OAuth flow, delete
~/.ollim-bot/state/token.json and re-authenticate to pick up the new scope.Body shows '(no text body)'
Body shows '(no text body)'
Some emails use only HTML with embedded images and no text content.
The reader extracts
text/plain first, then falls back to stripped
text/html. Emails that are purely image-based will show no body.Dates display in configured timezone
Dates display in configured timezone
All Gmail timestamps are displayed in the configured timezone
(
OLLIM_TIMEZONE, defaults to system local).Next steps
Google integration
OAuth setup and shared authentication across Google services.
Subagents
How the gmail-reader and other subagents are defined and invoked.
Routines
Schedule automatic email triage as a recurring routine.
Background forks
How subagents like gmail-reader execute in isolated background forks.
