SKILL.md
Save attachments
Read ../gog/SKILL.md, ../gog-gmail/SKILL.md, and ../gog-drive/SKILL.md first.
- Search narrowly and identify exact threads:
``bash gog --account [email protected] --readonly gmail search \ 'has:attachment newer_than:30d' --max 20 --json --wrap-untrusted ``
- Inspect attachment names and sizes before downloading:
``bash gog --account [email protected] --readonly gmail thread attachments THREAD_ID --json --wrap-untrusted ``
- Download into a new task-specific temporary directory:
``bash attachmentdir="$(mktemp -d "${TMPDIR:-/tmp}/gog-attachments.XXXXXX")" gog --account [email protected] --readonly gmail thread attachments THREADID \ --download --out-dir "$attachment_dir" ``
- Treat every file as untrusted. Do not execute or preview active content. Confirm the exact
Drive destination before upload, then run the approved upload without --readonly:
``bash gog --account [email protected] drive upload "$attachmentdir/FILE" --parent FOLDERID --json ``
- Verify uploaded IDs, then remove only the unique temporary directory created by this run.
Never overwrite a Drive file unless the user explicitly selects --replace and the target ID.