Any model. This is an explanation and troubleshooting guide — no complex reasoning needed.
There are two separate accounts:
| Account | |
|---|---|
| --- | --- |
| Owner | The human's Google account (e.g. owner@company.com) |
| Agent | The PA's own Google account (e.g. agent@agentdomain.com) |
These are separate. Having an agent email does NOT automatically give access to the owner's email or calendar.
To access the owner's email/calendar:
gog (explicit step).If someone is confused → start with this distinction. It resolves most questions.
| File | Purpose |
|---|---|
| --- | --- |
~/.openclaw/.gog/credentials.json | gog OAuth client credentials |
~/.openclaw/agents/main/agent/auth-profiles.json | OpenClaw auth profiles |
~/.openclaw/workspace/skills/gog/SKILL.md | gog usage reference |
Security rule: Never show the contents of these files in chat. Mentioning the path is fine; printing the content is not.
# One-time setup: load OAuth credentials
gog auth credentials /path/to/client_secret.json
# Add an account (opens browser for OAuth flow)
gog auth add owner@company.com --services gmail,calendar,drive,contacts,sheets,docs
# Verify the account was added
gog auth list
# Use the account in commands (always include GOG_ACCOUNT=...)
GOG_ACCOUNT=owner@company.com gog gmail search 'is:unread' --max 10
# Search email
GOG_ACCOUNT=owner@company.com gog gmail search 'newer_than:7d' --max 10
# Send email
GOG_ACCOUNT=owner@company.com gog gmail send \
--to "recipient@example.com" \
--subject "Hello" \
--body "Message text"
# List calendar events in a time window
GOG_ACCOUNT=owner@company.com gog calendar events primary \
--from "2026-04-01T09:00:00Z" \
--to "2026-04-01T18:00:00Z"
# Create a calendar event
GOG_ACCOUNT=owner@company.com gog calendar create primary \
--summary "Meeting" \
--start "2026-04-02T10:00:00+00:00" \
--end "2026-04-02T11:00:00+00:00"
The most common issue: the agent can read the calendar but not create events.
Step 1 — Owner does this:
Step 2 — Agent does this:
# Authenticate with calendar scope
gog auth add owner@company.com --services calendar
# Test write access by creating a test event
GOG_ACCOUNT=owner@company.com gog calendar create primary \
--summary "Test Event" \
--start "2026-04-02T10:00:00Z" \
--end "2026-04-02T11:00:00Z"
If the test event appears in the owner's calendar → success.
Work through these checks in order:
which gog — if not found, check PATH.gog auth list — does owner's account appear?GOG_ACCOUNT=owner@company.com.If "Insufficient permissions" error:
→ Owner shared calendar with read-only access. Redo Step 1 with the correct permission level.
If "Token expired" error:
# Remove the expired account
gog auth remove owner@company.com
# Re-add it (will open browser for re-auth)
gog auth add owner@company.com --services gmail,calendar,drive,contacts
共 1 个版本