Skip to main content
ollim-bot integrates with three Google services through a shared OAuth2 flow. A single set of credentials handles authentication for Google Tasks, Google Calendar, and Gmail — no per-service setup needed. All three services are available as both CLI subcommands and agent capabilities. The agent uses MCP tools and embed buttons to interact with Tasks and Calendar, and a dedicated subagent for Gmail.

Available services

How it works

All Google services share a single OAuth2 credential managed by google/auth.py. The module requests three scopes during the initial consent flow:
ScopeServiceAccess level
https://www.googleapis.com/auth/tasksGoogle TasksRead/write
https://www.googleapis.com/auth/calendar.eventsGoogle CalendarRead/write
https://www.googleapis.com/auth/gmail.readonlyGmailRead-only
Two functions handle all authentication:
  • get_credentials() — loads cached credentials from ~/.ollim-bot/state/token.json, refreshes expired tokens automatically, or starts a new browser-based consent flow on first run.
  • get_service(api, version) — builds a Google API client for any service using the shared credentials. Each service module calls this with its API name and version (e.g., get_service("tasks", "v1")).
On first run, the OAuth flow opens a browser window bound to 127.0.0.1 for consent. After granting access, the token is cached at ~/.ollim-bot/state/token.json and refreshed automatically.

Credential files

FilePathPurpose
OAuth client credentials~/.ollim-bot/state/credentials.jsonDownloaded from Google Cloud Console
Cached token~/.ollim-bot/state/token.jsonAuto-generated after first OAuth consent
If you add a new Google service scope to google/auth.py, delete ~/.ollim-bot/state/token.json to trigger re-consent with the updated scopes.

Adding a new scope

To integrate an additional Google service:
  1. Add the new scope to the SCOPES list in google/auth.py.
  2. Create a new module in google/ with CLI handlers and any helper functions.
  3. Delete ~/.ollim-bot/state/token.json so the next run prompts for consent with the expanded scopes.
  4. Add commands to the system prompt so the agent knows about the new service.
See Adding new integrations for the full walkthrough.

Next steps