OpenClaw + Gmail Setup
Let OpenClaw read/search the inbox for harrisreynolds@nimblelabs.com and (optionally) receive "new email" events.
Security Note
This uses Google OAuth. You do not share a Gmail password. Access can be revoked anytime in Google Account settings.
Prerequisites
Install the following dependencies before proceeding:
- gcloud — Google Cloud SDK
- gog — gogcli
- openclaw — installed and the Gateway running
Step-by-Step Setup
Authenticate gcloud
Authenticate with the Google account that owns the Cloud project (e.g. harris@nimblelabs.com):
gcloud auth login
Select or Create a Google Cloud Project
This is the project where you'll create the OAuth Client ID and enable the Gmail API.
Project ID: open-claw-automation-486315
Project number: 852422026233
(Project number and project id are different.)
Option A — use an existing project:
gcloud projects list
# pick a PROJECT_ID from the list
gcloud config set project open-claw-automation-486315
Option B — create a new project:
# choose a globally-unique id
gcloud projects create nimblelabs-partnerships
gcloud config set project nimblelabs-partnerships
If you hit billing/permission errors, you may need to attach billing in the Cloud Console: Billing → Link a billing account.
Enable the Gmail API
Enable the Gmail API for that project:
gcloud services enable gmail.googleapis.com
Or via console: Google Cloud Console → APIs & Services → Library → "Gmail API" → Enable.
Create an OAuth Client ID
Create an OAuth Client ID (for gog) in the same project:
- • Google Cloud Console → APIs & Services → Credentials
- • Create Credentials → OAuth client ID
- • Application type: Desktop app
-
•
Download the JSON (it will look like
client_secret_...apps.googleusercontent.com.json)
If prompted to configure the OAuth consent screen: "Internal" is best for Workspace (if available). Otherwise "External" works but may require extra steps.
Point gogcli at the OAuth client JSON
gog auth credentials /path/to/client_secret_XXXX.json
gog stores it at: ~/Library/Application Support/gogcli/credentials.json
Authorize the Gmail inbox account
This stores a refresh token for harrisreynolds@nimblelabs.com:
gog auth add harrisreynolds@nimblelabs.com gog auth list
Sanity check Gmail access
Count inbox mail to verify access:
gog --account harrisreynolds@nimblelabs.com gmail labels get INBOX --json
You should see messagesTotal / messagesUnread.
Wire OpenClaw Gmail hooks
Recommended — enables "new email" wakeups:
openclaw webhooks gmail setup \ --account harrisreynolds@nimblelabs.com \ --project open-claw-automation-486315
This writes OpenClaw hook config and sets up the Gmail → Pub/Sub → webhook flow.
Run the Gmail watcher
If it's not auto-started by the Gateway:
openclaw webhooks gmail run
Common Errors
"GCP project id required"
Fix: pass --project open-claw-automation-486315 or run gcloud config set project open-claw-automation-486315.
"OAuth client credentials missing" (gog)
Fix: create/download the OAuth client JSON (Desktop app) and run gog auth credentials ....
"Gmail API has not been used in project … or it is disabled"
Fix: enable gmail.googleapis.com in that project, then wait a couple minutes and retry.
What This Enables
- OpenClaw can check inbox counts, search mail, and confirm newsletter signups.
- With hooks enabled, new emails can wake the agent so it can summarize/route messages quickly.
Last updated: 2026-02-11