gmcli

GitHub

Gmail命令行工具,支持搜索邮件、读取线程、发送邮件及管理草稿和标签。提供安装配置指南及常用操作示例。

gmcli/SKILL.md badlogic/pi-skills

Trigger Scenarios

用户需要查询或管理Gmail邮件 用户需要通过脚本自动化处理Gmail任务

Install

npx skills add badlogic/pi-skills --skill gmcli -g -y
More Options

Non-standard path

npx skills add https://github.com/badlogic/pi-skills/tree/main/gmcli -g -y

Use without installing

npx skills use badlogic/pi-skills@gmcli

指定 Agent (Claude Code)

npx skills add badlogic/pi-skills --skill gmcli -a claude-code -g -y

安装 repo 全部 skill

npx skills add badlogic/pi-skills --all -g -y

预览 repo 内 skill

npx skills add badlogic/pi-skills --list

SKILL.md

Frontmatter
{
    "name": "gmcli",
    "description": "Gmail CLI for searching emails, reading threads, sending messages, managing drafts, and handling labels\/attachments."
}

Gmail CLI

Command-line interface for Gmail operations.

Installation

npm install -g @mariozechner/gmcli

Setup

Google Cloud Console (one-time)

  1. Create a new project (or select existing)
  2. Enable the Gmail API
  3. Set app name in OAuth branding
  4. Add test users (all Gmail addresses you want to use)
  5. 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:

  1. Ask if they have a Google Cloud project with Gmail API enabled
  2. If not, walk them through the Google Cloud Console steps above
  3. Have them download the OAuth credentials JSON
  4. Run: gmcli accounts credentials ~/path/to/credentials.json
  5. Run: gmcli accounts add <email> (use --manual for browserless OAuth)

Usage

Run gmcli --help for full command reference.

Common operations:

  • gmcli <email> search "<query>" - Search emails using Gmail query syntax
  • gmcli <email> thread <threadId> - Read a thread with all messages
  • gmcli <email> send --to <emails> --subject <s> --body <b> - Send email
  • gmcli <email> labels list - List all labels
  • gmcli <email> drafts list - List drafts

Data Storage

  • ~/.gmcli/credentials.json - OAuth client credentials
  • ~/.gmcli/accounts.json - Account tokens
  • ~/.gmcli/attachments/ - Downloaded attachments

Version History

  • 90bb51c Current 2026-07-25 09:42

Same Skill Collection

browser-tools/SKILL.md
gccli/SKILL.md
gdcli/SKILL.md
transcribe/SKILL.md
vscode/SKILL.md
youtube-transcript/SKILL.md

Metadata

Files
0
Version
90bb51c
Hash
5985513a
Indexed
2026-07-25 09:42

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-25 06:42
浙ICP备14020137号-1