$npx -y skills add googleworkspace/cli --skill gws-gmail-readGmail: Read a message and extract its body or headers.
| 1 | # gmail +read |
| 2 | |
| 3 | > **PREREQUISITE:** Read `../gws-shared/SKILL.md` for auth, global flags, and security rules. If missing, run `gws generate-skills` to create it. |
| 4 | |
| 5 | Read a message and extract its body or headers |
| 6 | |
| 7 | ## Usage |
| 8 | |
| 9 | ```bash |
| 10 | gws gmail +read --id <ID> |
| 11 | ``` |
| 12 | |
| 13 | ## Flags |
| 14 | |
| 15 | | Flag | Required | Default | Description | |
| 16 | |------|----------|---------|-------------| |
| 17 | | `--id` | ✓ | — | The Gmail message ID to read | |
| 18 | | `--headers` | — | — | Include headers (From, To, Subject, Date) in the output | |
| 19 | | `--format` | — | text | Output format (text, json) | |
| 20 | | `--html` | — | — | Return HTML body instead of plain text | |
| 21 | | `--dry-run` | — | — | Show the request that would be sent without executing it | |
| 22 | |
| 23 | ## Examples |
| 24 | |
| 25 | ```bash |
| 26 | gws gmail +read --id 18f1a2b3c4d |
| 27 | gws gmail +read --id 18f1a2b3c4d --headers |
| 28 | gws gmail +read --id 18f1a2b3c4d --format json | jq '.body' |
| 29 | ``` |
| 30 | |
| 31 | ## Tips |
| 32 | |
| 33 | - Converts HTML-only messages to plain text automatically. |
| 34 | - Handles multipart/alternative and base64 decoding. |
| 35 | |
| 36 | ## See Also |
| 37 | |
| 38 | - [gws-shared](../gws-shared/SKILL.md) — Global flags and auth |
| 39 | - [gws-gmail](../gws-gmail/SKILL.md) — All send, read, and manage email commands |