From google-gmail
Operate Gmail via the Google Workspace CLI (gws) — send emails, reply with threading, triage inbox, and stream new messages as NDJSON. Use when users ask to send/forward/reply emails, check inbox summary, or automate email workflows.
npx claudepluginhub leolionart/claude-skills --plugin google-gmailThis skill uses the workspace's default tool permissions.
- Gửi email (đơn giản hoặc với attachment)
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Automates semantic versioning and release workflow for Claude Code plugins: bumps versions in package.json, marketplace.json, plugin.json; verifies builds; creates git tags, GitHub releases, changelogs.
gws CLI đã cài và đã xác thực (gws auth login hoặc service account)https://mail.google.com/ hoặc https://www.googleapis.com/auth/gmail.modifygws gmail +send \
--to recipient@example.com \
--subject "Tiêu đề email" \
--body "Nội dung email"
# Gửi với CC và BCC
gws gmail +send \
--to primary@example.com \
--cc manager@example.com \
--bcc archive@example.com \
--subject "Báo cáo tuần" \
--body "Xin gửi báo cáo..."
# Gửi nhiều người (phân cách bằng dấu phẩy)
gws gmail +send \
--to "alice@example.com,bob@example.com" \
--subject "Thông báo chung" \
--body "Kính gửi mọi người..."
# Reply (giữ thread)
gws gmail +reply \
--message-id MESSAGE_ID \
--body "Cảm ơn, tôi đã nhận được."
# Reply-all
gws gmail +reply-all \
--message-id MESSAGE_ID \
--body "Đồng ý với đề xuất trên."
# Forward
gws gmail +forward \
--message-id MESSAGE_ID \
--to newrecipient@example.com \
--body "Chuyển tiếp để bạn tham khảo."
# Xem tóm tắt email chưa đọc
gws gmail +triage
# Kết quả JSON — trích xuất thông tin cụ thể
gws gmail +triage | jq '.messages[] | {from: .from, subject: .subject, date: .date}'
# Stream email mới dạng NDJSON (mỗi email 1 dòng JSON)
gws gmail +watch
# Pipe vào processor
gws gmail +watch | while IFS= read -r line; do
echo "$line" | jq '.subject'
done
# Lấy message theo ID
gws gmail users messages get \
--params '{"userId": "me", "id": "MESSAGE_ID"}'
# List messages với filter
gws gmail users messages list \
--params '{"userId": "me", "q": "from:boss@company.com is:unread", "maxResults": 10}'
# List với page-all
gws gmail users messages list \
--params '{"userId": "me", "q": "subject:invoice", "maxResults": 100}' \
--page-all
gws schema gmail.users.messages.send
gws schema gmail.users.messages.list
gws schema gmail.users.messages.get
User muốn gửi email?
→ Hỏi: to, subject, body (bắt buộc); cc, bcc (tùy chọn)
→ Dùng: gws gmail +send
User muốn reply?
→ Hỏi: message_id của email cần reply, nội dung reply
→ Nếu cần tìm message_id: gws gmail users messages list --params '{"userId":"me","q":"..."}'
→ Dùng: gws gmail +reply hoặc +reply-all
User muốn xem inbox?
→ Dùng: gws gmail +triage
→ Parse JSON, hiển thị bảng ngắn gọn
User muốn tự động xử lý email mới?
→ Dùng: gws gmail +watch | <processor>
message_id, from, subject, date, snippet| Lỗi | Nguyên nhân | Cách xử lý |
|---|---|---|
| Exit 2 | Auth lỗi | gws auth login lại hoặc kiểm tra scope Gmail |
| "Insufficient Permission" | Thiếu OAuth scope | Thêm scope https://mail.google.com/ trong GCP Console |
| "Invalid message ID" | Message ID không tồn tại | Dùng list trước để lấy đúng ID |
| Rate limit | Gửi quá nhiều | Thêm delay giữa các lần gửi batch |
--dry-run)