# recipe-label-and-archive-emails

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

Skill by Google. Category: Documents.

## Install

Project (for this project only):

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

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

Global (for every project on this machine):

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

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

## Tags

- Runs on your computer: It runs as a program on your machine, with your access.

## Security audits

- Gen Agent Trust Hub: Pass
- Socket: Pass
- Snyk: Warn
- Runlayer: Warn
- ZeroLeaks: Pass

Installs: 29499. Installs counted by skills.sh. [Open on skills.sh](https://www.skills.sh/site/googleworkspace.cli/recipe-label-and-archive-emails)

## Source

[Open the source](https://github.com/googleworkspace/cli/tree/HEAD/skills/recipe-label-and-archive-emails). Checked 2026-10-10. This summary may contain AI-generated text, so it can be wrong. Check the source before you rely on it.

## SKILL.md

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

- Previous: [recipe-reschedule-meeting](https://syn4pse.dev/terminal/recipe-reschedule-meeting.md)
- Next: [recipe-save-email-to-doc](https://syn4pse.dev/terminal/recipe-save-email-to-doc.md)
- [Terminal](https://syn4pse.dev/terminal.md)
- [Suggest a change](mailto:terminal@syn4pse.dev?subject=Terminal%20suggestion)
