Skip to main content
ollim-bot provides read-only Gmail access through the 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

Setup

No additional setup is required beyond the shared Google OAuth flow. The Gmail read-only scope is included by default. Once you’ve completed the Google integration setup, Gmail is ready to use.
Gmail access is strictly read-only. ollim-bot cannot send, delete, or modify emails.

Usage

The ollim-bot gmail command provides four subcommands for direct inbox access.

List unread emails

ollim-bot gmail unread
ollim-bot gmail unread --max 5
Output format:
  MSG_ID  2026-02-24 09:15  Alice Smith  Meeting follow-up
  MSG_ID  2026-02-24 08:30  Bob Jones    Invoice #1234
The --max flag limits results (default: 20).

Read an email

ollim-bot gmail read MSG_ID
Displays From, To, date, subject, and the message body. Bodies longer than 3000 characters are truncated. The reader prefers text/plain content and falls back to text/html with tags stripped.

Search emails

ollim-bot gmail search "from:alice subject:meeting"
ollim-bot gmail search "is:unread after:2026/02/20" --max 10
Uses standard Gmail search query syntax. The --max flag limits results (default: 20).

List labels

ollim-bot gmail labels
Lists all Gmail labels with their IDs and names.

CLI reference

SubcommandArgumentsDefaultDescription
unread--max N20List unread emails
read<id>Read a full email by message ID
search"<query>", --max N20Search with Gmail query syntax
labelsList all labels

Troubleshooting

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 run /google-auth to re-consent with the updated scopes.
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.
All Gmail timestamps are displayed in the configured timezone (OLLIM_TIMEZONE, defaults to auto-detected system timezone with a UTC fallback). If dates appear incorrect, verify your OLLIM_TIMEZONE setting matches your local timezone.

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.