gws-gmail-read

Reads a Gmail message by ID and extracts its body or headers.

Updated Nov 9, 2023
One-click install
npx skills add https://github.com/oresttokovenko/dot-files --skill gws-gmail-read-oresttokovenko
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gws-gmail-read
Source: https://github.com/oresttokovenko/dot-files/tree/main/chezmoi/dot_agents/skills/gws-gmail-read
Command: npx skills add https://github.com/oresttokovenko/dot-files --skill gws-gmail-read-oresttokovenko

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Retrieving the content of a specific Gmail message from the command line requires handling message IDs, MIME decoding, and HTML-to-text conversion manually. This Skill wraps that into a single gws CLI command. ## Core Features & Use Cases - Message Body Extraction: Reads a Gmail message by ID and returns plain text, automatically converting HTML-only messages and decoding base64 multipart content. - Header Inspection: Optionally includes From, To, Subject, and Date headers in the output. - Structured Output: Supports JSON output for piping into tools like jq, plus a dry-run mode to preview the API request. - Use Case: After listing unread inbox messages, fetch the full body of a specific message ID and pipe the JSON output into a script that extracts action items. ## Quick Start Ask the assistant to read the Gmail message with a given ID using gws gmail +read, optionally including headers or JSON output.

Frequently Asked Questions about gws-gmail-read

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I read a Gmail message from the command line?

Run gws gmail +read --id <ID> with the message ID to fetch and display the message body. Add --headers to include From, To, Subject, and Date fields in the output.

How to get Gmail message content as JSON?

Use gws gmail +read --id <ID> --format json to return structured JSON output. You can pipe it to jq, for example jq '.body', to extract specific fields programmatically.

Does gws gmail read handle HTML-only emails?

Yes, HTML-only messages are automatically converted to plain text. It also handles multipart/alternative messages and base64 decoding, and the --html flag returns the raw HTML body if needed.

What prerequisites are needed for gws gmail commands?

The gws binary must be installed and Gmail authentication configured as described in the gws-shared skill. If the shared skill is missing, run gws generate-skills to create it.

Can I preview the Gmail API request without executing it?

Yes, pass the --dry-run flag to gws gmail +read to show the request that would be sent without actually executing it, which is useful for debugging parameters.