recipe-create-gmail-filter▌
googleworkspace/cli · updated Apr 8, 2026
Automated Gmail message routing through filters that label, star, or archive incoming mail.
- ›Requires the gws-gmail skill and gws binary to execute filter operations
- ›Supports filter criteria matching (sender, subject, keywords) with actions including label assignment, removal from inbox, and archiving
- ›Includes commands to list existing labels, create new labels, apply filters, and verify filter configuration
1d:["$","div",null,{"className":"prose prose-invert max-w-none prose-headings:font-semibold prose-headings:tracking-tight prose-h1:text-4xl prose-h1:mb-2 prose-h2:text-2xl prose-h2:mb-2 prose-h3:text-lg prose-h3:mb-2 prose-p:text-muted-foreground prose-li:text-muted-foreground prose-code:bg-muted prose-code:text-foreground prose-code:px-1 prose-code:py-0.5 prose-code:rounded-sm prose-code:text-sm prose-code:before:content-none prose-code:after:content-none prose-pre:bg-muted prose-pre:text-foreground prose-pre:border prose-pre:border-border prose-pre:rounded-md [&_table]:!border-[color:var(--border)] [&_th]:!border-[color:var(--border)] [&_td]:!border-[color:var(--border)]","dangerouslySetInnerHTML":{"__html":"<h1>Create a Gmail Filter</h1>\n<blockquote>\n<p><strong>PREREQUISITE:</strong> Load the following skills to execute this recipe: <code>gws-gmail</code></p>\n</blockquote>\n<p>Create a Gmail filter to automatically label, star, or categorize incoming messages.</p>\n<h2>Steps</h2>\n<ol>\n<li>List existing labels: <code>gws gmail users labels list --params '{"userId": "me"}' --format table</code></li>\n<li>Create a new label: <code>gws gmail users labels create --params '{"userId": "me"}' --json '{"name": "Receipts"}'</code></li>\n<li>Create a filter: <code>gws gmail users settings filters create --params '{"userId": "me"}' --json '{"criteria": {"from": "receipts@example.com"}, "action": {"addLabelIds": ["LABEL_ID"], "removeLabelIds": ["INBOX"]}}'</code></li>\n<li>Verify filter: <code>gws gmail users settings filters list --params '{"userId": "me"}' --format table</code></li>\n</ol>"}}]