AgentSkillsCN

gog-cli

通过 gog-cli 以命令行方式与 Google Workspace 服务交互。当用户希望使用 Gmail(搜索、发送、标签、过滤器)、Calendar(事件、日程安排、空闲时间)、Drive(上传、下载、共享)、Sheets(读取、写入、格式化)、Docs/Slides(创建、导出)、Contacts、Tasks、Chat,或 Classroom 时,可使用此技能。触发关键词:“Google”、“Gmail”、“Calendar”、“Drive”、“Sheets”、“Docs”、“Slides”、“Contacts”、“Tasks”、“Google Chat”、“Classroom”,或任何 gog 命令。

SKILL.md
--- frontmatter
name: gog-cli
description: Interact with Google Workspace services via command line using gog-cli. Use when user wants to work with Gmail (search, send, labels, filters), Calendar (events, scheduling, availability), Drive (upload, download, share), Sheets (read, write, format), Docs/Slides (create, export), Contacts, Tasks, Chat, or Classroom. Triggers on "Google", "Gmail", "Calendar", "Drive", "Sheets", "Docs", "Slides", "Contacts", "Tasks", "Google Chat", "Classroom", or any gog command.

gog-cli - Google Workspace CLI

Command-line tool for interacting with Google Workspace services.

Service References

Load only the reference file for the service you need:

Global Options

Apply to any command:

OptionDescription
--account <email|alias>Specify account to use
--jsonMachine-readable JSON output
--plainTab-separated plaintext
--forceSkip confirmation prompts
--no-inputFail rather than prompt (CI-friendly)
--verboseShow API requests/responses

Quick Examples

bash
# Gmail: search recent emails
gog gmail search 'newer_than:7d' --max 10

# Calendar: today's events
gog calendar events primary --today

# Drive: list files
gog drive ls --max 20

# Sheets: read cells
gog sheets get <spreadsheetId> 'Sheet1!A1:B10'

# Tasks: list task lists
gog tasks lists

Utility Commands

bash
# Current time
gog time now
gog time now --timezone America/New_York

# Auth status
gog auth list --check
gog auth status

Tips

  • Use --json for scripting and piping to jq
  • Most IDs can be found in Google URLs (e.g., spreadsheet ID in sheets URL)
  • Gmail search uses Google's search syntax (from:, to:, subject:, newer_than:, etc.)
  • Calendar accepts "primary" as calendarId for main calendar