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

Output format:
The --max flag limits results (default: 20).

Read an email

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

Uses standard Gmail search query syntax. The --max flag limits results (default: 20).

List labels

Lists all Gmail labels with their IDs and names.

CLI reference

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.