OpenClaw Email & Calendar Orientation
Minimum Model
Any model. This is an explanation and troubleshooting guide — no complex reasoning needed.
The Core Concept (Read This First)
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:
- 1. Owner must share access with the agent email (explicit step).
- Agent must authenticate using
gog (explicit step).
If someone is confused → start with this distinction. It resolves most questions.
Key Paths and Files
| File | Purpose |
|---|
| INLINECODE3 | gog OAuth client credentials |
| INLINECODE4 |
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.
Using gog
CODEBLOCK0
Common Commands
CODEBLOCK1
Calendar Write Access — Step by Step
The most common issue: the agent can read the calendar but not create events.
Step 1 — Owner does this:
- 1. Open calendar.google.com.
- Find the primary calendar → three-dot menu → Settings and sharing.
- Click "+ Add people" → enter the agent email.
- Set permission to "Make changes to events" (not "See all event details").
- Click Send.
Step 2 — Agent does this:
CODEBLOCK2
If the test event appears in the owner's calendar → success.
Troubleshooting
Work through these checks in order:
- 1. Clarify accounts: Is the question about agent email or owner email?
- Check gog is installed: Run
which gog — if not found, check PATH. - Check account was added: Run
gog auth list — does owner's account appear? - Check write scope: OAuth must include calendar write scope, not just read.
- Check keyring: If gog asks for a password, local keyring may need to be configured.
- Check GOG_ACCOUNT: All commands must include
GOG_ACCOUNT=owner@company.com. - Calendar write failures: Was permission set to "Make changes to events" (not "See details")?
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
Response Style
- - Lead with the owner vs. agent distinction — this resolves most confusion.
- Give commands first, explanation second.
- When asked "where is X stored?" → give the path, do not print the file contents.
- When asked for step-by-step → follow the Calendar Write Access section above.
Cost Tips
- - Very cheap: This skill is explanation only — minimal LLM tokens needed.
- Small model OK: Any model can explain these concepts and provide commands.
- Avoid: Do not re-explain the full orientation every time. Ask what specifically is confusing, then address only that.
OpenClaw 邮件与日历使用指南
最低模型要求
任意模型均可。本文档为说明与故障排查指南——无需复杂推理。
核心概念(请先阅读)
存在两个独立的账户:
| 账户 |
|---|
| 所有者 | 用户的Google账户(例如 owner@company.com) |
| 代理 |
PA自己的Google账户(例如 agent@agentdomain.com) |
这两个账户是独立的。 拥有代理邮箱并不会自动获得访问所有者邮箱或日历的权限。
要访问所有者的邮箱/日历:
- 1. 所有者必须共享 访问权限给代理邮箱(明确步骤)。
- 代理必须使用 gog 进行身份验证(明确步骤)。
如果有人感到困惑 → 从这个区别开始解释。它能解决大部分问题。
关键路径与文件
| 文件 | 用途 |
|---|
| ~/.openclaw/.gog/credentials.json | gog OAuth客户端凭据 |
| ~/.openclaw/agents/main/agent/auth-profiles.json |
OpenClaw身份验证配置文件 |
| ~/.openclaw/workspace/skills/gog/SKILL.md | gog使用参考 |
安全规则: 切勿在聊天中显示这些文件的内容。提及路径是可以的,但打印内容则不行。
使用 gog
bash
一次性设置:加载OAuth凭据
gog auth credentials /path/to/client_secret.json
添加账户(打开浏览器进行OAuth流程)
gog auth add owner@company.com --services gmail,calendar,drive,contacts,sheets,docs
验证账户已添加
gog auth list
在命令中使用该账户(始终包含 GOG_ACCOUNT=...)
GOG_ACCOUNT=owner@company.com gog gmail search is:unread --max 10
常用命令
bash
搜索邮件
GOG
ACCOUNT=owner@company.com gog gmail search newerthan:7d --max 10
发送邮件
GOG_ACCOUNT=owner@company.com gog gmail send \
--to recipient@example.com \
--subject 你好 \
--body 消息内容
列出时间窗口内的日历事件
GOG_ACCOUNT=owner@company.com gog calendar events primary \
--from 2026-04-01T09:00:00Z \
--to 2026-04-01T18:00:00Z
创建日历事件
GOG_ACCOUNT=owner@company.com gog calendar create primary \
--summary 会议 \
--start 2026-04-02T10:00:00+00:00 \
--end 2026-04-02T11:00:00+00:00
日历写入权限——分步指南
最常见的问题:代理可以读取日历但无法创建事件。
第1步——所有者执行以下操作:
- 1. 打开 calendar.google.com。
- 找到主日历 → 三点菜单 → 设置和共享。
- 点击“+ 添加人员” → 输入代理邮箱。
- 将权限设置为 “对事件进行更改”(而非“查看所有活动详情”)。
- 点击发送。
第2步——代理执行以下操作:
bash
使用日历范围进行身份验证
gog auth add owner@company.com --services calendar
通过创建测试事件来测试写入权限
GOG_ACCOUNT=owner@company.com gog calendar create primary \
--summary 测试事件 \
--start 2026-04-02T10:00:00Z \
--end 2026-04-02T11:00:00Z
如果测试事件出现在所有者的日历中 → 成功。
故障排查
按顺序执行以下检查:
- 1. 明确账户: 问题是关于代理邮箱还是所有者邮箱?
- 检查 gog 是否已安装: 运行 which gog —— 如果未找到,检查 PATH。
- 检查账户是否已添加: 运行 gog auth list —— 所有者的账户是否出现?
- 检查写入范围: OAuth 必须包含日历写入范围,而不仅仅是读取。
- 检查密钥环: 如果 gog 要求输入密码,可能需要配置本地密钥环。
- 检查 GOGACCOUNT: 所有命令必须包含 GOGACCOUNT=owner@company.com。
- 日历写入失败: 权限是否设置为“对事件进行更改”(而非“查看详情”)?
如果出现“权限不足”错误:
→ 所有者以只读权限共享了日历。使用正确的权限级别重新执行第1步。
如果出现“令牌已过期”错误:
bash
移除已过期的账户
gog auth remove owner@company.com
重新添加(将打开浏览器进行重新认证)
gog auth add owner@company.com --services gmail,calendar,drive,contacts
回复风格
- - 首先说明 所有者与代理 的区别——这能解决大部分困惑。
- 先给出命令,再提供解释。
- 当被问到“X 存储在哪里?”时 → 给出路径,不要打印文件内容。
- 当被要求提供分步指南时 → 遵循上述日历写入权限部分。
成本提示
- - 非常便宜: 此技能仅为说明——所需LLM令牌极少。
- 小模型即可: 任何模型都能解释这些概念并提供命令。
- 避免: 不要每次都重新解释整个指南。询问具体哪里令人困惑,然后只针对该部分进行解答。