# Gog Save Attachments

> Gog Save Attachments is an Agent Skill for apps & automation published in the openclaw/gogcli repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Gmail attachment download and Google Drive archival with gog.

- Skill name: `gog-save-attachments`
- Category: [Apps & Automation](https://www.openparable.com/skill/apps-automation/1)
- Source: https://github.com/openclaw/gogcli/blob/HEAD/.agents/skills/gog-save-attachments/SKILL.md
- Repository: openclaw/gogcli (8,167 GitHub stars when collected)

## SKILL.md

# Save attachments

Read `../gog/SKILL.md`, `../gog-gmail/SKILL.md`, and `../gog-drive/SKILL.md` first.

1. Search narrowly and identify exact threads:

   ```bash
   gog --account user@example.com --readonly gmail search \
     'has:attachment newer_than:30d' --max 20 --json --wrap-untrusted
   ```

2. Inspect attachment names and sizes before downloading:

   ```bash
   gog --account user@example.com --readonly gmail thread attachments THREAD_ID --json --wrap-untrusted
   ```

3. Download into a new task-specific temporary directory:

   ```bash
   attachment_dir="$(mktemp -d "${TMPDIR:-/tmp}/gog-attachments.XXXXXX")"
   gog --account user@example.com --readonly gmail thread attachments THREAD_ID \
     --download --out-dir "$attachment_dir"
   ```

4. 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 user@example.com drive upload "$attachment_dir/FILE" --parent FOLDER_ID --json
   ```

5. 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.

---

Source: https://www.openparable.com/skill/apps-automation/gog-save-attachments (OpenParable). Cite the canonical URL above.
