ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified communication Safety 3/5

gmail-oauth

Set up Gmail API access via gog CLI with manual OAuth flow. Use when setting up Gmail integration, renewing expired OAuth tokens, or troubleshooting Gmail authentication on headless servers.

Why use this skill?

Learn how to configure secure Gmail API access for headless environments using the gmail-oauth skill. Simplify token management, resolve authentication errors, and automate email workflows.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/kai-jar/gmail-oauth
Or

What This Skill Does

The gmail-oauth skill provides a robust, headless-friendly framework for authenticating and managing access to the Gmail API using the gog CLI tool. It facilitates the manual OAuth handshake process required for secure, programmatic access to email data. By bridging the gap between local browser-based authentication and server-side execution, it allows developers and power users to configure secure integrations that persist across reboots, which is critical for automated email processing tasks.

Installation

To integrate this skill, use the following command: clawhub install openclaw/skills/skills/kai-jar/gmail-oauth

Ensure that you have the gog CLI installed locally via brew install steipete/tap/gogcli and that your Google Cloud Project is configured for a 'Desktop app' OAuth flow. Detailed configuration involves enabling the Gmail API, setting up the OAuth consent screen, and securely managing your credentials using environment variables.

Use Cases

  • Automated Mail Monitoring: Setting up background agents to watch for specific transactional emails or support requests.
  • Headless Server Integration: Enabling email functionality on remote Linux or cloud-based server environments where a full GUI browser is not available.
  • Token Lifecycle Management: Renewing expired tokens for existing integrations to prevent service interruption.
  • Credential Troubleshooting: Resolving complex OAuth handshake errors that occur when shifting between testing and production environments.

Example Prompts

  1. "Help me set up the gmail-oauth flow on my server; I need to generate a new authentication URL."
  2. "I am getting an invalid_grant error while using the gmail-oauth skill. How can I refresh my tokens?"
  3. "Guide me through publishing my Google Cloud app to ensure my Gmail refresh tokens stay active beyond seven days."

Tips & Limitations

  • Persistence: Always publish your app in the Google Cloud Console. Failure to do so keeps the app in 'Testing' mode, forcing token expiration every 7 days.
  • Security: The GOG_KEYRING_PASSWORD should be handled as a sensitive environment variable and never committed to version control.
  • Code Expiration: OAuth authorization codes are extremely time-sensitive; ensure you have your terminal ready to paste the code immediately after retrieving it from the browser redirect to avoid timeouts.

Metadata

Author@kai-jar
Stars1776
Views7
Updated2026-03-02
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-kai-jar-gmail-oauth": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#gmail#oauth#authentication#api-integration#headless
Safety Score: 3/5

Flags: external-api, file-read, file-write