Pi-skills gmcli
Gmail CLI for searching emails, reading threads, sending messages, managing drafts, and handling labels/attachments.
install
source · Clone the upstream repo
git clone https://github.com/badlogic/pi-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/badlogic/pi-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/gmcli" ~/.claude/skills/badlogic-pi-skills-gmcli && rm -rf "$T"
manifest:
gmcli/SKILL.mdsource content
Gmail CLI
Command-line interface for Gmail operations.
Installation
npm install -g @mariozechner/gmcli
Setup
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:
gmcli accounts list
If 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:
(usegmcli accounts add <email>
for browserless OAuth)--manual
Usage
Run
gmcli --help for full command reference.
Common operations:
- Search emails using Gmail query syntaxgmcli <email> search "<query>"
- Read a thread with all messagesgmcli <email> thread <threadId>
- Send emailgmcli <email> send --to <emails> --subject <s> --body <b>
- List all labelsgmcli <email> labels list
- List draftsgmcli <email> drafts list
Data Storage
- OAuth client credentials~/.gmcli/credentials.json
- Account tokens~/.gmcli/accounts.json
- Downloaded attachments~/.gmcli/attachments/