| name | gog-gmail |
| version | 1.0.0 |
| description | 用 gog 读/搜/发 Gmail。**先读 gog-shared**(鉴权 + 写操作确认纪律)。对 send/delete/forward/reply/batch delete/filters 等写操作**必须先向用户确认并停止,下一轮明确同意后再执行**。典型场景:收件箱三分钟 triage、搜近 7 天带附件邮件、回复特定 thread、创建 draft、批量 archive。 |
| metadata | {"requires":{"bins":["gog"],"connectors":["google_workspace"]}} |
gog-gmail
PREREQUISITE: 先读 gog-shared/SKILL.md(鉴权 + 写操作确认纪律)。
常用只读命令(无需确认)
gog --account <email> --json gmail search 'newer_than:7d has:attachment' --max 20
gog --account <email> --json gmail thread get <threadId>
gog --account <email> --json gmail get <messageId>
gog --account <email> --json gmail get <messageId> --format metadata
gog --account <email> --json gmail labels list
gog --account <email> --json gmail labels get INBOX
gog --account <email> --json gmail messages search 'newer_than:7d' --max 10 --full
写操作(⚠️ 必须先确认)
gog --account <email> gmail send --to a@b.com --subject "Hi" --body-file ./message.txt
gog --account <email> gmail send --to a@b.com --subject "Hi" --body "Plain" --body-html "<p>Hello</p>"
gog --account <email> gmail forward <messageId> --to a@b.com --note "FYI"
gog --account <email> gmail send --reply-to-message-id <messageId> --quote \
--to <original_from> --subject "Re: ..." --body "My reply"
gog --account <email> gmail drafts create --subject "..." --body "..."
gog --account <email> gmail drafts send <draftId>
gog --account <email> gmail thread modify <threadId> --add STARRED --remove INBOX
gog --account <email> gmail batch delete <id> <id> <id>
典型场景
场景:三分钟 inbox triage
gog --json gmail search 'in:inbox newer_than:3d' --max 50
- 按 from / subject 分类,输出一份摘要给用户
- 根据用户指示,逐 thread
gog gmail thread modify --remove INBOX --add <Label>(每个写操作一次确认,或一次批量确认后批跑)
场景:回复某个发件人最近一封邮件
gog --json gmail search 'from:alice@x.com' --max 1 --full → 拿到 threadId 和正文
- 把要回复的内容(复述 + 原邮件摘要)给用户确认,停止等待下一轮明确同意
gog gmail send --reply-to-message-id <id> --quote --to alice@x.com --subject "Re: ..." --body-file /tmp/reply.txt
场景:导出 filters
gog --account <email> gmail filters export --out /workspace/gmail-filters-backup.json
注意
--track(email tracking)不做,和 ripple 无关。
- 复杂 Gmail search 语法(
has:drive, label:Foo-Bar, older_than:...)看 Gmail Search operators。
gmail watch(Pub/Sub push)MVP 不启用,需要时单独设计。