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
Ready-to-paste message
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-emailsOr download just the file:
curl -L https://raw.githubusercontent.com/googleworkspace/cli/main/skills/recipe-label-and-archive-emails/SKILL.md -o SKILL.mdTechnical 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
- Search for matching emails:
gws gmail users messages list --params '{"userId": "me", "q": "from:notifications@service.com"}' --format table - Apply a label:
gws gmail users messages modify --params '{"userId": "me", "id": "MESSAGE_ID"}' --json '{"addLabelIds": ["LABEL_ID"]}' - 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
Comments
- …
More skills from this repository
gws-admin-reports
Helps your agent get activity reports from Google Workspace. It collects audit and usage data.
googleworkspace/cli
gws-calendar-agenda
Helps your agent see upcoming events across all calendars. It's useful for organizing your schedule and knowing what's coming up.
googleworkspace/cli
gws-calendar-insert
Lets your agent create new events in Google Calendar. It's useful for scheduling appointments and meetings.
googleworkspace/cli
gws-calendar
Allows your agent to manage calendars and events. It's useful for organizing your life and work.
googleworkspace/cli
Similar skills
benchmark
Helps your agent measure code speed and performance. It's useful for ensuring things are fast and finding slowness issues.
affaan-m/ECC
content-hash-cache-pattern
Lets your agent use content hashes to cache file processing results. This avoids repeated processing and auto-invalidates the cache when content changes. Useful for speeding up slow tasks.
affaan-m/ECC
parallel-execution-optimizer
Makes your agent speed up complex tasks by breaking them into smaller parts and running them in parallel. It ensures everything is verified at the end.
affaan-m/ECC