Labsco
googleworkspace logo

gws-gmail-read

โœ“ Officialโ˜… 29,425

by googleworkspace ยท part of googleworkspace/cli

Gmail: Read a message and extract its body or headers.

๐Ÿงฐ Not standalone. This skill ships with googleworkspace/cli and only works together with that tool โ€” install the tool first, then add this skill.

This is the playbook your agent receives when the skill activates โ€” you don't need to read it to use the skill, but it's here to audit before installing.

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

Flags

FlagRequiredDefaultDescription
--idโœ“โ€”The Gmail message ID to read
--headersโ€”โ€”Include headers (From, To, Subject, Date) in the output
--formatโ€”textOutput 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

  • gws-shared โ€” Global flags and auth
  • gws-gmail โ€” All send, read, and manage email commands