Gmail OAuth Setup for gog CLI for Openclaw

A specialized workflow for establishing secure, headless Gmail API authentication using the gog CLI and Google Cloud credentials.

kai-jar
v1.0.0
Feb 6, 2026
7
5.9k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install gmail-oauth

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install gmail-oauth using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Gmail OAuth Setup for gog CLI?

This skill provides a comprehensive technical framework for managing Gmail OAuth flows in environments where traditional browser-based redirection is restricted. By utilizing the gog CLI, it enables developers to authorize applications on headless servers or remote environments while maintaining high security standards. This implementation is a core part of the Openclaw Skills library, focusing on bridging the gap between local development and remote server automation.

The skill guides users through the intricate process of configuring Google Cloud projects, managing OAuth consent screens, and handling token persistence. By following this methodology, users can ensure their Openclaw Skills integrations remain functional with permanent refresh tokens, avoiding the common pitfalls of the 7-day expiry limit found in testing-mode applications.

Gmail OAuth Setup for gog CLI Use Cases

  • Deploying automated email agents on headless Linux environments.
  • Refreshing expired OAuth tokens for long-running server processes.
  • Troubleshooting Google Cloud API permission mismatches and redirect errors.
  • Implementing secure, keyring-encrypted credential storage for CLI-based email tools.

How Gmail OAuth Setup for gog CLI Works

  1. Initialize a Google Cloud Project and enable the Gmail API via the Google Cloud Console.
  2. Configure a Desktop App OAuth client and download the credentials JSON file.
  3. Import the credentials into the gog CLI and establish a file-based keyring for secure token storage.
  4. Execute the interactive auth script to generate a manual authorization URL.
  5. Capture the authorization code from the localhost redirect and exchange it for an access token.
  6. Verify connectivity by querying the Gmail API for unread messages via the command line.

Gmail OAuth Setup for gog CLI Setup

First, install the gog CLI tool:

brew install steipete/tap/gogcli

Next, configure your credentials and initialize the keyring:

gog auth credentials /path/to/client_secret.json
gog auth keyring file
export GOG_KEYRING_PASSWORD="your-password"

Finally, execute the authentication flow using the provided Openclaw Skills helper scripts:

# Generate the URL
scripts/gmail-auth.sh --url

# Exchange the code after browser approval
scripts/gmail-auth.sh --exchange YOUR_CODE YOUR_EMAIL

Gmail OAuth Setup for gog CLI Data Schema & Taxonomy

Data Component Storage Type Purpose
client_secret.json Local File Contains Google Cloud OAuth client ID and secret
GOG_KEYRING_PASSWORD Environment Variable Unlocks the encrypted token storage
Keyring File Binary File Stores persistent OAuth refresh and access tokens
scripts/gmail-auth.sh Bash Script Orchestrates the URL generation and code exchange
Scopes Configuration Defines API access levels (e.g., gmail.modify)

Gmail OAuth Setup for gog CLI Advanced Features

  • Support for permanent refresh tokens by automating the transition to Published app status.
  • Headless-ready authentication that bypasses the need for a local browser on the execution host.
  • Encrypted credential management using file-based keyrings for enhanced security.
  • Granular scope management allowing users to toggle between read-only, send-only, or full modify permissions.
  • Built-in troubleshooting logic for handling common Google API errors like invalid_grant and redirect_uri_mismatch.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*