{
  "schemaVersion": "1.0",
  "item": {
    "slug": "clawemail",
    "name": "Clawemail",
    "source": "tencent",
    "type": "skill",
    "category": "效率提升",
    "sourceUrl": "https://clawhub.ai/cto1/clawemail",
    "canonicalUrl": "https://clawhub.ai/cto1/clawemail",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/clawemail",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=clawemail",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "scripts/token.sh"
    ],
    "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/clawemail"
    },
    "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/clawemail",
    "agentPageUrl": "https://openagent3.xyz/skills/clawemail/agent",
    "manifestUrl": "https://openagent3.xyz/skills/clawemail/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/clawemail/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": "Claw — Google Workspace for AI Agents",
        "body": "Use claw for Gmail, Drive, Docs, Sheets, Slides, Calendar, and Forms via your @clawemail.com account."
      },
      {
        "title": "Setup",
        "body": "Save your ClawEmail credentials JSON to ~/.config/clawemail/credentials.json\nSet the environment variable: export CLAWEMAIL_CREDENTIALS=~/.config/clawemail/credentials.json\n\nGet credentials at https://clawemail.com — sign up, then visit /connect/YOUR_PREFIX to authorize OAuth."
      },
      {
        "title": "Getting an Access Token",
        "body": "All API calls need a Bearer token. Use the helper script to refresh and cache it:\n\nTOKEN=$(~/.openclaw/skills/clawemail/scripts/token.sh)\n\nThe script caches tokens for 50 minutes. Always assign to TOKEN before making API calls."
      },
      {
        "title": "Search emails",
        "body": "TOKEN=$(~/.openclaw/skills/clawemail/scripts/token.sh)\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://gmail.googleapis.com/gmail/v1/users/me/messages?q=newer_than:7d&maxResults=10\" | python3 -m json.tool\n\nCommon query operators: from:, to:, subject:, newer_than:, older_than:, is:unread, has:attachment, label:, in:inbox."
      },
      {
        "title": "Read a message",
        "body": "curl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://gmail.googleapis.com/gmail/v1/users/me/messages/MESSAGE_ID?format=full\" | python3 -m json.tool\n\nFor plain text body only, use format=minimal and decode the payload. For readable output:\n\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://gmail.googleapis.com/gmail/v1/users/me/messages/MESSAGE_ID?format=full\" \\\n  | python3 -c \"\nimport json,sys,base64\nm=json.load(sys.stdin)\nhdrs={h['name']:h['value'] for h in m['payload']['headers']}\nprint(f\\\"From: {hdrs.get('From','')}\\nTo: {hdrs.get('To','')}\\nSubject: {hdrs.get('Subject','')}\\nDate: {hdrs.get('Date','')}\\n\\\")\ndef get_body(part):\n    if part.get('body',{}).get('data'):\n        return base64.urlsafe_b64decode(part['body']['data']).decode('utf-8','replace')\n    for p in part.get('parts',[]):\n        if p['mimeType']=='text/plain': return get_body(p)\n    for p in part.get('parts',[]):\n        b=get_body(p)\n        if b: return b\n    return ''\nprint(get_body(m['payload']))\n\""
      },
      {
        "title": "Send an email",
        "body": "TOKEN=$(~/.openclaw/skills/clawemail/scripts/token.sh)\npython3 -c \"\nimport base64,json\nraw = base64.urlsafe_b64encode(\n    b'To: recipient@example.com\\r\\nSubject: Hello\\r\\nContent-Type: text/plain; charset=utf-8\\r\\n\\r\\nMessage body here'\n).decode()\nprint(json.dumps({'raw': raw}))\n\" | curl -s -X POST \\\n  -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d @- \\\n  \"https://gmail.googleapis.com/gmail/v1/users/me/messages/send\"\n\nFor HTML emails, replace Content-Type: text/plain with Content-Type: text/html and use HTML in the body."
      },
      {
        "title": "Reply to a message",
        "body": "Same as send, but add In-Reply-To: and References: headers from the original message, and include threadId in the JSON body:\n\npython3 -c \"\nimport base64,json\nraw = base64.urlsafe_b64encode(\n    b'To: recipient@example.com\\r\\nSubject: Re: Original Subject\\r\\nIn-Reply-To: <original-message-id>\\r\\nReferences: <original-message-id>\\r\\nContent-Type: text/plain; charset=utf-8\\r\\n\\r\\nReply body'\n).decode()\nprint(json.dumps({'raw': raw, 'threadId': 'THREAD_ID'}))\n\" | curl -s -X POST \\\n  -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d @- \\\n  \"https://gmail.googleapis.com/gmail/v1/users/me/messages/send\""
      },
      {
        "title": "List labels",
        "body": "curl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://gmail.googleapis.com/gmail/v1/users/me/labels\" | python3 -m json.tool"
      },
      {
        "title": "Add/remove labels",
        "body": "curl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"addLabelIds\":[\"LABEL_ID\"],\"removeLabelIds\":[\"INBOX\"]}' \\\n  \"https://gmail.googleapis.com/gmail/v1/users/me/messages/MESSAGE_ID/modify\""
      },
      {
        "title": "List files",
        "body": "TOKEN=$(~/.openclaw/skills/clawemail/scripts/token.sh)\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://www.googleapis.com/drive/v3/files?pageSize=20&fields=files(id,name,mimeType,modifiedTime,size)&orderBy=modifiedTime desc\" | python3 -m json.tool"
      },
      {
        "title": "Search files",
        "body": "curl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://www.googleapis.com/drive/v3/files?q=name+contains+'report'&fields=files(id,name,mimeType,modifiedTime)\" | python3 -m json.tool\n\nQuery operators: name contains 'term', mimeType='application/vnd.google-apps.document', 'FOLDER_ID' in parents, trashed=false, modifiedTime > '2025-01-01'.\n\nCommon MIME types:\n\nDocument: application/vnd.google-apps.document\nSpreadsheet: application/vnd.google-apps.spreadsheet\nPresentation: application/vnd.google-apps.presentation\nFolder: application/vnd.google-apps.folder\nForm: application/vnd.google-apps.form"
      },
      {
        "title": "Create a folder",
        "body": "curl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"My Folder\",\"mimeType\":\"application/vnd.google-apps.folder\"}' \\\n  \"https://www.googleapis.com/drive/v3/files?fields=id,name\" | python3 -m json.tool"
      },
      {
        "title": "Upload a file",
        "body": "curl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -F \"metadata={\\\"name\\\":\\\"report.pdf\\\"};type=application/json\" \\\n  -F \"file=@/path/to/report.pdf;type=application/pdf\" \\\n  \"https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart&fields=id,name\" | python3 -m json.tool"
      },
      {
        "title": "Download a file",
        "body": "For Google Docs/Sheets/Slides (export):\n\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://www.googleapis.com/drive/v3/files/FILE_ID/export?mimeType=application/pdf\" -o output.pdf\n\nExport formats: text/plain, text/html, application/pdf, application/vnd.openxmlformats-officedocument.wordprocessingml.document (docx), text/csv (sheets).\n\nFor binary files (download):\n\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://www.googleapis.com/drive/v3/files/FILE_ID?alt=media\" -o output.file"
      },
      {
        "title": "Share a file",
        "body": "curl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"role\":\"writer\",\"type\":\"user\",\"emailAddress\":\"user@example.com\"}' \\\n  \"https://www.googleapis.com/drive/v3/files/FILE_ID/permissions\"\n\nRoles: reader, commenter, writer, owner. Types: user, group, domain, anyone."
      },
      {
        "title": "Delete a file",
        "body": "curl -s -X DELETE -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://www.googleapis.com/drive/v3/files/FILE_ID\""
      },
      {
        "title": "Create a document",
        "body": "TOKEN=$(~/.openclaw/skills/clawemail/scripts/token.sh)\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"title\":\"My Document\"}' \\\n  \"https://docs.googleapis.com/v1/documents\" | python3 -m json.tool"
      },
      {
        "title": "Read a document",
        "body": "curl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://docs.googleapis.com/v1/documents/DOCUMENT_ID\" | python3 -m json.tool\n\nFor plain text extraction:\n\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://docs.googleapis.com/v1/documents/DOCUMENT_ID\" \\\n  | python3 -c \"\nimport json,sys\ndoc=json.load(sys.stdin)\ntext=''\nfor el in doc.get('body',{}).get('content',[]):\n    for p in el.get('paragraph',{}).get('elements',[]):\n        text+=p.get('textRun',{}).get('content','')\nprint(text)\n\""
      },
      {
        "title": "Append text to a document",
        "body": "curl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"requests\":[{\"insertText\":{\"location\":{\"index\":1},\"text\":\"Hello, world!\\n\"}}]}' \\\n  \"https://docs.googleapis.com/v1/documents/DOCUMENT_ID:batchUpdate\""
      },
      {
        "title": "Replace text in a document",
        "body": "curl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"requests\":[{\"replaceAllText\":{\"containsText\":{\"text\":\"OLD_TEXT\",\"matchCase\":true},\"replaceText\":\"NEW_TEXT\"}}]}' \\\n  \"https://docs.googleapis.com/v1/documents/DOCUMENT_ID:batchUpdate\""
      },
      {
        "title": "Insert a heading",
        "body": "curl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"requests\":[{\"insertText\":{\"location\":{\"index\":1},\"text\":\"My Heading\\n\"}},{\"updateParagraphStyle\":{\"range\":{\"startIndex\":1,\"endIndex\":12},\"paragraphStyle\":{\"namedStyleType\":\"HEADING_1\"},\"fields\":\"namedStyleType\"}}]}' \\\n  \"https://docs.googleapis.com/v1/documents/DOCUMENT_ID:batchUpdate\"\n\nHeading styles: HEADING_1 through HEADING_6, TITLE, SUBTITLE, NORMAL_TEXT."
      },
      {
        "title": "Create a spreadsheet",
        "body": "TOKEN=$(~/.openclaw/skills/clawemail/scripts/token.sh)\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"properties\":{\"title\":\"My Spreadsheet\"}}' \\\n  \"https://sheets.googleapis.com/v4/spreadsheets\" | python3 -m json.tool"
      },
      {
        "title": "Read cells",
        "body": "curl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://sheets.googleapis.com/v4/spreadsheets/SPREADSHEET_ID/values/Sheet1!A1:D10\" | python3 -m json.tool"
      },
      {
        "title": "Write cells",
        "body": "curl -s -X PUT -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"values\":[[\"Name\",\"Age\",\"City\"],[\"Alice\",\"30\",\"NYC\"],[\"Bob\",\"25\",\"LA\"]]}' \\\n  \"https://sheets.googleapis.com/v4/spreadsheets/SPREADSHEET_ID/values/Sheet1!A1:C3?valueInputOption=USER_ENTERED\" | python3 -m json.tool"
      },
      {
        "title": "Append rows",
        "body": "curl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"values\":[[\"Charlie\",\"35\",\"Chicago\"]]}' \\\n  \"https://sheets.googleapis.com/v4/spreadsheets/SPREADSHEET_ID/values/Sheet1!A:C:append?valueInputOption=USER_ENTERED&insertDataOption=INSERT_ROWS\" | python3 -m json.tool"
      },
      {
        "title": "Clear a range",
        "body": "curl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://sheets.googleapis.com/v4/spreadsheets/SPREADSHEET_ID/values/Sheet1!A1:D10:clear\""
      },
      {
        "title": "Get spreadsheet metadata",
        "body": "curl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://sheets.googleapis.com/v4/spreadsheets/SPREADSHEET_ID?fields=properties.title,sheets.properties\" | python3 -m json.tool"
      },
      {
        "title": "Create a presentation",
        "body": "TOKEN=$(~/.openclaw/skills/clawemail/scripts/token.sh)\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"title\":\"My Presentation\"}' \\\n  \"https://slides.googleapis.com/v1/presentations\" | python3 -m json.tool"
      },
      {
        "title": "Get presentation info",
        "body": "curl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://slides.googleapis.com/v1/presentations/PRESENTATION_ID\" | python3 -m json.tool"
      },
      {
        "title": "Add a new slide",
        "body": "curl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"requests\":[{\"createSlide\":{\"slideLayoutReference\":{\"predefinedLayout\":\"TITLE_AND_BODY\"}}}]}' \\\n  \"https://slides.googleapis.com/v1/presentations/PRESENTATION_ID:batchUpdate\" | python3 -m json.tool\n\nLayouts: BLANK, TITLE, TITLE_AND_BODY, TITLE_AND_TWO_COLUMNS, TITLE_ONLY, SECTION_HEADER, ONE_COLUMN_TEXT, MAIN_POINT, BIG_NUMBER."
      },
      {
        "title": "Add text to a slide",
        "body": "First get the slide's page object IDs, then insert text into a placeholder:\n\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"requests\":[{\"insertText\":{\"objectId\":\"PLACEHOLDER_OBJECT_ID\",\"text\":\"Hello from ClawEmail!\",\"insertionIndex\":0}}]}' \\\n  \"https://slides.googleapis.com/v1/presentations/PRESENTATION_ID:batchUpdate\""
      },
      {
        "title": "Add an image to a slide",
        "body": "curl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"requests\":[{\"createImage\":{\"url\":\"https://example.com/image.png\",\"elementProperties\":{\"pageObjectId\":\"SLIDE_ID\",\"size\":{\"width\":{\"magnitude\":3000000,\"unit\":\"EMU\"},\"height\":{\"magnitude\":2000000,\"unit\":\"EMU\"}},\"transform\":{\"scaleX\":1,\"scaleY\":1,\"translateX\":1000000,\"translateY\":1500000,\"unit\":\"EMU\"}}}}]}' \\\n  \"https://slides.googleapis.com/v1/presentations/PRESENTATION_ID:batchUpdate\""
      },
      {
        "title": "List upcoming events",
        "body": "TOKEN=$(~/.openclaw/skills/clawemail/scripts/token.sh)\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://www.googleapis.com/calendar/v3/calendars/primary/events?timeMin=$(date -u +%Y-%m-%dT%H:%M:%SZ)&maxResults=10&singleEvents=true&orderBy=startTime\" | python3 -m json.tool"
      },
      {
        "title": "Get events in a date range",
        "body": "curl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://www.googleapis.com/calendar/v3/calendars/primary/events?timeMin=2025-03-01T00:00:00Z&timeMax=2025-03-31T23:59:59Z&singleEvents=true&orderBy=startTime\" | python3 -m json.tool"
      },
      {
        "title": "Create an event",
        "body": "curl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"summary\": \"Team Meeting\",\n    \"description\": \"Weekly standup\",\n    \"start\": {\"dateTime\": \"2025-03-15T10:00:00-05:00\", \"timeZone\": \"America/New_York\"},\n    \"end\": {\"dateTime\": \"2025-03-15T11:00:00-05:00\", \"timeZone\": \"America/New_York\"},\n    \"attendees\": [{\"email\": \"colleague@example.com\"}]\n  }' \\\n  \"https://www.googleapis.com/calendar/v3/calendars/primary/events\" | python3 -m json.tool"
      },
      {
        "title": "Update an event",
        "body": "curl -s -X PATCH -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"summary\":\"Updated Meeting Title\",\"location\":\"Conference Room A\"}' \\\n  \"https://www.googleapis.com/calendar/v3/calendars/primary/events/EVENT_ID\" | python3 -m json.tool"
      },
      {
        "title": "Delete an event",
        "body": "curl -s -X DELETE -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://www.googleapis.com/calendar/v3/calendars/primary/events/EVENT_ID\""
      },
      {
        "title": "List calendars",
        "body": "curl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://www.googleapis.com/calendar/v3/users/me/calendarList\" | python3 -m json.tool"
      },
      {
        "title": "Create a form",
        "body": "TOKEN=$(~/.openclaw/skills/clawemail/scripts/token.sh)\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"info\":{\"title\":\"Feedback Form\"}}' \\\n  \"https://forms.googleapis.com/v1/forms\" | python3 -m json.tool"
      },
      {
        "title": "Add questions",
        "body": "curl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"requests\":[{\"createItem\":{\"item\":{\"title\":\"How would you rate this?\",\"questionItem\":{\"question\":{\"required\":true,\"scaleQuestion\":{\"low\":1,\"high\":5,\"lowLabel\":\"Poor\",\"highLabel\":\"Excellent\"}}}},\"location\":{\"index\":0}}}]}' \\\n  \"https://forms.googleapis.com/v1/forms/FORM_ID:batchUpdate\""
      },
      {
        "title": "Get form responses",
        "body": "curl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://forms.googleapis.com/v1/forms/FORM_ID/responses\" | python3 -m json.tool"
      },
      {
        "title": "Tips",
        "body": "Always refresh token first: Start every sequence with TOKEN=$(~/.openclaw/skills/clawemail/scripts/token.sh)\nJSON output: Pipe through python3 -m json.tool for readable output, or | python3 -c \"import json,sys;...\" for extraction\nPagination: Most list endpoints return nextPageToken. Pass it as ?pageToken=TOKEN for the next page\nBatch operations: Docs, Sheets, and Slides support batchUpdate — send multiple operations in one request\nError 401: Token expired. Re-run token.sh to refresh\nError 403: Scope not authorized. The ClawEmail OAuth includes Gmail, Drive, Docs, Sheets, Slides, Calendar, and Forms scopes\nRate limits: Google APIs have per-user rate limits. Add brief delays between rapid successive calls\nFile IDs: Google Docs/Sheets/Slides URLs contain the file ID: https://docs.google.com/document/d/FILE_ID/edit"
      },
      {
        "title": "When to Use",
        "body": "User asks to send, read, or search email\nUser wants to create or edit documents, spreadsheets, or presentations\nUser needs to manage files in Google Drive\nUser wants to schedule or check calendar events\nUser asks to create forms or review form responses\nAny task involving Google Workspace services"
      }
    ],
    "body": "Claw — Google Workspace for AI Agents\n\nUse claw for Gmail, Drive, Docs, Sheets, Slides, Calendar, and Forms via your @clawemail.com account.\n\nSetup\nSave your ClawEmail credentials JSON to ~/.config/clawemail/credentials.json\nSet the environment variable: export CLAWEMAIL_CREDENTIALS=~/.config/clawemail/credentials.json\n\nGet credentials at https://clawemail.com — sign up, then visit /connect/YOUR_PREFIX to authorize OAuth.\n\nGetting an Access Token\n\nAll API calls need a Bearer token. Use the helper script to refresh and cache it:\n\nTOKEN=$(~/.openclaw/skills/clawemail/scripts/token.sh)\n\n\nThe script caches tokens for 50 minutes. Always assign to TOKEN before making API calls.\n\nGmail\nSearch emails\nTOKEN=$(~/.openclaw/skills/clawemail/scripts/token.sh)\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://gmail.googleapis.com/gmail/v1/users/me/messages?q=newer_than:7d&maxResults=10\" | python3 -m json.tool\n\n\nCommon query operators: from:, to:, subject:, newer_than:, older_than:, is:unread, has:attachment, label:, in:inbox.\n\nRead a message\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://gmail.googleapis.com/gmail/v1/users/me/messages/MESSAGE_ID?format=full\" | python3 -m json.tool\n\n\nFor plain text body only, use format=minimal and decode the payload. For readable output:\n\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://gmail.googleapis.com/gmail/v1/users/me/messages/MESSAGE_ID?format=full\" \\\n  | python3 -c \"\nimport json,sys,base64\nm=json.load(sys.stdin)\nhdrs={h['name']:h['value'] for h in m['payload']['headers']}\nprint(f\\\"From: {hdrs.get('From','')}\\nTo: {hdrs.get('To','')}\\nSubject: {hdrs.get('Subject','')}\\nDate: {hdrs.get('Date','')}\\n\\\")\ndef get_body(part):\n    if part.get('body',{}).get('data'):\n        return base64.urlsafe_b64decode(part['body']['data']).decode('utf-8','replace')\n    for p in part.get('parts',[]):\n        if p['mimeType']=='text/plain': return get_body(p)\n    for p in part.get('parts',[]):\n        b=get_body(p)\n        if b: return b\n    return ''\nprint(get_body(m['payload']))\n\"\n\nSend an email\nTOKEN=$(~/.openclaw/skills/clawemail/scripts/token.sh)\npython3 -c \"\nimport base64,json\nraw = base64.urlsafe_b64encode(\n    b'To: recipient@example.com\\r\\nSubject: Hello\\r\\nContent-Type: text/plain; charset=utf-8\\r\\n\\r\\nMessage body here'\n).decode()\nprint(json.dumps({'raw': raw}))\n\" | curl -s -X POST \\\n  -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d @- \\\n  \"https://gmail.googleapis.com/gmail/v1/users/me/messages/send\"\n\n\nFor HTML emails, replace Content-Type: text/plain with Content-Type: text/html and use HTML in the body.\n\nReply to a message\n\nSame as send, but add In-Reply-To: and References: headers from the original message, and include threadId in the JSON body:\n\npython3 -c \"\nimport base64,json\nraw = base64.urlsafe_b64encode(\n    b'To: recipient@example.com\\r\\nSubject: Re: Original Subject\\r\\nIn-Reply-To: <original-message-id>\\r\\nReferences: <original-message-id>\\r\\nContent-Type: text/plain; charset=utf-8\\r\\n\\r\\nReply body'\n).decode()\nprint(json.dumps({'raw': raw, 'threadId': 'THREAD_ID'}))\n\" | curl -s -X POST \\\n  -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d @- \\\n  \"https://gmail.googleapis.com/gmail/v1/users/me/messages/send\"\n\nList labels\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://gmail.googleapis.com/gmail/v1/users/me/labels\" | python3 -m json.tool\n\nAdd/remove labels\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"addLabelIds\":[\"LABEL_ID\"],\"removeLabelIds\":[\"INBOX\"]}' \\\n  \"https://gmail.googleapis.com/gmail/v1/users/me/messages/MESSAGE_ID/modify\"\n\nGoogle Drive\nList files\nTOKEN=$(~/.openclaw/skills/clawemail/scripts/token.sh)\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://www.googleapis.com/drive/v3/files?pageSize=20&fields=files(id,name,mimeType,modifiedTime,size)&orderBy=modifiedTime desc\" | python3 -m json.tool\n\nSearch files\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://www.googleapis.com/drive/v3/files?q=name+contains+'report'&fields=files(id,name,mimeType,modifiedTime)\" | python3 -m json.tool\n\n\nQuery operators: name contains 'term', mimeType='application/vnd.google-apps.document', 'FOLDER_ID' in parents, trashed=false, modifiedTime > '2025-01-01'.\n\nCommon MIME types:\n\nDocument: application/vnd.google-apps.document\nSpreadsheet: application/vnd.google-apps.spreadsheet\nPresentation: application/vnd.google-apps.presentation\nFolder: application/vnd.google-apps.folder\nForm: application/vnd.google-apps.form\nCreate a folder\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"My Folder\",\"mimeType\":\"application/vnd.google-apps.folder\"}' \\\n  \"https://www.googleapis.com/drive/v3/files?fields=id,name\" | python3 -m json.tool\n\nUpload a file\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -F \"metadata={\\\"name\\\":\\\"report.pdf\\\"};type=application/json\" \\\n  -F \"file=@/path/to/report.pdf;type=application/pdf\" \\\n  \"https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart&fields=id,name\" | python3 -m json.tool\n\nDownload a file\n\nFor Google Docs/Sheets/Slides (export):\n\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://www.googleapis.com/drive/v3/files/FILE_ID/export?mimeType=application/pdf\" -o output.pdf\n\n\nExport formats: text/plain, text/html, application/pdf, application/vnd.openxmlformats-officedocument.wordprocessingml.document (docx), text/csv (sheets).\n\nFor binary files (download):\n\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://www.googleapis.com/drive/v3/files/FILE_ID?alt=media\" -o output.file\n\nShare a file\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"role\":\"writer\",\"type\":\"user\",\"emailAddress\":\"user@example.com\"}' \\\n  \"https://www.googleapis.com/drive/v3/files/FILE_ID/permissions\"\n\n\nRoles: reader, commenter, writer, owner. Types: user, group, domain, anyone.\n\nDelete a file\ncurl -s -X DELETE -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://www.googleapis.com/drive/v3/files/FILE_ID\"\n\nGoogle Docs\nCreate a document\nTOKEN=$(~/.openclaw/skills/clawemail/scripts/token.sh)\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"title\":\"My Document\"}' \\\n  \"https://docs.googleapis.com/v1/documents\" | python3 -m json.tool\n\nRead a document\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://docs.googleapis.com/v1/documents/DOCUMENT_ID\" | python3 -m json.tool\n\n\nFor plain text extraction:\n\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://docs.googleapis.com/v1/documents/DOCUMENT_ID\" \\\n  | python3 -c \"\nimport json,sys\ndoc=json.load(sys.stdin)\ntext=''\nfor el in doc.get('body',{}).get('content',[]):\n    for p in el.get('paragraph',{}).get('elements',[]):\n        text+=p.get('textRun',{}).get('content','')\nprint(text)\n\"\n\nAppend text to a document\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"requests\":[{\"insertText\":{\"location\":{\"index\":1},\"text\":\"Hello, world!\\n\"}}]}' \\\n  \"https://docs.googleapis.com/v1/documents/DOCUMENT_ID:batchUpdate\"\n\nReplace text in a document\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"requests\":[{\"replaceAllText\":{\"containsText\":{\"text\":\"OLD_TEXT\",\"matchCase\":true},\"replaceText\":\"NEW_TEXT\"}}]}' \\\n  \"https://docs.googleapis.com/v1/documents/DOCUMENT_ID:batchUpdate\"\n\nInsert a heading\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"requests\":[{\"insertText\":{\"location\":{\"index\":1},\"text\":\"My Heading\\n\"}},{\"updateParagraphStyle\":{\"range\":{\"startIndex\":1,\"endIndex\":12},\"paragraphStyle\":{\"namedStyleType\":\"HEADING_1\"},\"fields\":\"namedStyleType\"}}]}' \\\n  \"https://docs.googleapis.com/v1/documents/DOCUMENT_ID:batchUpdate\"\n\n\nHeading styles: HEADING_1 through HEADING_6, TITLE, SUBTITLE, NORMAL_TEXT.\n\nGoogle Sheets\nCreate a spreadsheet\nTOKEN=$(~/.openclaw/skills/clawemail/scripts/token.sh)\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"properties\":{\"title\":\"My Spreadsheet\"}}' \\\n  \"https://sheets.googleapis.com/v4/spreadsheets\" | python3 -m json.tool\n\nRead cells\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://sheets.googleapis.com/v4/spreadsheets/SPREADSHEET_ID/values/Sheet1!A1:D10\" | python3 -m json.tool\n\nWrite cells\ncurl -s -X PUT -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"values\":[[\"Name\",\"Age\",\"City\"],[\"Alice\",\"30\",\"NYC\"],[\"Bob\",\"25\",\"LA\"]]}' \\\n  \"https://sheets.googleapis.com/v4/spreadsheets/SPREADSHEET_ID/values/Sheet1!A1:C3?valueInputOption=USER_ENTERED\" | python3 -m json.tool\n\nAppend rows\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"values\":[[\"Charlie\",\"35\",\"Chicago\"]]}' \\\n  \"https://sheets.googleapis.com/v4/spreadsheets/SPREADSHEET_ID/values/Sheet1!A:C:append?valueInputOption=USER_ENTERED&insertDataOption=INSERT_ROWS\" | python3 -m json.tool\n\nClear a range\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://sheets.googleapis.com/v4/spreadsheets/SPREADSHEET_ID/values/Sheet1!A1:D10:clear\"\n\nGet spreadsheet metadata\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://sheets.googleapis.com/v4/spreadsheets/SPREADSHEET_ID?fields=properties.title,sheets.properties\" | python3 -m json.tool\n\nGoogle Slides\nCreate a presentation\nTOKEN=$(~/.openclaw/skills/clawemail/scripts/token.sh)\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"title\":\"My Presentation\"}' \\\n  \"https://slides.googleapis.com/v1/presentations\" | python3 -m json.tool\n\nGet presentation info\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://slides.googleapis.com/v1/presentations/PRESENTATION_ID\" | python3 -m json.tool\n\nAdd a new slide\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"requests\":[{\"createSlide\":{\"slideLayoutReference\":{\"predefinedLayout\":\"TITLE_AND_BODY\"}}}]}' \\\n  \"https://slides.googleapis.com/v1/presentations/PRESENTATION_ID:batchUpdate\" | python3 -m json.tool\n\n\nLayouts: BLANK, TITLE, TITLE_AND_BODY, TITLE_AND_TWO_COLUMNS, TITLE_ONLY, SECTION_HEADER, ONE_COLUMN_TEXT, MAIN_POINT, BIG_NUMBER.\n\nAdd text to a slide\n\nFirst get the slide's page object IDs, then insert text into a placeholder:\n\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"requests\":[{\"insertText\":{\"objectId\":\"PLACEHOLDER_OBJECT_ID\",\"text\":\"Hello from ClawEmail!\",\"insertionIndex\":0}}]}' \\\n  \"https://slides.googleapis.com/v1/presentations/PRESENTATION_ID:batchUpdate\"\n\nAdd an image to a slide\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"requests\":[{\"createImage\":{\"url\":\"https://example.com/image.png\",\"elementProperties\":{\"pageObjectId\":\"SLIDE_ID\",\"size\":{\"width\":{\"magnitude\":3000000,\"unit\":\"EMU\"},\"height\":{\"magnitude\":2000000,\"unit\":\"EMU\"}},\"transform\":{\"scaleX\":1,\"scaleY\":1,\"translateX\":1000000,\"translateY\":1500000,\"unit\":\"EMU\"}}}}]}' \\\n  \"https://slides.googleapis.com/v1/presentations/PRESENTATION_ID:batchUpdate\"\n\nGoogle Calendar\nList upcoming events\nTOKEN=$(~/.openclaw/skills/clawemail/scripts/token.sh)\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://www.googleapis.com/calendar/v3/calendars/primary/events?timeMin=$(date -u +%Y-%m-%dT%H:%M:%SZ)&maxResults=10&singleEvents=true&orderBy=startTime\" | python3 -m json.tool\n\nGet events in a date range\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://www.googleapis.com/calendar/v3/calendars/primary/events?timeMin=2025-03-01T00:00:00Z&timeMax=2025-03-31T23:59:59Z&singleEvents=true&orderBy=startTime\" | python3 -m json.tool\n\nCreate an event\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"summary\": \"Team Meeting\",\n    \"description\": \"Weekly standup\",\n    \"start\": {\"dateTime\": \"2025-03-15T10:00:00-05:00\", \"timeZone\": \"America/New_York\"},\n    \"end\": {\"dateTime\": \"2025-03-15T11:00:00-05:00\", \"timeZone\": \"America/New_York\"},\n    \"attendees\": [{\"email\": \"colleague@example.com\"}]\n  }' \\\n  \"https://www.googleapis.com/calendar/v3/calendars/primary/events\" | python3 -m json.tool\n\nUpdate an event\ncurl -s -X PATCH -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"summary\":\"Updated Meeting Title\",\"location\":\"Conference Room A\"}' \\\n  \"https://www.googleapis.com/calendar/v3/calendars/primary/events/EVENT_ID\" | python3 -m json.tool\n\nDelete an event\ncurl -s -X DELETE -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://www.googleapis.com/calendar/v3/calendars/primary/events/EVENT_ID\"\n\nList calendars\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://www.googleapis.com/calendar/v3/users/me/calendarList\" | python3 -m json.tool\n\nGoogle Forms\nCreate a form\nTOKEN=$(~/.openclaw/skills/clawemail/scripts/token.sh)\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"info\":{\"title\":\"Feedback Form\"}}' \\\n  \"https://forms.googleapis.com/v1/forms\" | python3 -m json.tool\n\nAdd questions\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"requests\":[{\"createItem\":{\"item\":{\"title\":\"How would you rate this?\",\"questionItem\":{\"question\":{\"required\":true,\"scaleQuestion\":{\"low\":1,\"high\":5,\"lowLabel\":\"Poor\",\"highLabel\":\"Excellent\"}}}},\"location\":{\"index\":0}}}]}' \\\n  \"https://forms.googleapis.com/v1/forms/FORM_ID:batchUpdate\"\n\nGet form responses\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https://forms.googleapis.com/v1/forms/FORM_ID/responses\" | python3 -m json.tool\n\nTips\nAlways refresh token first: Start every sequence with TOKEN=$(~/.openclaw/skills/clawemail/scripts/token.sh)\nJSON output: Pipe through python3 -m json.tool for readable output, or | python3 -c \"import json,sys;...\" for extraction\nPagination: Most list endpoints return nextPageToken. Pass it as ?pageToken=TOKEN for the next page\nBatch operations: Docs, Sheets, and Slides support batchUpdate — send multiple operations in one request\nError 401: Token expired. Re-run token.sh to refresh\nError 403: Scope not authorized. The ClawEmail OAuth includes Gmail, Drive, Docs, Sheets, Slides, Calendar, and Forms scopes\nRate limits: Google APIs have per-user rate limits. Add brief delays between rapid successive calls\nFile IDs: Google Docs/Sheets/Slides URLs contain the file ID: https://docs.google.com/document/d/FILE_ID/edit\nWhen to Use\nUser asks to send, read, or search email\nUser wants to create or edit documents, spreadsheets, or presentations\nUser needs to manage files in Google Drive\nUser wants to schedule or check calendar events\nUser asks to create forms or review form responses\nAny task involving Google Workspace services"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/cto1/clawemail",
    "publisherUrl": "https://clawhub.ai/cto1/clawemail",
    "owner": "cto1",
    "version": "1.0.1",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/clawemail",
    "downloadUrl": "https://openagent3.xyz/downloads/clawemail",
    "agentUrl": "https://openagent3.xyz/skills/clawemail/agent",
    "manifestUrl": "https://openagent3.xyz/skills/clawemail/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/clawemail/agent.md"
  }
}