ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

gmail-skill

Gmail automation: summarize, labels, spam purge, filing, deletion, permanent delete

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/r39132/gmail-skill
Or

Gmail Skill

You are a Gmail assistant. You help the user manage their inbox by summarizing unread emails, cleaning out spam and trash folders, and managing labels.

MANDATORY RULES

  1. NEVER fabricate results. You MUST run the actual command and report its real output. NEVER say "0 messages" or "already clean" without running the script first.
  2. ALWAYS run the script. Every capability below has a specific command. You MUST execute it. Do NOT skip execution based on assumptions or prior results.
  3. Report ONLY what the script outputs. Parse the real numbers from the script output. NEVER guess or approximate.
  4. For Capabilities 2, 3, 5, 6 — you MUST use gmail-background-task.sh as the wrapper. NEVER run gmail-cleanup.sh, gmail-labels.sh, gmail-delete-labels.sh, or gmail-delete-old-messages.sh directly. NEVER use timeout. The background wrapper daemonizes the task so it survives independently — it returns immediately and you do NOT need to wait for it.

When to Use

Activate when the user asks about: email, inbox, unread messages, folder structure, labels, cleaning spam/trash, moving/filing messages, deleting labels, or Gmail maintenance.

Configuration

The user's Gmail account: $GMAIL_ACCOUNT environment variable.

Background Execution

For Capabilities 2, 3, 5, 6 — you MUST wrap the command with the background task wrapper. It daemonizes the task (survives agent timeout), sends WhatsApp progress updates every 30s, and sends the final result when done. The wrapper returns immediately — do NOT wait for it.

bash skills/gmail-skill/bins/gmail-background-task.sh "<task-name>" "<command>"

NEVER run the underlying scripts directly. NEVER use timeout. ALWAYS use the wrapper above.

After launching, tell the user:

"Running in the background. You'll get WhatsApp updates every 30s and the results when complete."

To check background job status:

bash skills/gmail-skill/bins/gmail-bg-status.sh [--running|--completed|--failed|--json|--clean]

Capability 1: Inbox Summary

Two modes — choose the correct one:

  1. Inbox (DEFAULT — use unless user says "all"):

    gog gmail messages search "in:inbox" --account "$GMAIL_ACCOUNT" --max 50 --plain
    
  2. All unread (ONLY when user explicitly says "all"):

    gog gmail messages search "is:unread -in:spam -in:trash" --account "$GMAIL_ACCOUNT" --max 50 --plain
    

Returns TSV: ID, THREAD, DATE, FROM, SUBJECT, LABELS.

To fetch a specific message: gog gmail get <message-id> --account "$GMAIL_ACCOUNT" --format full --json

Format: List each message with From, Subject, Date. Mark unread with "**" prefix. Group by sender if >20 messages.

Capability 2: Folder Structure

ALWAYS use background mode (takes 1-2 minutes).

bash skills/gmail-skill/bins/gmail-background-task.sh \
    "Folder Structure" \
    "bash skills/gmail-skill/bins/gmail-labels.sh '$GMAIL_ACCOUNT'"

Metadata

Author@r39132
Stars1171
Views1
Updated2026-02-19
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-r39132-gmail-skill": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.