Back to Skills

gws-gmail-read

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

25,111stars1,284forksUpdated 4/21/2026

Security Assessment

Safe(93/100)
Security Score93/100

About gws-gmail-read

This skill documents the `gws gmail +read` command from the Google Workspace CLI, which reads a single Gmail message by ID and extracts its body or headers. It solves the narrow task of programmatically retrieving message content from Gmail in a scriptable way, part of a larger family of gws skills for working with email.

The command takes a required message ID and offers optional flags to include headers (From, To, Subject, Date), choose the output format (text or JSON), return the HTML body instead of plain text, and perform a dry run that shows the request that would be sent without executing it. It automatically converts HTML-only messages to plain text and handles multipart/alternative content and base64 decoding, so callers get usable text without manual parsing. JSON output composes cleanly with tools like jq for extracting specific fields such as the body. The skill points to a shared gws-shared skill for authentication, global flags, and security rules, indicating credentials and auth are handled by the official CLI's own tooling rather than this skill.

It targets developers, automation authors, and productivity users who want to pull Gmail message content into scripts or agent workflows. The operation is strictly read-only retrieval of a message the authenticated user can already access; it does not send, delete, or modify mail, and it exposes a dry-run option for safe inspection of requests.

FAQ

What does the command require to run?

The gws binary must be installed, and you must supply the Gmail message ID via the --id flag. Authentication and global flags are covered by the shared gws-shared skill.

Can I get structured output?

Yes. Use --format json to get JSON, which you can pipe to a tool like jq to extract fields such as the message body; the default format is plain text.

How does it handle HTML emails?

It converts HTML-only messages to plain text automatically and handles multipart/alternative content and base64 decoding. You can also pass --html to return the raw HTML body instead.

Can I preview a request without sending it?

Yes. The --dry-run flag shows the request that would be sent without actually executing it.

Does it modify my mailbox?

No. It only reads a message and extracts its body or headers; it does not send, delete, or change any mail.

Install gws-gmail-read

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill