AgentSkillsCN

gmail-exporter

利用OAuth将Gmail消息的元数据导出为JSONL格式。当您需要提取邮件头、标签与片段,以支持下游的分类、审计或清理工作流程时,此工具不可或缺。

SKILL.md
--- frontmatter
name: gmail-exporter
description: Export Gmail message metadata to JSONL using OAuth. Use when you need to pull headers, labels, and snippets for downstream classification, auditing, or cleanup workflows.

Gmail Exporter

Quick start

  1. Confirm explicit consent to read Gmail.
  2. Ensure Gmail API is enabled and OAuth credentials are ready (see references/gmail-api-setup.md).
  3. Run scripts/gmail_export_metadata.py with a Gmail query and output path.
  4. Hand the JSONL output to downstream skills.

Safety rules

  • Use least-privilege scopes (gmail.readonly).
  • Avoid storing message bodies unless absolutely required.
  • Keep credentials.json and token.json out of source control.

Resources

  • scripts/gmail_export_metadata.py: Export metadata to JSONL.
  • scripts/gmail_api.py: OAuth helper.
  • references/gmail-api-setup.md: OAuth setup steps and scopes.
  • references/data-schema.md: Metadata schema definition.