google について
`gog` コマンドラインで Gmail、Calendar、Drive、Docs、Sheets、Slides を操作するエージェント向け Google Workspace スキルです。構造化出力と操作制限の手段を備えています。
主な機能
- 01Gmail の検索と読み取り
- 02Calendar の予定と空き時間管理
- 03Drive ファイルの閲覧と検索
- 04Docs、Sheets、Slides の操作
- 05JSON と TSV の出力
- 06読み取り専用と dry-run の制御
活用シーン
- 01最近のメールの検索と要約
- 02会議設定前の空き時間確認
- 03最近の Drive 文書の検索と書き出し
- 04Workspace の文書やスプレッドシートの作成・更新
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ odyssey4me/ agent-skills --skill googleインストール後、Claude Code で/googleを入力して読み込まれたか確認します。
同梱ファイル
SKILL.md と一緒にインストールされる参考資料やスクリプト。
references/calendar.mdconfiguration.mddocs-workflows.mddocs.mddrive.mdgmail.mdpermissions.mdsheets.mdslides.md詳細
Google Workspace スキル
このスキルは、gog CLI(gogcli)を使用して Google Workspace と連携します。エージェントはすべての操作を gog に直接実行させます。
前提条件
gog バイナリをインストールします(CI で検証済みのバージョンは上記のフロントマターに記載されています)。
# Homebrew
brew install openclaw/tap/gogcli
# Manual (Linux amd64)
curl -sL https://github.com/openclaw/gogcli/releases/latest/download/gogcli_VERSION_linux_amd64.tar.gz | tar xz
mv gog ~/.local/bin/
コンテナや MCP サーバーの代替手段については、configuration.md を参照してください。
ネットワークアクセス
Google Workspace のコマンドでは、認証やトークンの更新を含め、Google API および OAuth エンドポイントへの送信 HTTPS 接続が必要です。リモート操作には送信ネットワークアクセスが必要です。エージェントの環境でアクセスが制限されている場合は、最初のリモートコマンドを実行する前に、その環境の承認またはネットワーク制御を通じてアクセスを取得してください。その際、すでに許可されている承認を再利用してください。ローカルでのヘルプ参照やファイル処理には、ネットワークアクセスは不要です。スキルの指示によってネットワークアクセスが許可されるわけではありません。DNS、接続、タイムアウトの失敗はネットワークエラーとして報告してください。解決のために認証情報をリセットしてはいけません。承認済みのアクセスでも失敗する場合は、処理を停止してその旨を報告してください。認証と権限のエラーには、ユーザーによる対応が必要です。
認証
# Import credentials.json from Google Cloud Console
gog 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
# Verify
gog auth doctor
クイックリファレンス
gog gmail search "is:unread" # Search email
gog calendar events --today # Today's events
gog drive search "quarterly report" # Search files
gog docs cat <docId> # Read a document
gog sheets get <spreadsheetId> "Sheet1!A1:D10" # Read spreadsheet range
gog slides info <presentationId> # Presentation metadata
すべてのコマンドで、構造化出力には --json、TSV には --plain を指定できます。
コマンド
Gmail
# Search
gog gmail search "from:[email protected] newer_than:7d"
gog gmail search "is:unread label:inbox" --max 20
# Read
gog gmail get <messageId>
gog gmail thread get <threadId>
gog gmail labels list
# Organize
gog gmail mark-read <messageId>
gog gmail unread <messageId>
gog gmail archive <messageId>
gog gmail trash <messageId>
# Send
gog gmail send --to "[email protected]" --subject "Hello" --body "Message body"
gog gmail reply <messageId> --body "Reply text"
gog gmail forward <messageId> --to "[email protected]"
# Drafts
gog gmail drafts list
gog gmail drafts create --to "[email protected]" --subject "Draft" --body "Content"
gog gmail drafts send <draftId>
コマンドの全リファレンスについては、gmail.md を参照してください。
Google Calendar
# View
gog calendar calendars
gog calendar events --today
gog 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"
# Create
gog calendar create primary --summary "Meeting" --from "2026-06-25T10:00:00" --to "2026-06-25T11:00:00"
# Manage
gog calendar update <calendarId> <eventId> --summary "Updated title"
gog calendar delete <calendarId> <eventId>
gog calendar respond <calendarId> <eventId> --status accepted
コマンドの全リファレンスについては、calendar.md を参照してください。
Google Drive
# Browse
gog drive ls
gog drive ls --folder <folderId>
gog drive search "quarterly report"
gog drive tree
gog drive get <fileId>
# File operations
gog 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>
# Sharing
gog drive share <fileId> --email "[email protected]" --role writer
gog drive permissions <fileId>
gog drive unshare <fileId> <permissionId>
コマンドの全リファレンスについては、drive.md を参照してください。
Google Docs
# Read
gog docs info <docId>
gog docs cat <docId>
gog docs export <docId> --format md
gog docs structure <docId>
# Write
gog docs create "New Document"
gog docs write <docId> --body "Content to append"
gog docs insert <docId> "Text to insert" --at 1
gog docs find-replace <docId> "old text" "new text"
gog docs format <docId> --bold --start 1 --end 10
# Tables
gog docs insert-table <docId> --rows 3 --cols 4
gog docs cell-update <docId> --row 1 --col 1 --body "Header"
コマンドの全リファレンスについては、docs.md を参照してください。
Docs のワークフロー
書式、表のスタイル、往復編集に対応した Markdown のインポートについては、docs-workflows.md を参照してください。
# Import markdown as a new document with standard formatting
gog docs create "Document Title" --file document.md --pageless
gog docs format <docId> --line-spacing 115 --space-below 8
# Update an existing document from markdown with formatting
gog docs write <docId> --file document.md --markdown --replace --pageless
gog docs format <docId> --line-spacing 115 --space-below 8
Google Sheets
# Read
gog sheets metadata <spreadsheetId>
gog sheets get <spreadsheetId> "Sheet1!A1:D10"
gog sheets get <spreadsheetId> "Sheet1!A:A" --format FORMULA
# Write
gog 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"
# Structure
gog sheets add-tab <spreadsheetId> "New Tab"
gog sheets delete-tab <spreadsheetId> "Old Tab"
gog sheets rename-tab <spreadsheetId> "Old Name" "New Name"
コマンドの全リファレンスについては、sheets.md を参照してください。
Google Slides
# Read
gog slides info <presentationId>
gog slides list-slides <presentationId>
gog slides read-slide <presentationId> <slideId>
gog slides export <presentationId> --format pptx
# Create
gog slides create "New Presentation"
gog slides create-from-markdown "Deck Title" --file slides.md
gog slides create-from-template <templateId> "From Template" --replacements '{"{{NAME}}":"Value"}'
# Edit
gog 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
コマンドの全リファレンスについては、slides.md を参照してください。
例
最近のメールを検索して要約する
gog gmail search "is:unread newer_than:7d" --json --results-only | jq '.[] | "\(.from): \(.subject)"'
明日のカレンダー予定を作成する
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"
最近のドキュメントをダウンロードする
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
ミーティングの空き状況を確認する
gog calendar freebusy --from "2026-06-25T09:00:00Z" --to "2026-06-25T17:00:00Z"
出力形式
# JSON output (structured, for scripting)
gog gmail search "is:unread" --json --results-only
# Plain/TSV output (stable, parseable)
gog drive ls --plain
# Select specific fields
gog gmail search "is:unread" --json --select "id,subject,from"
エージェントの安全性
# Read-only mode (blocks all mutations)
gog --readonly gmail search "test"
# Block Gmail send specifically
gog --gmail-no-send gmail search "test"
# Preview actions without executing
gog --dry-run drive delete <fileId>
# Disable interactive prompts (fail instead)
gog --no-input calendar create primary --summary "Test"
エラー処理
| 終了コード | 意味 | 再試行可能 |
|---|---|---|
| 0 | 成功 | - |
| 3 | 結果なし | いいえ(正常) |
| 4 | 認証が必要 | いいえ(gog auth setup を実行) |
| 5 | 見つかりません | いいえ |
| 6 | アクセス拒否 | いいえ |
| 7 | レート制限 | はい(待機して再試行) |
| 8 | 再試行可能なサーバーエラー | はい(待機して再試行) |
認証エラーと権限エラーには、ユーザーによる対応が必要です。レート制限とサーバーエラーは、少し待ってから再試行できます。