搜索

PythonReactSEOPDF
OpenClaw

gmail-cleaner

Clean and organize Gmail accounts in bulk. Use when asked to clean Gmail, remove spam, trash newsletters/promotional emails, bulk-delete emails by sender, create labels, set up auto-filters, or restore emails from trash. Handles single or multiple Gmail accounts via OAuth token files. Works with any Gmail account using the Gmail API.

cedarscy0 来源安装数☆ 0 仓库 Stars

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

SkillHub CLI

skillhub install cedarscy/gmail-cleaner

打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。

将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。

查看来源 ↗使用指南

技能说明

Gmail Cleaner

Bulk Gmail cleanup using the Gmail API. Processes 1000 messages per API call.

Prerequisites

  • google-api-python-client, google-auth-oauthlib Python packages (scripts auto-install if missing)
  • OAuth credentials JSON from Google Cloud Console (Desktop app type)
  • Token files stored as .pkl files per account

Workflow

1. Auth (first time or new account)
python scripts/auth.py --credentials /path/to/credentials.json --token /path/to/token.pkl --scopes settings
  • basic scopes: read/modify/delete messages + labels
  • settings scopes: adds gmail.settings.basic (required for creating filters)
  • Default token path: ~/.openclaw/workspace/gmail_token.pkl
  • Default creds path: ~/.openclaw/workspace/gmail_credentials.json

For a second account, specify a different --token path (e.g., gmail_token_work.pkl).

2. Scan (identify what to clean)
python scripts/scan.py --token /path/to/token.pkl --sample 500

Shows inbox counts by category + top 40 senders. Run this first.

3. Clean (bulk trash/delete)
# Trash specific senders:
python scripts/clean.py --from "spam@example.com,news@example.org"

# Trash by Gmail search query:
python scripts/clean.py --query "category:promotions older_than:30d"

# From a JSON config file (list of {query, label}):
python scripts/clean.py --config senders.json

# Permanently delete instead of trash:
python scripts/clean.py --from "spam@example.com" --delete

# Dry run first:
python scripts/clean.py --from "spam@example.com" --dry-run
4. Deep Clean (comprehensive)
# Full deep clean (4 steps: trash promos → archive old → mark read → purge trash):
python scripts/deep_clean.py

# Custom age thresholds:
python scripts/deep_clean.py --promo-days 7 --archive-days 30 --unread-days 14

# Skip trash purge (keep trash for 30-day auto-delete):
python scripts/deep_clean.py --skip-trash-purge
5. Organize (labels + filters)
# Apply built-i...

来源信息

Source
github
Repository
openclaw/skills
Path
skills/cedarscy/gmail-cleaner
Version
—
Commit
472c54113ea3b238d8be799d8e1e82fe44847e65
分类来源
rules
状态
active
可见性
public

这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。

来源内容

SKILL.md
# Gmail Cleaner

Bulk Gmail cleanup using the Gmail API. Processes 1000 messages per API call.

## Prerequisites

- `google-api-python-client`, `google-auth-oauthlib` Python packages (scripts auto-install if missing)
- OAuth credentials JSON from Google Cloud Console (Desktop app type)
- Token files stored as `.pkl` files per account

## Workflow

### 1. Auth (first time or new account)

```bash
python scripts/auth.py --credentials /path/to/credentials.json --token /path/to/token.pkl --scopes settings
```

- `basic` scopes: read/modify/delete messages + labels  
- `settings` scopes: adds `gmail.settings.basic` (required for creating filters)  
- Default token path: `~/.openclaw/workspace/gmail_token.pkl`
- Default creds path: `~/.openclaw/workspace/gmail_credentials.json`

For a second account, specify a different `--token` path (e.g., `gmail_token_work.pkl`).

### 2. Scan (identify what to clean)

```bash
python scripts/scan.py --token /path/to/token.pkl --sample 500
```

Shows inbox counts by category + top 40 senders. Run this first.

### 3. Clean (bulk trash/delete)

```bash
# Trash specific senders:
python scripts/clean.py --from "spam@example.com,news@example.org"

# Trash by Gmail search query:
python scripts/clean.py --query "category:promotions older_than:30d"

# From a JSON config file (list of {query, label}):
python scripts/clean.py --config senders.json

# Permanently delete instead of trash:
python scripts/clean.py --from "spam@example.com" --delete

# Dry run first:
python scripts/clean.py --from "spam@example.com" --dry-run
```

### 4. Deep Clean (comprehensive)

```bash
# Full deep clean (4 steps: trash promos → archive old → mark read → purge trash):
python scripts/deep_clean.py

# Custom age thresholds:
python scripts/deep_clean.py --promo-days 7 --archive-days 30 --unread-days 14

# Skip trash purge (keep trash for 30-day auto-delete):
python scripts/deep_clean.py --skip-trash-purge
```

### 5. Organize (labels + filters)

```bash
# Apply built-i...

相关技能

OpenClaw

ai-maestro

23blocks-os

AI Agent Orchestrator with Skills System - Give AI Agents superpowers: memory search, code graph queries, agent-to-agent messaging. Manage Claude, Codex or any AI Agent from one dashboard. Move Agents between c...

OpenClaw

registry-broker-skills

hashgraph-online

AI agent skills for the Universal Registry - search, chat, and register 72,000+ agents across 14+ protocols. Works with Claude, Codex, Cursor, OpenClaw, and any AI assistant.

OpenClaw

skills-manager

rito-w

A cross-platform skills manager for AI IDEs. Search marketplace, download locally, and install to Claude, Cursor, Windsurf, and more with one click.