Skip to content
Skillpedia
Automations32k · #6328

recipe-label-and-archive-emails

Lets your agent organize your Gmail inbox. It applies labels to emails and archives them to keep things tidy.

What it does

This tool organizes your Gmail emails. It applies labels (like categories) and removes emails from your main inbox, keeping it clean.

When to use it

  • ✓When you get many emails from a specific sender.
  • ✓To separate notification emails from other important ones.
  • ✓To keep your inbox organized automatically.

Example of what to ask your AI

“Organize my emails from sender 'notifications@service.com' with the label 'Notifications' and archive them.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/googleworkspace/cli/blob/main/skills/recipe-label-and-archive-emails/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/googleworkspace/cli/blob/main/skills/recipe-label-and-archive-emails/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The tool searches for emails from a specific sender. Then, it adds a label you choose and removes the email from your main inbox.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add googleworkspace/cli --skill recipe-label-and-archive-emails

Or download just the file:

curl -L https://raw.githubusercontent.com/googleworkspace/cli/main/skills/recipe-label-and-archive-emails/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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"]}'
FAQ

Do I need to have Gmail installed?

Yes, this tool works with your Gmail account.

What are labels in Gmail?

Labels are like folders or categories you can use to organize your emails. They help you find messages more easily.

What does it mean to 'archive' an email?

Archiving an email removes it from your main inbox, but it's still saved in your account and can be found later.

Details

Original description by the author

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

repo: googleworkspace/cli

Popularity

GitHub stars
32k
Ranking position
#6328
License
Apache-2.0
Updated
10/6/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills