PluginBench
Skill
Review
Audit score 70

gws-gmail-read

googleworkspace/cli

Read Gmail messages and extract body or headers with automatic HTML-to-text conversion.

What is gws-gmail-read?

Retrieves a specific Gmail message by ID and extracts its content as plain text or HTML, with optional header information. Use this when you need to programmatically access email message bodies or metadata from Gmail.

  • Extract message body in plain text or HTML format
  • Include email headers (From, To, Subject, Date) in output
  • Automatically convert HTML-only messages to plain text
  • Handle multipart/alternative and base64 decoding
  • Output results in text or JSON format
  • Preview requests with dry-run mode before execution

How to install gws-gmail-read

npx skills add null --skill gws-gmail-read
Prerequisites
  • gws CLI installed and configured
  • Google Workspace account with Gmail enabled
  • Gmail message ID (obtainable from gws-gmail-list or similar)
  • Authentication configured per gws-shared/SKILL.md
Claude Code
Cursor
Windsurf
Cline

How to use gws-gmail-read

  1. 1.Install the skill: npx skills add null --skill gws-gmail-read
  2. 2.Obtain the Gmail message ID you want to read
  3. 3.Run gws gmail +read --id <MESSAGE_ID> to retrieve the message body
  4. 4.Add --headers flag to include From, To, Subject, and Date fields
  5. 5.Use --format json to parse output programmatically
  6. 6.Use --html flag if you need the HTML version instead of plain text
  7. 7.Use --dry-run to preview the request before executing

Use cases

Good for
  • Retrieve and process email content for automation workflows
  • Extract sender and recipient information from specific messages
  • Convert HTML emails to plain text for analysis or logging
  • Build email parsing pipelines that integrate with other tools
  • Audit or archive email content programmatically
Who it's for
  • Automation engineers building email workflows
  • DevOps professionals managing email-based processes
  • Integration specialists connecting Gmail to other systems
  • Developers building email processing applications

gws-gmail-read FAQ

How do I get the message ID to use with this skill?

Message IDs can be obtained from gws-gmail-list or other Gmail listing commands. They are unique identifiers assigned by Gmail to each message.

What happens if a message is HTML-only?

The skill automatically converts HTML-only messages to plain text format by default. Use --html flag if you need the original HTML instead.

Can I extract just the headers without the body?

The --headers flag includes headers in the output alongside the body. There is no flag to extract headers only; use --format json and parse the output if you need selective extraction.

What output formats are supported?

Two formats are supported: text (default, human-readable) and json (machine-parseable). Use --format json with tools like jq for advanced filtering.

Does this skill require special permissions?

Yes, it requires proper Google Workspace authentication configured via gws-shared. Refer to gws-shared/SKILL.md for auth setup and security rules.

Full instructions (SKILL.md)

Source of truth, from googleworkspace/cli.


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

FlagRequiredDefaultDescription
--idThe Gmail message ID to read
--headersInclude headers (From, To, Subject, Date) in the output
--formattextOutput format (text, json)
--htmlReturn HTML body instead of plain text
--dry-runShow 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