gog-cli by intellectronica/agent-skills
npx skills add https://github.com/intellectronica/agent-skills --skill gog-cli一个快速、对脚本友好的 Google Workspace 服务命令行界面,支持 JSON 优先输出和多账户。
仓库 : https://github.com/steipete/gogcli
此技能假定 gog 已安装并授权。如果命令因身份验证错误而失败,请告知用户他们需要:
brew install steipete/tap/gogcligog auth credentials <path-to-credentials.json>gog auth add user@gmail.com --services all不要尝试自动解决身份验证问题。向用户提供相关命令,让他们自行处理。
Gmail、Calendar、Drive、Docs、Sheets、Slides、Chat (Workspace)、Classroom、Contacts、Tasks、People、Groups (Workspace)、Keep (Workspace,仅服务账户)。
--account <email> # 选择账户
--client <name> # 选择 OAuth 客户端
--json # JSON 输出
--plain # TSV 输出(用于脚本)
--force # 跳过确认
--no-input # 失败而非提示
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
gog --account work@example.com gmail search "is:unread" # 使用特定账户
gog gmail search "is:unread" --json | jq '.threads[].id' # JSON 用于解析
gog gmail search "is:unread" --plain | cut -f1 # 纯文本用于 shell
gog gmail search "is:unread" --max 10 --page <token> # 分页
gog gmail search "is:unread from:boss@example.com newer_than:7d"
gog gmail messages search "is:unread" --include-body
gog gmail thread get <threadId>
gog gmail get <messageId> --format full
# 基本发送
gog gmail send --to user@example.com --subject "Hello" --body "Message"
# 带 HTML 和附件
gog gmail send --to user@example.com --subject "Report" \
--body-html "<h1>Report</h1>" --attach ~/report.pdf
# 回复
gog gmail send --to user@example.com --subject "Re: Original" \
--body "Reply" --reply-to-message-id <messageId>
gog gmail labels list
gog gmail labels create "Project/Subproject"
gog gmail thread modify <threadId> --add "Label" --remove INBOX
有关完整的 Gmail 参考,包括草稿、过滤器、休假、委派、跟踪和监视,请参阅 references/gmail.md。
gog calendar events primary --from "2024-12-01" --to "2024-12-31" --weekday
gog calendar events primary --query "meeting"
# 创建事件
gog calendar create primary --summary "Meeting" \
--from "2024-12-20T14:00:00" --to "2024-12-20T15:00:00"
# 带参与者和重复规则
gog calendar create primary --summary "Weekly Standup" \
--from "2024-12-20T09:00:00" --to "2024-12-20T09:30:00" \
--attendees "alice@example.com,bob@example.com" \
--rrule "FREQ=WEEKLY;BYDAY=MO,WE,FR"
# 回复
gog calendar respond primary <eventId> --status accepted
gog calendar focus-time create primary --from DT --to DT --auto-decline
gog calendar ooo create primary --from DT --to DT --decline-message "Away"
gog calendar working-location create primary --from DT --to DT --location home
完整的日历参考,请参阅 references/calendar.md。
gog drive ls --parent <folderId>
gog drive search "quarterly report"
gog drive download <fileId> --out ~/Downloads/
gog drive upload ~/report.pdf --parent <folderId>
gog drive mkdir "New Folder" --parent <folderId>
gog drive share <fileId> --email user@example.com --role writer
gog sheets read <spreadsheetId> "Sheet1!A1:D10"
gog sheets write <spreadsheetId> "Sheet1!A1:B2" --values '[["Name","Age"],["Alice",30]]'
gog sheets append <spreadsheetId> "Sheet1!A:B" --values '[["Bob",25]]'
gog sheets format <spreadsheetId> "Sheet1!A1:D1" --bold --bg-color "#FFCC00"
gog docs export <documentId> --format pdf --out ~/doc.pdf
gog slides export <presentationId> --format pptx --out ~/slides.pptx
完整的 Drive/Docs/Sheets/Slides 参考,请参阅 references/drive-docs.md。
gog tasks lists
gog tasks list <tasklistId>
gog tasks add <tasklistId> --title "Buy groceries" --due "2024-12-20"
gog tasks add <tasklistId> --title "Weekly review" --due "2024-12-20" --repeat weekly
gog tasks done <tasklistId> <taskId>
gog contacts search "john"
gog contacts create --given "John" --family "Doe" --email "john@example.com"
gog contacts directory search "smith" # Workspace
gog classroom courses --state ACTIVE
gog classroom students <courseId>
gog classroom coursework create <courseId> --title "Homework" --type ASSIGNMENT --due "2024-12-31T23:59:59Z"
gog classroom submissions grade <courseId> <courseworkId> <submissionId> --grade 95
关于 Classroom、Chat、Contacts、Tasks、People、Groups、Keep,请参阅 references/other-services.md。
~/Library/Application Support/gogcli/config.json~/.config/gogcli/config.json%AppData%\gogcli\config.jsongog config set default_timezone America/New_York
gog config set default_account user@gmail.com
gog config list
GOG_ACCOUNT=user@gmail.com # 默认账户
GOG_CLIENT=work # OAuth 客户端
GOG_JSON=1 # 默认 JSON 输出
GOG_PLAIN=1 # 默认纯文本输出
GOG_TIMEZONE=America/New_York # 显示时区
GOG_ENABLE_COMMANDS=calendar,tasks # 命令允许列表
完整配置,请参阅 references/configuration.md。
gog --account work@example.com gmail search "is:unread"
gog auth alias set work work@example.com
gog --account work gmail search "is:unread"
gog auth list --check
关于身份验证(包括服务账户),请参阅 references/authentication.md。
# JSON 处理
gog gmail search "is:unread" --json | jq -r '.threads[].id'
# 批量操作
gog gmail search "older_than:30d" --json | \
jq -r '.threads[].id' | \
xargs -I {} gog gmail thread modify {} --add Archive --remove INBOX
# 非交互式
gog gmail send --to user@example.com --subject "Test" --body "Hi" --force
如果命令失败,请告知用户可能的原因:
| 错误 | 原因 | 解决方案 |
|---|---|---|
no credentials | OAuth 未配置 | gog auth credentials <file> |
token expired | 身份验证无效 | gog auth add <email> --force-consent |
insufficient scope | 缺少权限 | gog auth add <email> --services <services> |
command not found | 未安装 | brew install steipete/tap/gogcli |
状态检查:
gog auth list --check
gog auth status
references/command-reference.md - 完整的命令规范references/authentication.md - 身份验证、凭据、多账户references/configuration.md - 配置和环境变量references/gmail.md - Gmail 操作references/calendar.md - 日历操作references/drive-docs.md - Drive、Docs、Sheets、Slidesreferences/other-services.md - Classroom、Chat、Contacts、Tasks、People、Groups、Keep每周安装次数
217
仓库
GitHub 星标数
228
首次出现
2026年1月29日
安全审计
安装于
codex188
opencode185
gemini-cli180
cursor174
github-copilot170
amp158
A fast, script-friendly CLI for Google Workspace services with JSON-first output and multi-account support.
Repository : https://github.com/steipete/gogcli
This skill assumes gog is installed and authorised. If commands fail with authentication errors, inform the user they need to:
brew install steipete/tap/gogcligog auth credentials <path-to-credentials.json>gog auth add user@gmail.com --services allDo not attempt to resolve authentication issues automatically. Provide the user with the relevant command and let them handle it.
Gmail, Calendar, Drive, Docs, Sheets, Slides, Chat (Workspace), Classroom, Contacts, Tasks, People, Groups (Workspace), Keep (Workspace, service account only).
--account <email> # Select account
--client <name> # Select OAuth client
--json # JSON output
--plain # TSV output (for scripting)
--force # Skip confirmations
--no-input # Fail instead of prompting
gog --account work@example.com gmail search "is:unread" # Use specific account
gog gmail search "is:unread" --json | jq '.threads[].id' # JSON for parsing
gog gmail search "is:unread" --plain | cut -f1 # Plain for shell
gog gmail search "is:unread" --max 10 --page <token> # Pagination
gog gmail search "is:unread from:boss@example.com newer_than:7d"
gog gmail messages search "is:unread" --include-body
gog gmail thread get <threadId>
gog gmail get <messageId> --format full
# Basic send
gog gmail send --to user@example.com --subject "Hello" --body "Message"
# With HTML and attachments
gog gmail send --to user@example.com --subject "Report" \
--body-html "<h1>Report</h1>" --attach ~/report.pdf
# Reply
gog gmail send --to user@example.com --subject "Re: Original" \
--body "Reply" --reply-to-message-id <messageId>
gog gmail labels list
gog gmail labels create "Project/Subproject"
gog gmail thread modify <threadId> --add "Label" --remove INBOX
For full Gmail reference including drafts, filters, vacation, delegates, tracking, and watch, see references/gmail.md.
gog calendar events primary --from "2024-12-01" --to "2024-12-31" --weekday
gog calendar events primary --query "meeting"
# Create event
gog calendar create primary --summary "Meeting" \
--from "2024-12-20T14:00:00" --to "2024-12-20T15:00:00"
# With attendees and recurrence
gog calendar create primary --summary "Weekly Standup" \
--from "2024-12-20T09:00:00" --to "2024-12-20T09:30:00" \
--attendees "alice@example.com,bob@example.com" \
--rrule "FREQ=WEEKLY;BYDAY=MO,WE,FR"
# Respond
gog calendar respond primary <eventId> --status accepted
gog calendar focus-time create primary --from DT --to DT --auto-decline
gog calendar ooo create primary --from DT --to DT --decline-message "Away"
gog calendar working-location create primary --from DT --to DT --location home
For full Calendar reference, see references/calendar.md.
gog drive ls --parent <folderId>
gog drive search "quarterly report"
gog drive download <fileId> --out ~/Downloads/
gog drive upload ~/report.pdf --parent <folderId>
gog drive mkdir "New Folder" --parent <folderId>
gog drive share <fileId> --email user@example.com --role writer
gog sheets read <spreadsheetId> "Sheet1!A1:D10"
gog sheets write <spreadsheetId> "Sheet1!A1:B2" --values '[["Name","Age"],["Alice",30]]'
gog sheets append <spreadsheetId> "Sheet1!A:B" --values '[["Bob",25]]'
gog sheets format <spreadsheetId> "Sheet1!A1:D1" --bold --bg-color "#FFCC00"
gog docs export <documentId> --format pdf --out ~/doc.pdf
gog slides export <presentationId> --format pptx --out ~/slides.pptx
For full Drive/Docs/Sheets/Slides reference, see references/drive-docs.md.
gog tasks lists
gog tasks list <tasklistId>
gog tasks add <tasklistId> --title "Buy groceries" --due "2024-12-20"
gog tasks add <tasklistId> --title "Weekly review" --due "2024-12-20" --repeat weekly
gog tasks done <tasklistId> <taskId>
gog contacts search "john"
gog contacts create --given "John" --family "Doe" --email "john@example.com"
gog contacts directory search "smith" # Workspace
gog classroom courses --state ACTIVE
gog classroom students <courseId>
gog classroom coursework create <courseId> --title "Homework" --type ASSIGNMENT --due "2024-12-31T23:59:59Z"
gog classroom submissions grade <courseId> <courseworkId> <submissionId> --grade 95
For Classroom, Chat, Contacts, Tasks, People, Groups, Keep, see references/other-services.md.
~/Library/Application Support/gogcli/config.json~/.config/gogcli/config.json%AppData%\gogcli\config.jsongog config set default_timezone America/New_York
gog config set default_account user@gmail.com
gog config list
GOG_ACCOUNT=user@gmail.com # Default account
GOG_CLIENT=work # OAuth client
GOG_JSON=1 # Default JSON output
GOG_PLAIN=1 # Default plain output
GOG_TIMEZONE=America/New_York # Display timezone
GOG_ENABLE_COMMANDS=calendar,tasks # Command allowlist
For full configuration, see references/configuration.md.
gog --account work@example.com gmail search "is:unread"
gog auth alias set work work@example.com
gog --account work gmail search "is:unread"
gog auth list --check
For authentication including service accounts, see references/authentication.md.
# JSON processing
gog gmail search "is:unread" --json | jq -r '.threads[].id'
# Batch operations
gog gmail search "older_than:30d" --json | \
jq -r '.threads[].id' | \
xargs -I {} gog gmail thread modify {} --add Archive --remove INBOX
# Non-interactive
gog gmail send --to user@example.com --subject "Test" --body "Hi" --force
If commands fail, inform the user of the likely cause:
| Error | Cause | Solution |
|---|---|---|
no credentials | OAuth not configured | gog auth credentials <file> |
token expired | Auth invalid | gog auth add <email> --force-consent |
insufficient scope | Missing permissions | gog auth add <email> --services <services> |
Status checks:
gog auth list --check
gog auth status
references/command-reference.md - Complete command specificationreferences/authentication.md - Auth, credentials, multi-accountreferences/configuration.md - Config and environment variablesreferences/gmail.md - Gmail operationsreferences/calendar.md - Calendar operationsreferences/drive-docs.md - Drive, Docs, Sheets, Slidesreferences/other-services.md - Classroom, Chat, Contacts, Tasks, People, Groups, KeepWeekly Installs
217
Repository
GitHub Stars
228
First Seen
Jan 29, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykWarn
Installed on
codex188
opencode185
gemini-cli180
cursor174
github-copilot170
amp158
Azure 升级评估与自动化工具 - 轻松迁移 Functions 计划、托管层级和 SKU
73,200 周安装
command not found| Not installed |
brew install steipete/tap/gogcli |