SuperAPI AI 工具集

gog

通用与其它

查看项目

更新于 10-16 06:43

技能介绍

用途:gog 是面向 Google Workspace 的命令行工具,覆盖 Gmail、Calendar、Drive、Contacts、Sheets 和 Docs,适合在终端或脚本中批量处理邮件、日历、文件、联系人、表格与文档。

使用前需一次性完成 OAuth 设置:gog auth credentials /path/to/client_secret.json;gog auth add you@gmail.com --services gmail,calendar,drive,contacts,docs,sheets;用 gog auth list 查看已授权账号。

主要能力与用法:Gmail 支持搜索、发送、草稿、回复,如 gog gmail search 'newer_than:7d' --max 10、gog gmail send --to a@b.com --subject "Hi" --body "Hello";Gmail 搜索按会话返回一行,需要逐封邮件时用 gog gmail messages search。Calendar 支持列出、创建、更新事件及查看可选颜色,如 gog calendar events <calendarId> --from <iso> --to <iso>、gog calendar create <calendarId> --summary "Title" --from <iso> --to <iso> --event-color 7、gog calendar colors。Drive 支持搜索(gog drive search "query" --max 10),Contacts 支持列出(gog contacts list --max 20)。Sheets 支持读取、更新、追加、清空和元数据,如 gog sheets get <sheetId> "Tab!A1:D10" --json、gog sheets update <sheetId> "Tab!A1:B2" --values-json '[['A','B'],['1','2']]' --input USER_ENTERED。Docs 支持 export、cat 和 copy,如 gog docs export <docId> --format txt --out /tmp/doc.txt。

邮件格式建议优先使用纯文本,多段内容用 --body-file(或 --body-file - 从标准输入读取);--body 不会转义 \n,需要内联换行可用 heredoc 或 $'Line 1\n\nLine 2';仅在需要富文本时使用 --body-html。

限制与注意:设置 GOG_ACCOUNT=you@gmail.com 可省略 --account;脚本场景建议使用 --json 加 --no-input;Sheets 值推荐用 --values-json;Docs 只支持 export/cat/copy,就地编辑需要 Docs API 客户端,gog 不提供;发送邮件或创建事件前应先确认。事件颜色可用 ID 1-11,通过 gog calendar colors 查看。官方资料未提供收费、价格与平台支持等更多信息。