{
  "schemaVersion": "1.0",
  "item": {
    "slug": "gmail-cleaner",
    "name": "Gmail Cleaner",
    "source": "tencent",
    "type": "skill",
    "category": "效率提升",
    "sourceUrl": "https://clawhub.ai/cedarscy/gmail-cleaner",
    "canonicalUrl": "https://clawhub.ai/cedarscy/gmail-cleaner",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/gmail-cleaner",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=gmail-cleaner",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "scripts/auth.py",
      "scripts/clean.py",
      "scripts/deep_clean.py",
      "scripts/organize.py",
      "scripts/restore.py",
      "scripts/scan.py"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/gmail-cleaner"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/gmail-cleaner",
    "agentPageUrl": "https://openagent3.xyz/skills/gmail-cleaner/agent",
    "manifestUrl": "https://openagent3.xyz/skills/gmail-cleaner/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/gmail-cleaner/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Gmail Cleaner",
        "body": "Bulk Gmail cleanup using the Gmail API. Processes 1000 messages per API call."
      },
      {
        "title": "Prerequisites",
        "body": "google-api-python-client, google-auth-oauthlib Python packages (scripts auto-install if missing)\nOAuth credentials JSON from Google Cloud Console (Desktop app type)\nToken files stored as .pkl files per account"
      },
      {
        "title": "1. Auth (first time or new account)",
        "body": "python scripts/auth.py --credentials /path/to/credentials.json --token /path/to/token.pkl --scopes settings\n\nbasic scopes: read/modify/delete messages + labels\nsettings scopes: adds gmail.settings.basic (required for creating filters)\nDefault token path: ~/.openclaw/workspace/gmail_token.pkl\nDefault creds path: ~/.openclaw/workspace/gmail_credentials.json\n\nFor a second account, specify a different --token path (e.g., gmail_token_work.pkl)."
      },
      {
        "title": "2. Scan (identify what to clean)",
        "body": "python scripts/scan.py --token /path/to/token.pkl --sample 500\n\nShows inbox counts by category + top 40 senders. Run this first."
      },
      {
        "title": "3. Clean (bulk trash/delete)",
        "body": "# Trash specific senders:\npython scripts/clean.py --from \"spam@example.com,news@example.org\"\n\n# Trash by Gmail search query:\npython scripts/clean.py --query \"category:promotions older_than:30d\"\n\n# From a JSON config file (list of {query, label}):\npython scripts/clean.py --config senders.json\n\n# Permanently delete instead of trash:\npython scripts/clean.py --from \"spam@example.com\" --delete\n\n# Dry run first:\npython scripts/clean.py --from \"spam@example.com\" --dry-run"
      },
      {
        "title": "4. Deep Clean (comprehensive)",
        "body": "# Full deep clean (4 steps: trash promos → archive old → mark read → purge trash):\npython scripts/deep_clean.py\n\n# Custom age thresholds:\npython scripts/deep_clean.py --promo-days 7 --archive-days 30 --unread-days 14\n\n# Skip trash purge (keep trash for 30-day auto-delete):\npython scripts/deep_clean.py --skip-trash-purge"
      },
      {
        "title": "5. Organize (labels + filters)",
        "body": "# Apply built-in label set (Business, Banking, Tech, Personal, Trading, Social):\npython scripts/organize.py\n\n# Custom labels/rules/filters from JSON:\npython scripts/organize.py --config labels.json\n\n# Labels only (no filters):\npython scripts/organize.py --skip-filters"
      },
      {
        "title": "6. Restore (rescue emails from trash)",
        "body": "# Restore all emails from a sender + apply a label:\npython scripts/restore.py --from healthbeat@mail.health.harvard.edu --label \"Harvard Health\"\n\n# Restore by query:\npython scripts/restore.py --query \"from:apple.com in:trash\" --label \"Tech/Apple\""
      },
      {
        "title": "Multiple Accounts",
        "body": "Run each script with a different --token path per account:\n\npython scripts/scan.py    --token ~/.openclaw/workspace/gmail_token_personal.pkl\npython scripts/scan.py    --token ~/.openclaw/workspace/gmail_token_work.pkl\npython scripts/deep_clean.py --token ~/.openclaw/workspace/gmail_token_work.pkl"
      },
      {
        "title": "Common Patterns",
        "body": "Full cleanup for one account:\n\npython scripts/auth.py --scopes settings\npython scripts/scan.py                         # identify top senders\npython scripts/clean.py --from \"...\"          # trash specific senders\npython scripts/deep_clean.py                   # clean categories\npython scripts/organize.py                     # create labels + filters\n\nRescue important emails caught in bulk delete:\n\npython scripts/restore.py --from important@example.com --label \"Important\"\n\nSenders config file format for clean.py --config:\n\n[\n  {\"query\": \"from:temu@eu.temuemail.com\", \"label\": \"Temu\"},\n  {\"query\": \"category:promotions older_than:7d\", \"label\": \"Old Promos\"}\n]"
      },
      {
        "title": "Notes",
        "body": "batchModify moves to TRASH — Gmail auto-purges after 30 days\nbatchDelete is permanent and irreversible — always dry-run first\nGmail filter creation requires gmail.settings.basic scope — re-auth with --scopes settings if filters fail with 403\nscan.py samples N messages; large inboxes may need --sample 2000 for accuracy\nCredentials JSON comes from Google Cloud Console → APIs & Services → Credentials → OAuth 2.0 → Desktop → Download JSON"
      }
    ],
    "body": "Gmail Cleaner\n\nBulk Gmail cleanup using the Gmail API. Processes 1000 messages per API call.\n\nPrerequisites\ngoogle-api-python-client, google-auth-oauthlib Python packages (scripts auto-install if missing)\nOAuth credentials JSON from Google Cloud Console (Desktop app type)\nToken files stored as .pkl files per account\nWorkflow\n1. Auth (first time or new account)\npython scripts/auth.py --credentials /path/to/credentials.json --token /path/to/token.pkl --scopes settings\n\nbasic scopes: read/modify/delete messages + labels\nsettings scopes: adds gmail.settings.basic (required for creating filters)\nDefault token path: ~/.openclaw/workspace/gmail_token.pkl\nDefault creds path: ~/.openclaw/workspace/gmail_credentials.json\n\nFor a second account, specify a different --token path (e.g., gmail_token_work.pkl).\n\n2. Scan (identify what to clean)\npython scripts/scan.py --token /path/to/token.pkl --sample 500\n\n\nShows inbox counts by category + top 40 senders. Run this first.\n\n3. Clean (bulk trash/delete)\n# Trash specific senders:\npython scripts/clean.py --from \"spam@example.com,news@example.org\"\n\n# Trash by Gmail search query:\npython scripts/clean.py --query \"category:promotions older_than:30d\"\n\n# From a JSON config file (list of {query, label}):\npython scripts/clean.py --config senders.json\n\n# Permanently delete instead of trash:\npython scripts/clean.py --from \"spam@example.com\" --delete\n\n# Dry run first:\npython scripts/clean.py --from \"spam@example.com\" --dry-run\n\n4. Deep Clean (comprehensive)\n# Full deep clean (4 steps: trash promos → archive old → mark read → purge trash):\npython scripts/deep_clean.py\n\n# Custom age thresholds:\npython scripts/deep_clean.py --promo-days 7 --archive-days 30 --unread-days 14\n\n# Skip trash purge (keep trash for 30-day auto-delete):\npython scripts/deep_clean.py --skip-trash-purge\n\n5. Organize (labels + filters)\n# Apply built-in label set (Business, Banking, Tech, Personal, Trading, Social):\npython scripts/organize.py\n\n# Custom labels/rules/filters from JSON:\npython scripts/organize.py --config labels.json\n\n# Labels only (no filters):\npython scripts/organize.py --skip-filters\n\n6. Restore (rescue emails from trash)\n# Restore all emails from a sender + apply a label:\npython scripts/restore.py --from healthbeat@mail.health.harvard.edu --label \"Harvard Health\"\n\n# Restore by query:\npython scripts/restore.py --query \"from:apple.com in:trash\" --label \"Tech/Apple\"\n\nMultiple Accounts\n\nRun each script with a different --token path per account:\n\npython scripts/scan.py    --token ~/.openclaw/workspace/gmail_token_personal.pkl\npython scripts/scan.py    --token ~/.openclaw/workspace/gmail_token_work.pkl\npython scripts/deep_clean.py --token ~/.openclaw/workspace/gmail_token_work.pkl\n\nCommon Patterns\n\nFull cleanup for one account:\n\npython scripts/auth.py --scopes settings\npython scripts/scan.py                         # identify top senders\npython scripts/clean.py --from \"...\"          # trash specific senders\npython scripts/deep_clean.py                   # clean categories\npython scripts/organize.py                     # create labels + filters\n\n\nRescue important emails caught in bulk delete:\n\npython scripts/restore.py --from important@example.com --label \"Important\"\n\n\nSenders config file format for clean.py --config:\n\n[\n  {\"query\": \"from:temu@eu.temuemail.com\", \"label\": \"Temu\"},\n  {\"query\": \"category:promotions older_than:7d\", \"label\": \"Old Promos\"}\n]\n\nNotes\nbatchModify moves to TRASH — Gmail auto-purges after 30 days\nbatchDelete is permanent and irreversible — always dry-run first\nGmail filter creation requires gmail.settings.basic scope — re-auth with --scopes settings if filters fail with 403\nscan.py samples N messages; large inboxes may need --sample 2000 for accuracy\nCredentials JSON comes from Google Cloud Console → APIs & Services → Credentials → OAuth 2.0 → Desktop → Download JSON"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/cedarscy/gmail-cleaner",
    "publisherUrl": "https://clawhub.ai/cedarscy/gmail-cleaner",
    "owner": "cedarscy",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/gmail-cleaner",
    "downloadUrl": "https://openagent3.xyz/downloads/gmail-cleaner",
    "agentUrl": "https://openagent3.xyz/skills/gmail-cleaner/agent",
    "manifestUrl": "https://openagent3.xyz/skills/gmail-cleaner/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/gmail-cleaner/agent.md"
  }
}