AI/ML

recipe-save-email-attachments

googleworkspace/cli · updated Apr 8, 2026

$npx skills add https://github.com/googleworkspace/cli --skill recipe-save-email-attachments
summary

Automated workflow to find Gmail attachments and save them to Google Drive folders.

  • Requires both gws-gmail and gws-drive skills as prerequisites
  • Covers four core steps: searching emails by attachment criteria, retrieving message details, downloading attachments, and uploading files to Drive
  • Supports filtered searches using Gmail query syntax (e.g., sender, attachment presence) to target specific messages
  • Integrates Gmail and Drive operations in a single recipe for streamlined att
skill.md

1d:["$","div",null,{"className":"prose prose-invert max-w-none prose-headings:font-semibold prose-headings:tracking-tight prose-h1:text-4xl prose-h1:mb-2 prose-h2:text-2xl prose-h2:mb-2 prose-h3:text-lg prose-h3:mb-2 prose-p:text-muted-foreground prose-li:text-muted-foreground prose-code:bg-muted prose-code:text-foreground prose-code:px-1 prose-code:py-0.5 prose-code:rounded-sm prose-code:text-sm prose-code:before:content-none prose-code:after:content-none prose-pre:bg-muted prose-pre:text-foreground prose-pre:border prose-pre:border-border prose-pre:rounded-md [&_table]:!border-[color:var(--border)] [&_th]:!border-[color:var(--border)] [&_td]:!border-[color:var(--border)]","dangerouslySetInnerHTML":{"__html":"<h1>Save Gmail Attachments to Google Drive</h1>\n<blockquote>\n<p><strong>PREREQUISITE:</strong> Load the following skills to execute this recipe: <code>gws-gmail</code>, <code>gws-drive</code></p>\n</blockquote>\n<p>Find Gmail messages with attachments and save them to a Google Drive folder.</p>\n<h2>Steps</h2>\n<ol>\n<li>Search for emails with attachments: <code>gws gmail users messages list --params '{"userId": "me", "q": "has:attachment from:client@example.com"}' --format table</code></li>\n<li>Get message details: <code>gws gmail users messages get --params '{"userId": "me", "id": "MESSAGE_ID"}'</code></li>\n<li>Download attachment: <code>gws gmail users messages attachments get --params '{"userId": "me", "messageId": "MESSAGE_ID", "id": "ATTACHMENT_ID"}'</code></li>\n<li>Upload to Drive folder: <code>gws drive +upload --file ./attachment.pdf --parent FOLDER_ID</code></li>\n</ol>"}}]