gmcli
Original:🇺🇸 English
Translated
Gmail CLI for searching emails, reading threads, sending messages, managing drafts, and handling labels/attachments.
3installs
Sourcebadlogic/pi-skills
Added on
NPX Install
npx skill4agent add badlogic/pi-skills gmcliTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Gmail CLI
Command-line interface for Gmail operations.
Installation
bash
npm install -g @mariozechner/gmcliSetup
Google Cloud Console (one-time)
- Create a new project (or select existing)
- Enable the Gmail API
- Set app name in OAuth branding
- Add test users (all Gmail addresses you want to use)
- Create OAuth client:
- Click "Create Client"
- Application type: "Desktop app"
- Download the JSON file
Configure gmcli
First check if already configured:
bash
gmcli accounts listIf no accounts, guide the user through setup:
- Ask if they have a Google Cloud project with Gmail API enabled
- If not, walk them through the Google Cloud Console steps above
- Have them download the OAuth credentials JSON
- Run:
gmcli accounts credentials ~/path/to/credentials.json - Run: (use
gmcli accounts add <email>for browserless OAuth)--manual
Usage
Run for full command reference.
gmcli --helpCommon operations:
- - Search emails using Gmail query syntax
gmcli <email> search "<query>" - - Read a thread with all messages
gmcli <email> thread <threadId> - - Send email
gmcli <email> send --to <emails> --subject <s> --body <b> - - List all labels
gmcli <email> labels list - - List drafts
gmcli <email> drafts list
Data Storage
- - OAuth client credentials
~/.gmcli/credentials.json - - Account tokens
~/.gmcli/accounts.json - - Downloaded attachments
~/.gmcli/attachments/