Setup & Installation
Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:
What This Skill Does
Sets up Gmail API access using the `gog` CLI with a headless-compatible OAuth flow. Handles credential configuration, token exchange, and common authentication errors for personal or server-side Gmail integrations.
The `gog` CLI with file-based keyring makes OAuth token management work on headless servers where browser-based flows are impractical.
When to use it
- Authorizing Gmail access on a headless server
- Renewing expired OAuth tokens without a browser on the server
- Setting up Gmail API for a personal automation script
- Troubleshooting OAuth errors like invalid_grant or redirect_uri_mismatch
- Configuring Gmail integration for a self-hosted email tool
Example Workflow
Here's how your AI assistant might use this skill in practice.
User asks: set up Gmail OAuth on my headless server
- 1Install gog CLI via brew and create a Google Cloud project with Gmail API enabled
- 2Download OAuth client secret JSON (Desktop app type) from Google Cloud Console
- 3Run `gog auth credentials` with the JSON file and configure file-based keyring
- 4Generate the OAuth URL, open it in a desktop browser, approve permissions, and copy the auth code
- 5Exchange the code immediately using the auth script and verify access with a test search
Gmail API access configured with a permanent refresh token stored in file-based keyring
Requirements
Accounts, API keys, or tools you or your AI assistant may need to set up while using this skill.