Gmail Cleaner for Openclaw

A powerful Python-based automation tool for bulk cleaning, organizing, and managing multiple Gmail accounts using the Gmail API.

cedarscy
v1.0.0
Feb 24, 2026
0
1.4k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install gmail-cleaner

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install gmail-cleaner using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Gmail Cleaner?

Gmail Cleaner is a comprehensive solution within the Openclaw Skills ecosystem designed for users and developers who need to reclaim control over cluttered inboxes. It leverages the official Gmail API to perform high-volume operations—processing up to 1000 messages per call—allowing for rapid scanning, trashing, and permanent deletion of unwanted emails.

Beyond simple deletion, this skill empowers users to establish sophisticated organization systems. It can automatically apply labels, create filters, and execute deep cleaning cycles that archive old messages or purge categories like promotions and social updates. Whether managing a single personal account or orchestrating multiple professional identities, this tool provides the technical infrastructure to maintain a zero-inbox state programmatically.

Gmail Cleaner Use Cases

  • Bulk deleting newsletters and promotional emails from specific senders.
  • Setting up automated Gmail filters and labels for better inbox categorization.
  • Managing and cleaning multiple Gmail accounts simultaneously using distinct OAuth tokens.
  • Rescuing important emails from the trash after accidental bulk deletions.
  • Performing deep clean workflows to archive old messages and mark aged notifications as read.

How Gmail Cleaner Works

  1. Authenticate the application using OAuth credentials from the Google Cloud Console to generate local token files.
  2. Run a scan to identify the top senders and message counts by category for an overview of inbox clutter.
  3. Execute targeted cleanup commands using specific senders, search queries, or JSON configuration files.
  4. Apply organizational logic to create labels and filters based on built-in presets or custom rules.
  5. Use deep clean workflows to automate multi-step maintenance tasks like archiving and trash purging.

Gmail Cleaner Setup

First, ensure you have your OAuth credentials JSON from the Google Cloud Console (Desktop app type). Install the required Python packages and authenticate your account using this Openclaw Skills utility:

# Authenticate and generate a token
python scripts/auth.py --credentials /path/to/credentials.json --token ~/.openclaw/workspace/gmail_token.pkl --scopes settings

Once authenticated, you can scan your inbox to analyze the current state:

# Scan the last 500 messages
python scripts/scan.py --token ~/.openclaw/workspace/gmail_token.pkl --sample 500

Gmail Cleaner Data Schema & Taxonomy

The skill manages account data and automation rules using the following file formats:

File Type Purpose Format
Credentials OAuth client ID and secret from Google Cloud .json
Token Encrypted session data for specific Gmail accounts .pkl
Config Definitions for bulk cleanup and labeling rules .json
Scan Report Console output of sender frequency and category counts CLI Output

Example Senders Config:

[
  {"query": "from:[email protected]", "label": "Newsletters"},
  {"query": "category:promotions older_than:30d", "label": "Expired Promos"}
]

Gmail Cleaner Advanced Features

  • Multi-account support allows switching between personal and work accounts using unique token paths.
  • Custom deep clean cycles with configurable age thresholds for promos, archiving, and unread messages.
  • Batch processing architecture ensures efficiency by handling 1000 messages per API request.
  • Dry-run mode for cleanup scripts to preview deletions before they are permanently executed.
  • Advanced filter creation capabilities that programmatically manage Gmail settings via the settings.basic scope.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*