gmail (v1)
PREREQUISITE: Read ../gws-shared/SKILL.md for auth, global flags, and security rules. If missing, run gws generate-skills to create it.
CODEBLOCK0
Helper Commands
Show unread inbox summary (sender, subject, date) |
|
+reply | Reply to a message (handles threading automatically) |
|
+reply-all | Reply-all to a message (handles threading automatically) |
|
+forward | Forward a message to new recipients |
|
+read | Read a message and extract its body or headers |
|
+watch | Watch for new emails and stream them as NDJSON |
API Resources
users
- getProfile — Gets the current user's Gmail profile.
- stop — Stop receiving push notifications for the given user mailbox.
- watch — Set up or update a push notification watch on the given user mailbox.
- drafts — Operations on the 'drafts' resource
- history — Operations on the 'history' resource
- labels — Operations on the 'labels' resource
- messages — Operations on the 'messages' resource
- settings — Operations on the 'settings' resource
- threads — Operations on the 'threads' resource
Discovering Commands
Before calling any API method, inspect it:
CODEBLOCK1
Use gws schema output to build your --params and --json flags.
gmail (v1)
前置条件: 请阅读 ../gws-shared/SKILL.md 了解认证、全局标志和安全规则。若该文件缺失,请运行 gws generate-skills 创建。
bash
gws gmail <资源> <方法> [标志]
辅助命令
显示未读收件箱摘要(发件人、主题、日期) |
|
+reply | 回复消息(自动处理邮件线程) |
|
+reply-all | 全部回复消息(自动处理邮件线程) |
|
+forward | 将消息转发给新收件人 |
|
+read | 读取消息并提取正文或标头 |
|
+watch | 监听新邮件并以NDJSON格式流式输出 |
API资源
users
- getProfile — 获取当前用户的Gmail个人资料。
- stop — 停止接收指定用户邮箱的推送通知。
- watch — 在指定用户邮箱上设置或更新推送通知监听。
- drafts — 对drafts资源的操作
- history — 对history资源的操作
- labels — 对labels资源的操作
- messages — 对messages资源的操作
- settings — 对settings资源的操作
- threads — 对threads资源的操作
发现命令
在调用任何API方法前,请先检查:
bash
浏览资源和方法
gws gmail --help
检查方法的必需参数、类型和默认值
gws schema gmail.<资源>.<方法>
使用 gws schema 输出来构建你的 --params 和 --json 标志。