Summary
Extract message body and headers from Gmail using message IDs.
- Reads individual Gmail messages by ID and returns body content in plain text or HTML format
- Optionally includes message headers (From, To, Subject, Date) in output
- Supports multiple output formats (text, json) and automatically converts HTML-only messages to plain text
- Handles multipart messages and base64 decoding; includes dry-run mode for testing requests
gmail +read
PREREQUISITE: Read
../gws-shared/SKILL.mdfor auth, global flags, and security rules. If missing, rungws generate-skillsto 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
- gws-shared â Global flags and auth
- gws-gmail â All send, read, and manage email commands
Installs: 44.1K | GitHub stars: 32.6K | First seen: Mar 17, 2026


