gmcli

GitHub

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

gmcli/SKILL.md badlogic/pi-skills

触发场景

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

安装

npx skills add badlogic/pi-skills --skill gmcli -g -y
更多选项

非标准路径

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

不安装直接使用

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

版本历史

  • 90bb51c 当前 2026-07-25 09:42

同 Skill 集合

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

元信息

文件数
0
版本
90bb51c
Hash
5985513a
收录时间
2026-07-25 09:42

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-17 21:01
浙ICP备14020137号-1