PluginBench
Skill
Review
Audit score 70

recipe-label-and-archive-emails

googleworkspace/cli

Apply Gmail labels to matching messages and archive them to keep your inbox clean.

What is recipe-label-and-archive-emails?

This recipe automates Gmail organization by searching for messages matching specific criteria, applying custom labels, and archiving them. Use it to automatically sort and remove emails from your inbox based on sender, subject, or other filters.

  • Search Gmail for messages matching custom query criteria
  • Apply custom labels to matching messages
  • Archive messages by removing them from the inbox
  • Batch process multiple emails with a single workflow
  • Keep inbox focused by automatically organizing notifications and low-priority mail

How to install recipe-label-and-archive-emails

npx skills add null --skill recipe-label-and-archive-emails
Prerequisites
  • gws-gmail skill installed and configured
  • Google Workspace account with Gmail access
  • gws CLI tool installed and authenticated
Claude Code
Cursor
Windsurf
Cline

How to use recipe-label-and-archive-emails

  1. 1.Search for emails matching your criteria using gws gmail users messages list with a query filter (e.g., from:notifications@service.com)
  2. 2.Note the MESSAGE_ID values from the search results
  3. 3.Create or identify the LABEL_ID for the label you want to apply
  4. 4.Use gws gmail users messages modify to add the label to each message
  5. 5.Use gws gmail users messages modify again to remove the INBOX label, archiving the message
  6. 6.Repeat for additional messages or automate with a script for batch processing

Use cases

Good for
  • Automatically label and archive notification emails from services to reduce inbox clutter
  • Sort emails from specific senders into labeled folders while removing them from inbox view
  • Organize promotional or marketing emails with a label and archive them systematically
  • Create a workflow to handle recurring email patterns without manual intervention
  • Maintain inbox zero by automatically processing emails matching defined rules
Who it's for
  • Gmail users managing high email volume
  • Productivity-focused professionals seeking inbox automation
  • Teams using Google Workspace for email management
  • Anyone wanting to reduce manual email organization tasks

recipe-label-and-archive-emails FAQ

How do I find the LABEL_ID for a label?

Use gws gmail users labels list to retrieve all labels and their IDs for your account.

Can I apply multiple labels at once?

Yes, you can include multiple label IDs in the addLabelIds array when modifying a message.

Does archiving delete the email?

No, archiving only removes the email from your inbox view. It remains in your Gmail account and can be found via search or in the All Mail folder.

Can I undo an archive operation?

Yes, you can re-add the INBOX label to a message using the same modify command with addLabelIds set to INBOX.

How do I automate this for recurring emails?

Create a script that runs the search and modify commands on a schedule, or use Gmail filters in combination with this recipe for automated labeling.

Full instructions (SKILL.md)

Source of truth, from googleworkspace/cli.


name: recipe-label-and-archive-emails description: "Apply Gmail labels to matching messages and archive them to keep your inbox clean." metadata: version: 0.22.5 openclaw: category: "recipe" domain: "productivity" requires: bins: - gws skills: - gws-gmail

Label and Archive Gmail Threads

PREREQUISITE: Load the following skills to execute this recipe: gws-gmail

Apply Gmail labels to matching messages and archive them to keep your inbox clean.

Steps

  1. Search for matching emails: gws gmail users messages list --params '{"userId": "me", "q": "from:notifications@service.com"}' --format table
  2. Apply a label: gws gmail users messages modify --params '{"userId": "me", "id": "MESSAGE_ID"}' --json '{"addLabelIds": ["LABEL_ID"]}'
  3. Archive (remove from inbox): gws gmail users messages modify --params '{"userId": "me", "id": "MESSAGE_ID"}' --json '{"removeLabelIds": ["INBOX"]}'