360 Secure SkillHub
360 安全技能中心

Gws Gmail Read

这是基于gws的命令行工具,核心功能为读取指定ID的Gmail邮件,可提取纯文本/HTML正文,或包含发件人、收件人等的邮件头;支持文本、JSON两种输出格式,自动处理HTML转纯文本、多部分邮件及base64解码。典型场景:快速读取单封指定邮件内容,或提取信息用于后续脚本处理。输入为带参数的gws命令,输出为对应格式的邮件内容,也可通过dry-run预览请求,需依赖gws并完成认证。

googleworkspace-bot
googleworkspace-bot
热度 69.42
最近更新 2026-05-11 17:33:05
分类:协作依赖:第三方 API应用场景:工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add gws-gmail-read
Metadata
name
gws-gmail-read
description
Gmail: Read a message and extract its body or headers.
metadata
{"version":"0.22.5","openclaw":{"category":"productivity","requires":{"bins":["gws"]},"cliHelp":"gws gmail +read --help"}}

gmail +read

PREREQUISITE: Read ../gws-shared/SKILL.md for auth, global flags, and security rules. If missing, run gws generate-skills to create it.

Read a message and extract its body or headers

Usage

gws gmail +read --id <ID>

Flags

Flag Required Default Description
--id ✓ — The Gmail message ID to read
--headers — — Include headers (From, To, Subject, Date) in the output
--format — text Output format (text, json)
--html — — Return HTML body instead of plain text
--dry-run — — Show the request that would be sent without executing it

Examples

gws gmail +read --id 18f1a2b3c4d
gws gmail +read --id 18f1a2b3c4d --headers
gws gmail +read --id 18f1a2b3c4d --format json | jq '.body'

Tips

  • Converts HTML-only messages to plain text automatically.
  • Handles multipart/alternative and base64 decoding.

See Also