# Recipe Create Gmail Filter > Create a Gmail filter to automatically label, star, or categorize incoming messages. Source: https://skillsagentes.com/skills/googleworkspace/cli/recipe-create-gmail-filter Repository: https://github.com/googleworkspace/cli Author: googleworkspace License: Apache-2.0 Updated: hace 4 meses Context cost: 21 tok installed, 260 tok once triggered, 260 tok with every bundled file Bundle: 1 file, 1 KB Permissions requested: none declared ## Install ```bash npx -y skills add googleworkspace/cli --skill recipe-create-gmail-filter --agent claude-code ``` ## What it does - Lista las etiquetas de Gmail existentes con `gws gmail users labels list` - Crea una nueva etiqueta con `gws gmail users labels create` - Crea un filtro de Gmail con criterios y acciones usando `gws gmail users settings filters create` - Verifica el filtro creado con `gws gmail users settings filters list` ## Use it when - Cuando se quiere etiquetar, destacar o categorizar automáticamente los mensajes entrantes de Gmail ## What triggers it - "Crea un filtro en Gmail que etiquete los correos de receipts@example.com como Recibos" - "Quiero que los mensajes de un remitente se archiven automáticamente fuera de la bandeja de entrada" ## Before you install - Requiere el binario `gws` y tener cargada la skill `gws-gmail`. ## Files - SKILL.md — 1 KB ## SKILL.md Reproduced verbatim from googleworkspace/cli under Apache-2.0. This section is the upstream document and is in English. # 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` --- Skills Agentes — https://skillsagentes.com/skills/googleworkspace/cli/recipe-create-gmail-filter