Google

odyssey4me/agent-skills/skills/google

作者 odyssey4mea19e09f1b28cd02400a87638701e6217c079eb62MIT收錄於 2026年10月9日更新於 2026年10月9日

Google Workspace CLI for Gmail, Calendar, Drive, Docs, Sheets, and Slides using gogcli. Use when asked to search email, schedule meetings, manage files, edit documents, update spreadsheets, or create presentations.

AI 產生的概覽

透過 gog CLI 操作 Google Workspace,涵蓋 Gmail、日曆、雲端硬碟、文件、試算表和簡報。

功能
此技能說明代理如何呼叫 gog 命令列工具來使用 Google Workspace 各項服務。內容包括搜尋與傳送 Gmail、檢視與建立日曆活動、瀏覽與共用雲端硬碟檔案,以及讀取或編輯文件、試算表和簡報。命令支援 JSON 與純文字輸出,並提供唯讀、試執行和停用互動輸入等安全選項。
適用情境
當任務涉及 Google Workspace 資料或檔案時使用,例如搜尋郵件、安排會議、管理雲端硬碟檔案、編輯文件、更新試算表或建立簡報。
執行需求
需要 gog(gogcli)執行檔、透過 gog auth 匯入的 Google Cloud OAuth 憑證,以及對 Google API 和 OAuth 端點的對外 HTTPS 存取。不附帶指令碼,僅包含操作說明與參考文件。

Google Workspace Skill

This skill provides Google Workspace integration using the gog CLI (gogcli). The agent calls gog directly for all operations.

Prerequisites

Install the gog binary (CI-validated version is listed in the frontmatter above):

bash
# Homebrewbrew install openclaw/tap/gogcli
# Manual (Linux amd64)curl -sL https://github.com/openclaw/gogcli/releases/latest/download/gogcli_VERSION_linux_amd64.tar.gz | tar xzmv gog ~/.local/bin/

See configuration.md [blocked] for container and MCP server alternatives.

Network access

Google Workspace commands require outbound HTTPS to Google API and OAuth endpoints, including authentication and token refresh. Remote operations require outbound network access. If the agent environment restricts it, obtain access through that environment's approval or network controls before the first remote command, reusing authorization already granted. Local help and file processing do not need network access. Skill instructions do not grant network permission. Report DNS, connection, and timeout failures as network errors; do not reset credentials to resolve them. If approved access also fails, stop and report it. Authentication and permission errors require user action.

Authentication

bash
# Import credentials.json from Google Cloud Consolegog auth credentials set /path/to/credentials.json
# Authorize with only the services you need (opens browser)gog auth add [email protected] --services gmail,calendar,drive,docs,sheets,slides
# Verifygog auth doctor

Quick Reference

bash
gog gmail search "is:unread"                    # Search emailgog calendar events --today                     # Today's eventsgog drive search "quarterly report"             # Search filesgog docs cat <docId>                            # Read a documentgog sheets get <spreadsheetId> "Sheet1!A1:D10"  # Read spreadsheet rangegog slides info <presentationId>                # Presentation metadata

All commands support --json for structured output and --plain for TSV.

Commands

Gmail

bash
# Searchgog gmail search "from:[email protected] newer_than:7d"gog gmail search "is:unread label:inbox" --max 20
# Readgog gmail get <messageId>gog gmail thread get <threadId>gog gmail labels list
# Organizegog gmail mark-read <messageId>gog gmail unread <messageId>gog gmail archive <messageId>gog gmail trash <messageId>
# Sendgog gmail send --to "[email protected]" --subject "Hello" --body "Message body"gog gmail reply <messageId> --body "Reply text"gog gmail forward <messageId> --to "[email protected]"
# Draftsgog gmail drafts listgog gmail drafts create --to "[email protected]" --subject "Draft" --body "Content"gog gmail drafts send <draftId>

See gmail.md [blocked] for the full command reference.

Google Calendar

bash
# Viewgog calendar calendarsgog calendar events --todaygog calendar events --from "2026-06-25" --to "2026-06-30"gog calendar event <calendarId> <eventId>gog calendar freebusy --from "2026-06-25T09:00:00Z" --to "2026-06-25T17:00:00Z"gog calendar search "standup"
# Creategog calendar create primary --summary "Meeting" --from "2026-06-25T10:00:00" --to "2026-06-25T11:00:00"
# Managegog calendar update <calendarId> <eventId> --summary "Updated title"gog calendar delete <calendarId> <eventId>gog calendar respond <calendarId> <eventId> --status accepted

See calendar.md [blocked] for the full command reference.

Google Drive

bash
# Browsegog drive lsgog drive ls --folder <folderId>gog drive search "quarterly report"gog drive treegog drive get <fileId>
# File operationsgog drive upload report.pdf --parent <folderId>gog drive download <fileId>gog drive copy <fileId> "Copy of Report"gog drive move <fileId> --parent <newFolderId>gog drive rename <fileId> "New Name"gog drive delete <fileId>
# Sharinggog drive share <fileId> --email "[email protected]" --role writergog drive permissions <fileId>gog drive unshare <fileId> <permissionId>

See drive.md [blocked] for the full command reference.

Google Docs

bash
# Readgog docs info <docId>gog docs cat <docId>gog docs export <docId> --format mdgog docs structure <docId>
# Writegog docs create "New Document"gog docs write <docId> --body "Content to append"gog docs insert <docId> "Text to insert" --at 1gog docs find-replace <docId> "old text" "new text"gog docs format <docId> --bold --start 1 --end 10
# Tablesgog docs insert-table <docId> --rows 3 --cols 4gog docs cell-update <docId> --row 1 --col 1 --body "Header"

See docs.md [blocked] for the full command reference.

Docs Workflows

For importing markdown with formatting, table styling, and round-trip editing, see docs-workflows.md [blocked].

bash
# Import markdown as a new document with standard formattinggog docs create "Document Title" --file document.md --pagelessgog docs format <docId> --line-spacing 115 --space-below 8
# Update an existing document from markdown with formattinggog docs write <docId> --file document.md --markdown --replace --pagelessgog docs format <docId> --line-spacing 115 --space-below 8

Google Sheets

bash
# Readgog sheets metadata <spreadsheetId>gog sheets get <spreadsheetId> "Sheet1!A1:D10"gog sheets get <spreadsheetId> "Sheet1!A:A" --format FORMULA
# Writegog sheets create "New Spreadsheet"gog sheets update <spreadsheetId> "Sheet1!A1" "value1" "value2" "value3"gog sheets append <spreadsheetId> "Sheet1!A:D" "val1" "val2" "val3" "val4"gog sheets clear <spreadsheetId> "Sheet1!A1:D10"
# Structuregog sheets add-tab <spreadsheetId> "New Tab"gog sheets delete-tab <spreadsheetId> "Old Tab"gog sheets rename-tab <spreadsheetId> "Old Name" "New Name"

See sheets.md [blocked] for the full command reference.

Google Slides

bash
# Readgog slides info <presentationId>gog slides list-slides <presentationId>gog slides read-slide <presentationId> <slideId>gog slides export <presentationId> --format pptx
# Creategog slides create "New Presentation"gog slides create-from-markdown "Deck Title" --file slides.mdgog slides create-from-template <templateId> "From Template" --replacements '{"{{NAME}}":"Value"}'
# Editgog slides new-slide <presentationId>gog slides insert-text <presentationId> <objectId> "Text content"gog slides replace-text <presentationId> "find" "replace"gog slides insert-image <presentationId> <slideId> image.png --width 300

See slides.md [blocked] for the full command reference.

Examples

Search and summarize recent emails

bash
gog gmail search "is:unread newer_than:7d" --json --results-only | jq '.[] | "\(.from): \(.subject)"'

Create a calendar event for tomorrow

bash
TOMORROW=$(date -d '+1 day' '+%Y-%m-%dT09:00:00')gog calendar create primary --summary "Team Standup" --from "$TOMORROW" --to "${TOMORROW%T*}T09:30:00"

Download recent documents

bash
gog drive search "type:document newer_than:7d" --json --results-only | jq -r '.[] | .id' | \  while read docId; do gog docs export "$docId" --format md > "doc_$docId.md"; done

Check availability for a meeting

bash
gog calendar freebusy --from "2026-06-25T09:00:00Z" --to "2026-06-25T17:00:00Z"

Output Formatting

bash
# JSON output (structured, for scripting)gog gmail search "is:unread" --json --results-only
# Plain/TSV output (stable, parseable)gog drive ls --plain
# Select specific fieldsgog gmail search "is:unread" --json --select "id,subject,from"

Agent Safety

bash
# Read-only mode (blocks all mutations)gog --readonly gmail search "test"
# Block Gmail send specificallygog --gmail-no-send gmail search "test"
# Preview actions without executinggog --dry-run drive delete <fileId>
# Disable interactive prompts (fail instead)gog --no-input calendar create primary --summary "Test"

Error Handling

Exit CodeMeaningRetryable
0Success-
3Empty resultsNo (normal)
4Auth requiredNo (run gog auth setup)
5Not foundNo
6Permission deniedNo
7Rate limitedYes (wait and retry)
8Retryable server errorYes (wait and retry)

Authentication and permission errors require user intervention. Rate limiting and server errors can be retried after a brief wait.

來源與署名

來源:odyssey4me/agent-skills位於skills/google提交a19e09f

授權條款: MIT

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架