← 返回
未分类 Key 中文

GoG CLI Complete

Google Workspace CLI for Gmail, Calendar, Chat, Classroom, Drive, Docs, Slides, Sheets, Forms, Apps Script, Contacts, Tasks, People, Admin, Groups, and Keep.
Google Workspace CLI,支持 Gmail、日历、聊天、课堂、网盘、文档、幻灯片、表格、表单、Apps Script、联系人、任务、人员、管理、群组和 Keep。
iiroak
未分类 clawhub v1.0.3 1 版本 100000 Key: 需要
★ 0
Stars
📥 429
下载
💾 0
安装
1
版本
#latest

概述

---

name: gog-complete

description: "Google Workspace CLI for Gmail, Calendar, Chat, Classroom, Drive, Docs, Slides, Sheets, Forms, Apps Script, Contacts, Tasks, People, Admin, Groups, and Keep."

homepage: https://gogcli.sh

metadata:

{

"openclaw":

{

"emoji": "🎮",

"requires": { "bins": ["gog"] },

"install":

[

{

"id": "brew",

"kind": "brew",

"formula": "steipete/tap/gogcli",

"bins": ["gog"],

"label": "Install gog (brew)",

},

],

},

}


gog

Use gog for Gmail, Calendar, Chat, Classroom, Drive, Docs, Slides, Sheets, Forms, Apps Script, Contacts, Tasks, People, Admin, Groups, and Keep. Requires OAuth setup or service account auth.

Setup (once)

gog auth credentials /path/to/client_secret.json
gog auth add you@gmail.com --services gmail,calendar,drive,contacts,docs,sheets
gog auth list

Set default account to avoid repeating --account:

export GOG_ACCOUNT=you@gmail.com

Agent Behavior Rules

  • Always confirm before sending mail, creating events, or deleting anything.
  • Prefer --json plus --no-input for scripting and automation.
  • Use gog gmail search for threads; use gog gmail messages search when individual messages are needed.
  • Prefer plain text for email. Use --body-file for multi-paragraph. Use --body-html only when rich formatting is required.
  • --body does not unescape \n. For multi-line use a heredoc or --body-file - (stdin).
  • Set 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 Failure

The CLI evolves frequently. Flags and subcommands may change between versions. If any command fails (unknown flag, unknown command, wrong syntax):

  1. Run gog --help to see available subcommands and their aliases.
  2. Run gog --help to see the exact flags accepted.
  3. Navigate deeper: gog --help until you find the correct syntax.
  4. Never assume a flag exists — verify with --help first if unsure.
  5. Use gog schema for machine-readable command/flag schema (JSON).

Example self-discovery flow:

# Command fails
gog calendar events create --title "Test"   # ERROR: unknown flag --title

# Discover correct subcommand
gog calendar --help                          # Shows: create (add,new) <calendarId> [flags]

# Discover correct flags
gog calendar create --help                   # Shows: --summary, --from, --to, etc.

# Use correct syntax
gog calendar create primary --summary "Test" --from 2026-04-04T21:00:00Z --to 2026-04-04T22:00:00Z

This self-discovery pattern applies 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)
  • --results-only — JSON mode: emit only primary result (drops nextPageToken etc.)
  • --select — JSON mode: select comma-separated fields (dot paths supported)
  • -n, --dry-run — Do not make changes; print intended actions and exit
  • -y, --force — Skip confirmations
  • --no-input — Never prompt (CI/agent mode)
  • -v, --verbose — Debug logging
  • --color
  • --out / --output — Output file path
  • --out-dir / --output-dir — Output directory (attachments)
  • --enable-commands — Allowlist top-level commands (sandboxing)
  • --version — Print version

Top-Level Aliases

These shortcuts avoid typing the full path:

  • gog sendgog gmail send
  • gog ls / gog listgog drive ls
  • gog search / gog findgog drive search
  • gog download / gog dlgog drive download
  • gog upload / gog up / gog putgog drive upload
  • gog open / gog browse → Print web URL for a Google ID
  • gog logingog auth add
  • gog logoutgog auth remove
  • gog status / gog stgog auth status
  • gog me / gog whoamigog people me

Command Group Aliases

  • gog calgog calendar
  • gog drvgog drive
  • gog mail / gog emailgog gmail
  • gog docgog docs
  • gog slidegog slides
  • gog sheetgog sheets
  • gog formgog forms
  • gog contactgog contacts
  • gog taskgog tasks
  • gog persongog people
  • gog groupgog groups
  • gog classgog classroom
  • gog script / gog apps-scriptgog appscript

Environment Variables

  • GOG_ACCOUNT — Default account
  • GOG_ACCESS_TOKEN — Direct access token (CI; ~1h, no refresh)
  • GOG_CLIENT — OAuth client name
  • GOG_JSON / GOG_PLAIN — Default output format
  • GOG_COLOR — Color mode
  • GOG_TIMEZONE — Default timezone (IANA, UTC, or local)
  • GOG_ENABLE_COMMANDS — Command allowlist
  • GOG_KEYRING_BACKEND — Force keyring (auto/keychain/file)
  • GOG_KEYRING_PASSWORD — Password for file keyring (CI)

Authentication Commands

# Credentials
gog auth credentials <path>
gog auth credentials list
gog --client <name> auth credentials <path>
gog --client <name> auth credentials <path> --domain example.com

# Add account
gog auth add <email>
gog auth add <email> --services gmail,calendar,drive,contacts,docs,sheets
gog auth add <email> --services drive --drive-scope full|readonly|file
gog auth add <email> --services gmail --gmail-scope full|readonly
gog auth add <email> --services gmail --extra-scopes <scope-uri>
gog auth add <email> --readonly
gog auth add <email> --services user --force-consent

# Headless / remote flows
gog auth add <email> --services user --manual
gog auth add <email> --services user --remote --step 1
gog auth add <email> --services user --remote --step 2 --auth-url '<url>'
gog auth add <email> --listen-addr 0.0.0.0:8080 --redirect-host gog.example.com

# Direct access token
gog --access-token "$(gcloud auth print-access-token)" gmail labels list

# Service accounts (Workspace domain-wide delegation)
gog auth service-account set <email> --key <path>
gog auth service-account status <email>
gog auth service-account unset <email>
gog auth keep <email> --key <path>

# Keyring
gog auth keyring
gog auth keyring file|keychain|auto

# Management
gog auth list
gog auth list --check
gog auth status
gog auth services
gog auth remove <email>
gog auth manage
gog auth tokens

# Aliases
gog auth alias set <alias> <email>
gog auth alias list
gog auth alias unset <alias>

Config Commands

gog config path
gog config list
gog config keys
gog config get <key>
gog config set <key> <value>
gog config unset <key>

Config (JSON5) supports: keyring_backend, default_timezone, account_aliases, account_clients, client_domains.

Gmail

Search & Read

gog gmail search 'newer_than:7d' --max 10
gog gmail messages search 'in:inbox from:ryanair.com' --max 20
gog gmail messages search 'newer_than:7d' --max 3 --include-body --json
gog gmail thread get <threadId>
gog gmail thread get <threadId> --download
gog gmail thread get <threadId> --download --out-dir ./attachments
gog gmail get <messageId>
gog gmail get <messageId> --format metadata
gog gmail attachment <messageId> <attachmentId>
gog gmail attachment <messageId> <attachmentId> --out ./file.bin
gog gmail url <threadId>

Send & Compose

gog gmail send --to a@b.com --subject "Hi" --body "Hello"
gog gmail send --to a@b.com --subject "Hi" --body-file ./message.txt
gog gmail send --to a@b.com --subject "Hi" --body-file -
gog gmail send --to a@b.com --subject "Hi" --body "Plain" --body-html "<p>Hello</p>"
gog gmail send --reply-to-message-id <msgId> --quote --to a@b.com --subject "Re: Hi" --body "Reply"
gog gmail send --to a@b.com --subject "Hello" --body-html "<p>Hi!</p>" --track

Drafts

gog gmail drafts list
gog gmail drafts create --to a@b.com --subject "Draft" --body "Body"
gog gmail drafts create --reply-to-message-id <msgId> --quote --subject "Re: Hi" --body "Reply"
gog gmail drafts update <draftId> --subject "New" --body "Updated"
gog gmail drafts update <draftId> --to a@b.com --subject "New" --body "Updated"
gog gmail drafts update <draftId> --reply-to-message-id <msgId> --quote --subject "Re: Hi" --body "Reply"
gog gmail drafts update <draftId> --quote --subject "Re: Hi" --body "Reply"
gog gmail drafts send <draftId>

Thread & Message Modification

gog gmail thread modify <threadId> --add STARRED --remove INBOX
gog gmail labels modify <threadId> --add STARRED --remove INBOX
gog gmail batch delete <msgId1> <msgId2>
gog gmail batch modify <msgId1> <msgId2> --add STARRED --remove INBOX

Labels

gog gmail labels list
gog gmail labels get INBOX --json
gog gmail labels create "My Label"
gog gmail labels rename "Old Label" "New Label"
gog gmail labels delete <labelIdOrName>

Filters

gog gmail filters list
gog gmail filters create --from 'noreply@example.com' --add-label 'Notifications'
gog gmail filters delete <filterId>
gog gmail filters export --out ./filters.json

Settings

gog gmail autoforward get
gog gmail autoforward enable --email forward@example.com
gog gmail autoforward disable
gog gmail forwarding list
gog gmail forwarding add --email forward@example.com
gog gmail sendas list
gog gmail sendas create --email alias@example.com
gog gmail vacation get
gog gmail vacation enable --subject "Out of office" --message "..."
gog gmail vacation disable

Delegation (Workspace)

gog gmail delegates list
gog gmail delegates add --email delegate@example.com
gog gmail delegates remove --email delegate@example.com

Watch (Pub/Sub)

gog gmail watch start --topic projects/<p>/topics/<t> --label INBOX
gog gmail watch serve --bind 127.0.0.1 --token <shared> --hook-url <url>
gog gmail watch serve --bind 0.0.0.0 --verify-oidc --oidc-email <svc@...> --hook-url <url>
gog gmail watch serve --bind 127.0.0.1 --token <shared> --fetch-delay 5 --hook-url <url>
gog gmail watch serve --bind 127.0.0.1 --token <shared> --exclude-labels SPAM,TRASH --hook-url <url>
gog gmail history --since <historyId>

Email Tracking

gog gmail track setup --worker-url https://gog-email-tracker.<acct>.workers.dev
gog gmail send --to a@b.com --subject "Hello" --body-html "<p>Hi!</p>" --track
gog gmail track opens <tracking_id>
gog gmail track opens --to recipient@example.com
gog gmail track status

Email Formatting Guide

版本历史

共 1 个版本

  • v1.0.3 当前
    2026-05-03 08:28 安全 安全

🔗 相关推荐

Github CLI Complete

iiroak
在 cli‑trunk 上使用 GitHub CLI (gh) 的完整技能:包括完整命令映射、子命令、使用模式、JSON 输出以及Issues、PR 等实用工作流。
★ 0 📥 399

RedTransporteAPI

iiroak
CLI tool for managing local GTFS data, querying stops, routes, real-time predictions, and planning public transit trips
★ 0 📥 397

iBus.CL CLI (API Transporte RED Chile)

iiroak
命令行工具,实时查询智利公交站点公交车到达时间,支持可读输出或 JSON 格式。
★ 0 📥 307