---
id: ssh2-recipe-create-gmail-filter
name: "recipe-create-gmail-filter"
url: https://skills.yangsir.net/skill/ssh2-recipe-create-gmail-filter
author: googleworkspace
domain: ai-productivity-automation
tags: ["gmail-filters", "email-automation", "inbox-management", "google-workspace-cli", "productivity-recipes"]
install_count: 15400
rating: 4.50 (156 reviews)
github: https://github.com/googleworkspace/cli
---

# recipe-create-gmail-filter

> 能够创建Gmail过滤器，自动对邮件进行标签、星标或分类，有效管理收件箱，提高工作效率。

**Stats**: 15,400 installs · 4.5/5 (156 reviews)

## Before / After 对比

### Gmail邮件管理效率的革命性提升：从繁琐手动分类到智能自动化过滤的对比分析

## Readme

# 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

1. List existing labels: `gws gmail users labels list --params '{"userId": "me"}' --format table`
2. Create a new label: `gws gmail users labels create --params '{"userId": "me"}' --json '{"name": "Receipts"}'`
3. Create a filter: `gws gmail users settings filters create --params '{"userId": "me"}' --json '{"criteria": {"from": "receipts@example.com"}, "action": {"addLabelIds": ["LABEL_ID"], "removeLabelIds": ["INBOX"]}}'`
4. Verify filter: `gws gmail users settings filters list --params '{"userId": "me"}' --format table`



---
*Source: https://skills.yangsir.net/skill/ssh2-recipe-create-gmail-filter*
*Markdown mirror: https://skills.yangsir.net/api/skill/ssh2-recipe-create-gmail-filter/markdown*