email-cleanup

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ABOUTME: Gmail bulk cleanup - archive old emails, delete promotions, free storage

ABOUTME: Gmail批量清理 - 归档旧邮件、删除促销邮件、释放存储空间

ABOUTME: Parameterized batch operations with safety-first approach

ABOUTME: 采用安全优先的参数化批量操作

Email Cleanup Skill

邮箱清理Skill

Gmail: See
../_GMAIL.md
for account config and commands.
Gmail: 账户配置和命令请查看
../_GMAIL.md

Safety Rules

安全规则

  1. NEVER delete without confirmation - show counts first
  2. Archive over delete - prefer archiving (recoverable)
  3. Batch in chunks - max 50 at a time
  1. 未经确认绝不删除 - 先显示数量
  2. 优先归档而非删除 - 优先选择归档(可恢复)
  3. 分批处理 - 每次最多50封

Cleanup Targets

清理目标

CategoryQueryAction
Promotions
category:promotions older_than:30d
Archive
Social
category:social older_than:14d
Archive
Read updates
category:updates is:read older_than:7d
Archive
Large emails
larger:10M
Review individually
Unsubscribe candidates
unsubscribe is:read older_than:30d
Review
分类查询语句操作
促销邮件
category:promotions older_than:30d
归档
社交邮件
category:social older_than:14d
归档
已读更新邮件
category:updates is:read older_than:7d
归档
大邮件
larger:10M
单独审核
可退订候选邮件
unsubscribe is:read older_than:30d
审核

Workflow

工作流程

Step 1: Count each category

步骤1:统计各分类邮件数量

bash
gog gmail search "<query>" --account=maroffo@gmail.com --json | jq '.resultSizeEstimate'
bash
gog gmail search "<query>" --account=maroffo@gmail.com --json | jq '.resultSizeEstimate'

Step 2: Present summary table with counts and suggested actions

步骤2:展示包含数量和建议操作的汇总表格

Step 3: Execute (with confirmation)

步骤3:执行操作(需确认)

bash
THREADS=$(gog gmail search "<query>" --account=maroffo@gmail.com --json --max=50 | jq -r '.threads[].id')
for tid in $THREADS; do
  gog gmail thread modify $tid --account=maroffo@gmail.com --remove-labels=INBOX
done
Process in batches of 50. Report progress.
bash
THREADS=$(gog gmail search "<query>" --account=maroffo@gmail.com --json --max=50 | jq -r '.threads[].id')
for tid in $THREADS; do
  gog gmail thread modify $tid --account=maroffo@gmail.com --remove-labels=INBOX
done
分批处理,每批50封。汇报进度。

Quick Stats

快速统计

bash
gog gmail labels get INBOX --account=maroffo@gmail.com
gog gmail labels get CATEGORY_PROMOTIONS --account=maroffo@gmail.com
bash
gog gmail labels get INBOX --account=maroffo@gmail.com
gog gmail labels get CATEGORY_PROMOTIONS --account=maroffo@gmail.com