运行时依赖
安装命令
点击复制技能文档
gog
Use gog for GmAIl, Calendar, Chat, Classroom, Drive, Docs, Slides, Sheets, Forms, 应用s Script, Contacts, Tasks, People, Admin, Groups, and Keep. Requires OAuth 设置up or 服务 account auth.
设置up (once) gog auth 凭证s /path/to/命令行工具ent_secret.json gog auth 添加 you@gmAIl.com --服务s gmAIl,calendar,drive,contacts,docs,sheets gog auth 列出
设置 default account to avoid repeating --account:
导出 GOG_ACCOUNT=you@gmAIl.com
代理 Behavior Rules Always confirm before 发送ing mAIl, creating 事件, or deleting anything. Prefer --json plus --no-输入 for scripting and 自动化. Use gog gmAIl 搜索 for threads; use gog gmAIl messages 搜索 when individual messages are needed. Prefer plAIn text for emAIl. Use --body-file for multi-paragraph. Use --body-html only when rich 格式化ting is required. --body does not unescape \n. For multi-line use a heredoc or --body-file - (stdin). 设置 GOG_ACCOUNT to avoid repeating --account on every command. Use GOG_HELP=full gog --help if you need to discover subcommands not documented here. CRITICAL: Self-Discovery on 失败
The 命令行工具 evolves frequently. Flags and subcommands may change between versions. If any command fAIls (unknown flag, unknown command, wrong syntax):
运行 gog --help to see avAIlable subcommands and their aliases. 运行 gog --help to see the exact flags accepted. Navigate deeper: gog --help until you find the correct syntax. Never assume a flag exists — 验证 with --help first if unsure. Use gog 模式 for machine-readable command/flag 模式 (JSON).
Example self-discovery flow:
# Command fAIls gog calendar 事件 创建 --title "Test" # ERROR: unknown flag --title
# Discover correct subcommand gog calendar --help # Shows: 创建 (添加,new) [flags]
# Discover correct flags gog calendar 创建 --help # Shows: --summary, --from, --to, etc.
# Use correct syntax gog calendar 创建 primary --summary "Test" --from 2026-04-04T21:00:00Z --to 2026-04-04T22:00:00Z
This self-discovery pattern 应用lies to ALL command groups. Always fall back to --help navigation.
Global Flags -a, --account — Account override -j, --json — JSON stdout (best for parsing) -p, --plAIn — Stable TSV stdout (no colors) --结果s-only — JSON mode: emit only primary 结果 (drops nextPa获取oken etc.) --select — JSON mode: select comma-separated fields (dot paths supported) -n, --dry-运行 — Do not make changes; print intended actions and exit -y, --force — Skip confirmations --no-输入 — Never prompt (CI/代理 mode) -v, --verbose — 调试 记录ging --color --out / --输出 — 输出 file path --out-dir / --输出-dir — 输出 directory (attachments) --enable-commands — Allow列出 top-level commands (sandboxing) --version — Print version Top-Level Aliases
These shortcuts avoid typing the full path:
gog 发送 → gog gmAIl 发送 gog ls / gog 列出 → gog drive ls gog 搜索 / gog find → gog drive 搜索 gog 下载 / gog dl → gog drive 下载 gog 上传 / gog up / gog put → gog drive 上传 gog open / gog browse → Print 网页 URL for a Google ID gog 记录in → gog auth 添加 gog 记录out → gog auth 移除 gog 状态 / gog st → gog auth 状态 gog me / gog whoami → gog people me Command Group Aliases gog cal → gog calendar gog drv → gog drive gog mAIl / gog emAIl → gog gmAIl gog doc → gog docs gog slide → gog slides gog sheet → gog sheets gog form → gog forms gog contact → gog contacts gog task → gog tasks gog person → gog people gog group → gog groups gog class → gog classroom gog script / gog 应用s-script → gog 应用script 环境 Variables GOG_ACCOUNT — Default account GOG_访问_令牌 — Direct 访问 令牌 (CI; ~1h, no refresh) GOG_命令行工具ENT — OAuth 命令行工具ent name GOG_JSON / GOG_PLAIN — Default 输出 格式化 GOG_COLOR — Color mode GOG_TIMEZONE — Default timezone (IANA, UTC, or local) GOG_ENABLE_COMMANDS — Command allow列出 GOG_KEYRING_BACKEND — Force keyring (auto/keychAIn/file) GOG_KEYRING_PASSWORD — Password for file keyring (CI) Authentication Commands # 凭证s gog auth 凭证s gog auth 凭证s 列出 gog --命令行工具ent auth 凭证s gog --命令行工具ent auth 凭证s --domAIn example.com
# 添加 account gog auth 添加 gog auth 添加 --服务s gmAIl,calendar,drive,contacts,docs,sheets gog auth 添加 --服务s drive --drive-scope full|readonly|file gog auth 添加 --服务s gmAIl --gmAIl-scope full|readonly gog auth 添加 --服务s gmAIl --extra-scopes gog auth 添加 --readonly gog auth 添加 --服务s user --force-consent
# Headless / remote flows gog auth 添加 --服务s user --manual gog auth 添加 --服务s user --remote --step 1 gog auth 添加 --服务s user --remote --step 2 --auth-url '' gog auth 添加 --列出en-添加r 0.0.0.0:8080 --redirect-host gog.example.com
# Direct 访问