Agent skill

gmail

Gmail CLI for searching, reading threads, managing labels, and sending emails. Use when you need to check inbox, read emails, send messages, or manage email labels.

Stars 0
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/bentossell/bentos/tree/main/assets/factory-skills/gmail

SKILL.md

Gmail CLI (gmcli)

You have access to gmcli - a minimal Gmail CLI. All commands use the format:

bash
gmcli <email> <command> [options]

Available Accounts

Commands

Search Emails

bash
gmcli <email> search <query> [--max N]

Query examples:

Examples:

bash
gmcli [email protected] search "in:inbox" --max 10
gmcli [email protected] search "is:unread" --max 50
gmcli [email protected] search "from:[email protected] has:attachment"

Read Thread

bash
gmcli <email> thread <threadId>
gmcli <email> thread <threadId> --download  # Download attachments

List Labels

bash
gmcli <email> labels list

Modify Labels

bash
gmcli <email> labels <threadIds...> --add LABEL --remove LABEL

System labels: INBOX, UNREAD, STARRED, IMPORTANT, TRASH, SPAM

Examples:

bash
gmcli [email protected] labels abc123 --remove UNREAD
gmcli [email protected] labels abc123 --add STARRED

Send Email

bash
gmcli <email> send --to <emails> --subject <s> --body <b> [options]

Options:

  • --to <emails> - Recipients (comma-separated, required)
  • --subject <s> - Subject line (required)
  • --body <b> - Message body (required)
  • --cc <emails> - CC recipients
  • --bcc <emails> - BCC recipients
  • --reply-to <messageId> - Reply to a message
  • --attach <file> - Attach file (can use multiple times)

Examples:

bash
gmcli [email protected] send --to [email protected] --subject "Hi" --body "Hello there"
gmcli [email protected] send --to [email protected] --subject "Re: Topic" --body "Reply" --reply-to 19aea1f2f3532db5

Drafts

bash
gmcli <email> drafts list
gmcli <email> drafts get <draftId>
gmcli <email> drafts create --to <emails> --subject <s> --body <b>
gmcli <email> drafts send <draftId>
gmcli <email> drafts delete <draftId>

Get Gmail URL

bash
gmcli <email> url <threadIds...>

Notes

  • Thread IDs are returned from search results
  • Use --max to limit search results (default: 10)
  • Attachments download to ~/.gmcli/attachments/

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results