email-cleanup
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseABOUTME: 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 for account config and commands.
../_GMAIL.mdGmail: 账户配置和命令请查看。
../_GMAIL.mdSafety Rules
安全规则
- NEVER delete without confirmation - show counts first
- Archive over delete - prefer archiving (recoverable)
- Batch in chunks - max 50 at a time
- 未经确认绝不删除 - 先显示数量
- 优先归档而非删除 - 优先选择归档(可恢复)
- 分批处理 - 每次最多50封
Cleanup Targets
清理目标
| Category | Query | Action |
|---|---|---|
| Promotions | | Archive |
| Social | | Archive |
| Read updates | | Archive |
| Large emails | | Review individually |
| Unsubscribe candidates | | Review |
| 分类 | 查询语句 | 操作 |
|---|---|---|
| 促销邮件 | | 归档 |
| 社交邮件 | | 归档 |
| 已读更新邮件 | | 归档 |
| 大邮件 | | 单独审核 |
| 可退订候选邮件 | | 审核 |
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
doneProcess 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.combash
gog gmail labels get INBOX --account=maroffo@gmail.com
gog gmail labels get CATEGORY_PROMOTIONS --account=maroffo@gmail.com