Gog Save Attachments
Apps & Automationgog-save-attachmentsGog 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.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/openclaw/gogcli/blob/HEAD/.agents/skills/gog-save-attachments/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/gog-save-attachments, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Save attachments
Read ../gog/SKILL.md, ../gog-gmail/SKILL.md, and ../gog-drive/SKILL.md first.
-
Search narrowly and identify exact threads:
gog --account [email protected] --readonly gmail search \ 'has:attachment newer_than:30d' --max 20 --json --wrap-untrusted -
Inspect attachment names and sizes before downloading:
gog --account [email protected] --readonly gmail thread attachments THREAD_ID --json --wrap-untrusted -
Download into a new task-specific temporary directory:
attachment_dir="$(mktemp -d "${TMPDIR:-/tmp}/gog-attachments.XXXXXX")" gog --account [email protected] --readonly gmail thread attachments THREAD_ID \ --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:gog --account [email protected] drive upload "$attachment_dir/FILE" --parent FOLDER_ID --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.