gmcli

Manage Gmail accounts from the command line for searching, reading, and sending email.

Updated Mar 12, 2026
One-click install
npx skills add https://github.com/RavitejaKarra24/dotfiles --skill gmcli-ravitejakarra24
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gmcli
Source: https://github.com/RavitejaKarra24/dotfiles/tree/main/pi/.pi/agent/skills/pi-skills/gmcli
Command: npx skills add https://github.com/RavitejaKarra24/dotfiles --skill gmcli-ravitejakarra24

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @mariozechner/gmcli.

What problem does it solve? Accessing Gmail programmatically usually requires writing custom API integrations with OAuth handling. This Skill provides a ready-made command-line interface for Gmail so you can search emails, read threads, send messages, and manage drafts and labels directly from the terminal or an AI agent. ## Core Features & Use Cases - Email Search & Reading: Search mailboxes using Gmail query syntax and read full threads with all messages. - Sending & Drafts: Send emails with subject and body, and list or manage existing drafts. - Labels & Attachments: List labels and download attachments to a local directory. - Use Case: Ask your agent to find the latest invoice email from a vendor, read the thread, download the attachment, and reply with a confirmation — all without opening a browser. ## Quick Start Use gmcli to search my Gmail for unread messages from this week and summarize the most important threads.

Frequently Asked Questions about gmcli

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

FAQPage Schema
How do I search Gmail from the command line?

Install gmcli globally via npm, configure an account with OAuth credentials, then run gmcli <email> search "<query>" using standard Gmail query syntax. Results return matching messages directly in the terminal.

How do I send an email using gmcli?

Run gmcli <email> send --to <emails> --subject <s> --body <b> after configuring your account. The command sends the message through the Gmail API using your authenticated account.

What setup is required before using gmcli with Gmail?

You need a Google Cloud project with the Gmail API enabled, OAuth branding configured, test users added, and a Desktop app OAuth client. Download the credentials JSON, register it with gmcli accounts credentials, then add your account.

Can gmcli work in headless or browserless environments?

Yes, gmcli supports browserless OAuth flows. Use the --manual flag when adding an account with gmcli accounts add <email> to complete authentication without opening a local browser.

Where does gmcli store credentials and downloaded attachments?

gmcli stores OAuth client credentials in ~/.gmcli/credentials.json, account tokens in ~/.gmcli/accounts.json, and downloaded attachments in ~/.gmcli/attachments/. Keep these files private since they grant mailbox access.