recipe-create-gmail-filter

Creates Gmail filters that label, star, or categorize incoming messages via the gws CLI.

Updated Nov 9, 2023
One-click install
npx skills add https://github.com/oresttokovenko/dot-files --skill recipe-create-gmail-filter-oresttokovenko
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: recipe-create-gmail-filter
Source: https://github.com/oresttokovenko/dot-files/tree/main/chezmoi/dot_agents/skills/recipe-create-gmail-filter
Command: npx skills add https://github.com/oresttokovenko/dot-files --skill recipe-create-gmail-filter-oresttokovenko

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Manually sorting incoming email is repetitive and error-prone. This Skill automates the creation of Gmail filters so messages matching specific criteria are automatically labeled, starred, or removed from the inbox. ## Core Features & Use Cases - Label Management: List existing Gmail labels and create new ones before wiring them into filters. - Filter Creation: Define filter criteria (such as sender address) and actions (add labels, remove from inbox) through the Gmail API via the gws CLI. - Verification: List configured filters to confirm the rule was applied correctly. - Use Case: Automatically route all messages from [email protected] into a Receipts label and skip the inbox, keeping your primary inbox clean. ## Quick Start Ask the assistant to create a Gmail filter that applies a Receipts label to all emails from [email protected] and skips the inbox.

Frequently Asked Questions about recipe-create-gmail-filter

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Gmail filter from the command line?

Use the gws CLI to call the Gmail API filters endpoint with JSON criteria and actions. For example, gws gmail users settings filters create with a criteria.from address and an action that adds a label ID creates the filter.

How do I create a Gmail label before using it in a filter?

Run gws gmail users labels create with a JSON body containing the label name, such as {"name": "Receipts"}. The returned label ID is then referenced in the filter's addLabelIds action.

Can a Gmail filter skip the inbox automatically?

Yes. Include "INBOX" in the filter action's removeLabelIds array when creating the filter. Matching messages are then archived directly into the specified label without appearing in the inbox.

How do I verify a Gmail filter was created correctly?

Run gws gmail users settings filters list with userId set to me and the table format flag. The output lists all configured filters so you can confirm the criteria and actions match your intent.

What are the prerequisites for creating Gmail filters with gws?

You need the gws CLI binary installed and the gws-gmail skill loaded, since this recipe builds on its Gmail API commands. Without these, the filter and label commands cannot execute.