recipe-create-gmail-filter
它能做什么
这个工具可以帮你整理 Gmail 收件箱。它能自动创建规则,把重要邮件打上标签、归类,甚至移动到指定文件夹,不需要你手动操作。
适用场景
- ✓想让某个发件人(比如商店)的邮件自动标记为“收据”时。
- ✓想把某个项目的邮件单独归到另一个分类时。
- ✓想让推广邮件自动归档,不再占用主收件箱时。
技能链接
https://github.com/googleworkspace/cli/blob/main/skills/recipe-create-gmail-filter/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“创建一个筛选规则,让所有来自 newsletter@example.com 的邮件都打上“电子报”标签,并从收件箱中移除。”
每周 5 个新技能,1 分钟读完。
工作原理
工具会先检查你已有的标签。如有需要,它会新建一个标签。最后,它会在 Gmail 中设置规则,根据发件人或其他特征,对新收到的邮件执行你指定的操作。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Create a Gmail Filter
PREREQUISITE: Load the following skills to execute this recipe:
gws-gmail
Create a Gmail filter to automatically label, star, or categorize incoming messages.
Steps
- List existing labels:
gws gmail users labels list --params '{"userId": "me"}' --format table - Create a new label:
gws gmail users labels create --params '{"userId": "me"}' --json '{"name": "Receipts"}' - Create a filter:
gws gmail users settings filters create --params '{"userId": "me"}' --json '{"criteria": {"from": "receipts@example.com"}, "action": {"addLabelIds": ["LABEL_ID"], "removeLabelIds": ["INBOX"]}}' - Verify filter:
gws gmail users settings filters list --params '{"userId": "me"}' --format table
常见问题
需要先安装什么吗?
需要。要使用这个功能,必须先加载“gws-gmail”技能。
可以新建标签吗?
可以。你可以新建标签,比如“收据”或“工作”,用来整理邮件。
创建筛选规则后,邮件会怎样?
这取决于你设置的规则。邮件可以被打上标签、加星标,甚至移出主收件箱。
详情
作者的原始描述
Create a Gmail filter to automatically label, star, or categorize incoming messages.
repo: googleworkspace/cli
热度
- GitHub 星标
- 32k
- 排名
- #9218
- 许可证
- Apache-2.0
- 更新时间
- 2026/10/6
评论
- …