| name | gmail-extract-archive |
| description | DEPRECATED — superseded by gmail-extract-and-act. Extract Gmail data into archive repo, parse attachments, legal scan, then delete. Uses archive-everything model. |
| version | 2.0.0 |
| status | deprecated |
| superseded_by | gmail-extract-and-act |
| deprecation_reason | Archives raw email bodies to repos. Per #2017, the new model extracts only structured data and deletes emails when topics complete (queue model, not archive model). See #2019 for consolidation plan. |
| author | vamsee |
| tags | ["email","gmail","extraction","archive","cleanup","gmail-archive","DEPRECATED"] |
| related_skills | ["gmail-multi-account","gmail-triage","contact-manager","legal-sanity-scan"] |
| metadata | {"hermes":{"tags":["email","gmail","extraction","archive","cleanup"],"related_skills":["gmail-multi-account","gmail-triage","contact-manager","legal-sanity-scan"]}} |
Gmail Extract & Archive Pipeline
Extract Gmail messages into ~/gmail-archive/ — a dedicated private repo as the single source of truth for all email data. Every message → markdown. Every attachment → saved. Every spreadsheet → parsed to CSV. Legal scan mandatory. Delete from inbox after successful archive.
Prerequisites
- gmail-multi-account skill configured (3 accounts with OAuth tokens)
~/gmail-archive/ repo exists (created via gh repo create vamseeachanta/gmail-archive --private)
- openpyxl installed in repo:
uv pip install openpyxl pyyaml
- Deny-list copied:
config/deny-list.yaml from workspace-hub
Repo Structure
gmail-archive/
├── README.md # Archive conventions
├── config/
│ ├── accounts.yaml # Account definitions (tokens external)
│ └── deny-list.yaml # Legal scan patterns
├── data/
│ ├── {account}/
│ │ ├── messages/ # Individual .md extracts per message
│ │ ├── threads/ # Full thread .md extracts
│ │ ├── attachments/ # Downloaded files organized by thread
│ │ └── spreadsheets/ # Parsed JSON + CSV for each Excel
├── reports/
│ ├── digest/ # Daily digest outputs
│ └── cleanup/ # Cleanup tracking logs
└── scripts/
└── extract.py # Main extraction pipeline
Extraction Commands
Basic extraction (scan + preview)
cd ~/gmail-archive
uv run scripts/extract.py --account ace --query "from:sandsig.com in:inbox" --max 500 --dry-run
Extract + save (no delete)
uv run scripts/extract.py --account ace --query "from:sandsig.com in:inbox" --max 500
Extract + delete from Gmail
uv run scripts/extract.py --account ace --query "from:sandsig.com in:inbox" --max 500 --delete
Extract full threads
uv run scripts/extract.py --account skestates --query "subject:1099 has:attachment" --threads --delete
Force through legal violations
uv run scripts/extract.py --account personal --query "category:promotions" --max 1000 --delete --force
Common Queries