| name | gog |
| description | Google Workspace を CLI で操作するスキル。gogcli (gog) コマンドを使い、
Gmail(メール検索・送信・ラベル管理)、Google Calendar(予定一覧・作成・更新・削除・空き時間確認)、
Google Drive(ファイル検索・アップロード・ダウンロード・共有)、Google Sheets(セル読み書き・フォーマット)、
Google Tasks(タスク管理)、Google Docs / Slides(エクスポート・作成)、
Google Contacts / People(連絡先検索・管理)、Google Chat(メッセージ送信)、
Google Classroom(コース・課題管理)、Google Groups、Google Keep を操作する。
「メールを確認」「予定を作成」「ドライブで検索」「スプレッドシートを更新」「タスクを追加」
「連絡先を検索」「チャットで送信」などのリクエストに対応する。
|
| allowed-tools | ["Bash(gog *)","Bash(which gog)","Bash(brew install steipete/tap/gogcli)","Read"] |
gogcli スキル
gogcli は Google Workspace サービスを統合的に操作する CLI ツール。
gog <service> <command> の統一構文で、Gmail / Calendar / Drive / Sheets / Tasks / Docs / Slides / Contacts / People / Chat / Classroom / Groups / Keep を操作できる。
前提条件チェック
操作を実行する前に、以下を確認する:
1. インストール確認
which gog
未インストールの場合、Homebrew でインストールを提案する:
brew install steipete/tap/gogcli
2. 認証確認
gog auth list
アカウントが登録されていない場合、セットアップ手順を案内する。
詳細は setup.md を参照。
3. アカウント設定
--account フラグまたは GOG_ACCOUNT 環境変数でアカウントを指定する。
ユーザーがアカウントを明示しない場合、gog auth list で登録済みアカウントを確認し、どのアカウントを使うか尋ねる。
基本原則
出力フォーマット
- データの解析・加工が必要な場合は
--json を付ける
- ユーザーへの表示用にはデフォルト(カラー出力)を使う
- スクリプト連携には
--plain(TSV 出力)を使う
コマンド実行の安全性
- 送信・削除・更新 などの副作用のある操作は、必ずユーザーに確認を取ってから実行する
--force フラグは明示的に指示された場合のみ使用する
- メール送信 (
gog gmail send) は実行前に件名・宛先・本文をユーザーに確認する
エラーハンドリング
- 認証エラー →
gog auth status で確認し、再認証を案内
- API エラー → エラーメッセージを解釈し、対処法を提示
- レート制限 → 少し待ってからリトライを提案
日時の扱い
- gogcli は相対日時表現をサポート:
today, tomorrow, monday 等
- RFC3339 形式:
2025-01-15T09:00:00+09:00
- 日付のみ:
2025-01-15(終日イベント用)
サービス別クイックリファレンス
Gmail
最頻使用サービス。メール検索、本文取得、送信、ラベル管理を行う。
gog gmail search "is:unread" --max 20
gog gmail search "from:example@gmail.com after:2025/01/01"
gog gmail get <messageId>
gog gmail send --to "user@example.com" --subject "件名" --body "本文"
gog gmail labels list
詳細: gmail.md
Google Calendar
予定の一覧取得、作成、更新、削除、空き時間確認を行う。
gog calendar events --today
gog calendar events --week --all
gog calendar create primary --summary "会議" --from "2025-01-15T10:00:00" --to "2025-01-15T11:00:00"
gog calendar freebusy "user@example.com" --from today --to tomorrow
gog calendar conflicts --from today --to "next friday"
詳細: calendar.md
Google Drive
ファイルの検索、アップロード、ダウンロード、共有管理を行う。
gog drive ls
gog drive search "議事録"
gog drive download <fileId>
gog drive upload ./report.pdf --parent <folderId>
gog drive share <fileId> --type user --role reader --email "user@example.com"
詳細: drive.md
Google Sheets
スプレッドシートのセル読み書き、フォーマット設定を行う。
gog sheets get <spreadsheetId> "Sheet1!A1:D10"
gog sheets update <spreadsheetId> "Sheet1!A1" "値1" "値2" "値3"
gog sheets append <spreadsheetId> "Sheet1!A:D" "val1" "val2" "val3" "val4"
gog sheets create "新しいシート"
詳細: sheets.md
Google Tasks
タスクリストとタスクの管理を行う。
gog tasks lists list
gog tasks list <tasklistId>
gog tasks add <tasklistId> --title "買い物" --due "2025-01-15"
gog tasks done <tasklistId> <taskId>
詳細: tasks.md
Google Docs / Slides
ドキュメントとスライドのエクスポート、作成を行う。
gog docs cat <docId>
gog docs export <docId> --format pdf
gog slides info <presentationId>
gog slides export <presentationId> --format pdf
詳細: docs-slides.md
Google Contacts / People
連絡先の検索・作成・管理を行う。
gog contacts search "田中"
gog contacts list
gog people search "yamada"
gog people me
詳細: contacts.md
Google Chat (Workspace 専用)
スペースの一覧取得、メッセージ送信を行う。
gog chat spaces list
gog chat messages send <space> --text "メッセージ本文"
gog chat dm send user@example.com --text "メッセージ"
詳細: chat.md
Google Classroom (教育機関向け)
コース、課題、成績の管理を行う。
gog classroom courses list
gog classroom roster <courseId>
gog classroom coursework list <courseId>
詳細: classroom.md
その他のサービス
Groups, Keep, Service Account 等の高度な機能。
gog groups list
gog keep list
gog auth services
詳細: advanced.md
クロスサービスワークフロー
複数サービスを横断する便利なワークフロー集。
詳細: workflows.md
グローバルフラグ
すべてのコマンドで使用可能:
| フラグ | 説明 |
|---|
--account=EMAIL | 使用するアカウントを指定 |
--client=NAME | OAuth クライアントを指定 |
--json | JSON 出力(スクリプト向け) |
--plain | TSV 出力(パース向け) |
--force | 確認プロンプトをスキップ |
--no-input | 対話プロンプトを無効化(CI 向け) |
--verbose | 詳細ログ出力 |
--color=auto|always|never | カラー出力制御 |
トラブルシューティング
認証エラー: token revoked / expired
gog auth list --check
gog auth remove you@gmail.com
gog auth add you@gmail.com
API が有効になっていない
Google Cloud Console で該当 API を有効化する:
- Gmail API:
https://console.cloud.google.com/apis/api/gmail.googleapis.com
- Calendar API:
https://console.cloud.google.com/apis/api/calendar-json.googleapis.com
- Drive API:
https://console.cloud.google.com/apis/api/drive.googleapis.com
コマンドの詳細ヘルプ
gog <service> --help
gog <service> <command> --help
設定ファイルの場所
gog config path
gog config list