skill-gmail-api

Automate Gmail operations via CLI with OAuth2 and JSON output.

4|2|Updated Nov 27, 2025
One-click install
npx skills add https://github.com/tmustier/skill-gmail-api --skill skill-gmail-api
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: skill-gmail-api
Source: https://github.com/tmustier/skill-gmail-api/tree/main/.
Command: npx skills add https://github.com/tmustier/skill-gmail-api --skill skill-gmail-api

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires google-auth, google-auth-oauthlib, google-auth-httplib2, google-api-python-client, click, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates Gmail operations via a CLI, letting you read, draft, send, archive, label, and batch-process emails. It reduces manual Gmail management and helps you reclaim time.

Core Features & Use Cases

  • Read emails and threads quickly with search queries and metadata or full bodies.
  • Draft and send messages, with optional HTML content and attachments, including replies to existing messages.
  • Batch operations for archiving, labeling, and marking read/unread across large mail sets.
  • Retrieve, manage, and download attachments and labels, or create/delete filters for automated email handling.
  • Use Case: A marketer wants to batch-archive newsletters and respond to important messages without leaving the terminal.

Quick Start

Install dependencies and run the Gmail CLI to read emails, e.g.,

  • python3 -m venv .venv
  • .venv/bin/pip install -r requirements.txt
  • .venv/bin/python scripts/gmail.py read --limit 5

Frequently Asked Questions about skill-gmail-api

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

FAQPage Schema
How do I automate Gmail operations from the command line?

Gmail CLI automation lets you read, draft, send, archive, and label emails without leaving the terminal. This Skill provides OAuth2-authenticated access to Gmail API operations, outputting JSON results for integration into scripts and workflows.

Can I batch-process emails with Gmail API, like archiving or labeling multiple messages at once?

Yes, batch operations are supported for archiving, labeling, and marking read/unread across large mail sets. The Skill handles multiple messages in a single command, reducing manual effort in email management.

How do I set up OAuth2 authentication to access Gmail via CLI?

The Skill uses google-auth and google-auth-oauthlib to handle OAuth2 credential flow with Gmail API scopes. After installing dependencies and running the setup, credentials are cached locally for subsequent operations.

Does this work for sending emails with attachments and HTML content?

Yes, the Skill drafts and sends messages with optional HTML content and attachments. It also supports replies to existing messages, enabling rich email composition from the CLI.

What email management tasks can I automate beyond reading and sending?

You can retrieve and download attachments, manage labels, create and delete filters, search with queries, and read full message bodies or metadata. These operations combine for complete email administration workflows.

Can I search and filter emails when reading them with the CLI?

Yes, the Skill accepts search queries to read specific emails and threads, letting you filter by sender, subject, labels, or other criteria. Results include message metadata or full bodies as needed.