Skip to main content

Documentation Index

Fetch the complete documentation index at: https://onecli.sh/docs/llms.txt

Use this file to discover all available pages before exploring further.

Overview

OneCLI connects AI agents to Gmail through Google’s OAuth flow. Agents can search your inbox, read messages, draft and send emails, and manage labels. The gateway injects OAuth credentials into requests to the Gmail API automatically. This is useful for agents that need to process incoming messages, send notifications, or automate email workflows on your behalf.

Setup

1

Go to Connections

Open the OneCLI dashboard and navigate to Connections > Gmail.
2

Authorize

Click Connect Gmail. You’ll be redirected to Google to authorize OneCLI. Review the permissions and click Allow.

What agents can do

  • Search your inbox for messages matching a query (sender, subject, date range, labels)
  • Read the full content of individual emails, including attachments
  • Draft new emails with specified recipients, subject, and body
  • Send emails on your behalf
  • Reply to or forward existing messages
  • Create, rename, and delete labels
  • Move messages between labels (e.g., archive, mark as read, move to a folder)
  • List and filter threads by label or search criteria
  • Batch modify messages (mark as read, add/remove labels)

Controlling access with rules

Use OneCLI’s rules engine to limit what agents can do with your email. For example, you can block send operations so agents can only read and draft but never send, or restrict agents to specific label scopes. Rules are evaluated before credential injection, so a blocked request never reaches Gmail.