Communityコーディング&開発github.com

gog

Google Workspace CLI for Gmail, Calendar, Drive, Contacts, Sheets, and Docs。

gog とは?

gog は、Gmail、カレンダー、ドライブ、連絡先、スプレッドシート、ドキュメントといった主要な Google Workspace サービスに、コマンドラインから直接アクセスできる強力な CLI ツールです。OAuth 認証を必要とし、初期セットアップと認証情報の管理は専用の `gog auth` サブコマンドで行います。このスキルは、AI エージェント(Claude Code、Cursor、Codex など)に gog の正しい使い方を指示します。特に、認証情報やトークンをチャット上で直接尋ねない、リモート・ヘッドレス環境での認証手順を段階的に説明する、などのガイドラインに重点を置いています。また、メールの書式設定やカレンダーの色指定、JSON 出力と `--no-input` フラグを用いたスクリプト化のベストプラクティスなど、日常的に頻出するコマンドの実例も多数含まれています。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/clawdbot/clawdbot/tree/main/skills/gog

Installed? Explore more コーディング&開発 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

gog は何をしますか?

gog は Gmail/カレンダー/ドライブ/連絡先/スプレッドシート/ドキュメントを操作するコマンドラインツールです。OAuth 認証のセットアップが必要です。

認証済みのホストアカウントを優先してください: まずは要求された gog コマンドを実行してください。認証エラーが発生した場合のみセットアップに入ります。チャット上でパスワード、クライアントシークレット、リフレッシュトークンを尋ねないでください。

セットアップ(初回のみ)

  • gog auth credentials /path/to/client_secret.json
  • gog auth add [email protected] --services gmail,calendar,drive,contacts,docs,sheets
  • gog auth list

リモート / ヘッドレス Gateway ホスト

Gateway ホストにローカルブラウザがない場合:

  1. Gateway ホスト上でライブコールバックリスナーを優先します。 ブラウザがあるマシンから、コールバックポートを転送し (ssh -L <port>:127.0.0.1:<port> user@gateway-host)、gog が出力する認証 URL を開き、その転送ポートでリダイレクトを完了させます。
  2. ライブリスナーが利用できない場合、 オペレーターは Gateway ホスト上の信頼されたシェルで、ペーストモードのパスのいずれかを選択します。コールバック URL はチャットやエージェントのツール入力に入れてはいけません:
    • --manual: オペレーターが完全なリダイレクト URL を gog の対話型プロンプトにペーストします。
    • --remote --step 1: auth_url(および state_reused)を出力して終了します。ブラウザでの同意後、オペレーターは信頼されたシェルで --remote --step 2 --auth-url <callback-url> を実行します。同意後の localhost ページの読み込み失敗は想定内です。
  3. リモートステップ間で同じ解決済みの設定コンテキストを維持します: GOG_CONFIG_DIR が --home より優先され、--home が GOG_HOME より優先されます。また、--client、サービス/スコープ、リダイレクト URI、同意オプションも保持します。一致する期限切れでない手動状態を再利用できる場合があります (state_reused=true)。
  4. デスクトップキーリングが利用できない場合は、ファイルバックエンドを設定し (gog auth keyring file)、Gateway 環境で GOG_KEYRING_PASSWORD を設定することで、非対話型のエージェントや --no-input 実行がトークンを読み取れるようにします。gog auth doctor はパスワードがない場合に報告します。
  5. コールバックの受信はトークンの保存とは異なります。プロキシの背後でトークン交換や ID ルックアップが失敗する場合は、オペレーターが必須の Google エンドポイントに対するスコープ付きの出力またはプロキシ例外を承認した後、ステップ1から再開します。ホストネットワークポリシーをバイパスしたり、失敗または期限切れの状態を再利用したりしないでください。

診断

gog auth list --check によって報告されるすべてのエントリを検査してください。その終了ステータスは、保存されたすべてのトークンが有効であることを保証しません。同様に、gog auth doctor の終了コードだけでなく、レポートされるステータスも検査してください。

よく使うコマンド

  • Gmail 検索: gog gmail search 'newer_than:7d' --max 10
  • Gmail メッセージ検索(メールごと、スレッドを無視): gog gmail messages search "in:inbox from:ryanair.com" --max 20 --account [email protected]
  • Gmail 送信(プレーンテキスト): gog gmail send --to [email protected] --subject "Hi" --body "Hello"
  • Gmail 送信(複数行): gog gmail send --to [email protected] --subject "Hi" --body-file ./message.txt
  • Gmail 送信(標準入力): gog gmail send --to [email protected] --subject "Hi" --body-file -
  • Gmail 送信(HTML): gog gmail send --to [email protected] --subject "Hi" --body-html "<p>Hello</p>"
  • Gmail 下書き: gog gmail drafts create --to [email protected] --subject "Hi" --body-file ./message.txt
  • Gmail 下書き送信: gog gmail drafts send <draftId>
  • Gmail 返信: gog gmail send --to [email protected] --subject "Re: Hi" --body "Reply" --reply-to-message-id <msgId>
  • カレンダー イベント一覧: gog calendar events <calendarId> --from <iso> --to <iso>
  • カレンダー イベント作成: gog calendar create <calendarId> --summary "Title" --from <iso> --to <iso>
  • カレンダー イベント作成(色指定): gog calendar create <calendarId> --summary "Title" --from <iso> --to <iso> --event-color 7
  • カレンダー イベント更新: gog calendar update <calendarId> <eventId> --summary "New Title" --event-color 4
  • カレンダー 色一覧: gog calendar colors
  • ドライブ検索: gog drive search "query" --max 10
  • 連絡先: gog contacts list --max 20
  • スプレッドシート取得: gog sheets get <sheetId> "Tab!A1:D10" --json
  • スプレッドシート更新: gog sheets update <sheetId> "Tab!A1:B2" --values-json '[['"A"',"B"'],['"1"',"2"']]' --input USER_ENTERED
  • スプレッドシート追加: gog sheets append <sheetId> "Tab!A:C" --values-json '[['"x"','"y"','"z"']]' --insert INSERT_ROWS
  • スプレッドシートクリア: gog sheets clear <sheetId> "Tab!A2:Z"
  • スプレッドシートメタデータ: gog sheets metadata <sheetId> --json
  • ドキュメントエクスポート: gog docs export <docId> --format txt --out /tmp/doc.txt
  • ドキュメント表示: gog docs cat <docId>

カレンダーの色

  • gog calendar colors で利用可能なすべてのイベント色(ID 1-11)を確認できます
  • --event-color <id> フラグでイベントに色を追加します
  • イベント色 ID(gog calendar colors の出力より):
    • 1: #a4bdfc
    • 2: #7ae7bf
    • 3: #dbadff
    • 4: #ff887c
    • 5: #fbd75b
    • 6: #ffb878
    • 7: #46d6db
    • 8: #e1e1e1
    • 9: #5484ed
    • 10: #51b749
    • 11: #dc2127

メールの書式設定

  • プレーンテキストを推奨します。複数段落のメッセージには --body-file を使用します(標準入力の場合は --body-file -)。

  • 同じ --body-file パターンが下書きと返信でも使えます。

  • --body は \n をエスケープ解除しません。インラインで改行が必要な場合は、ヒアドキュメントまたは $'Line 1\n\nLine 2' を使用します。

  • リッチな書式設定が必要な場合のみ --body-html を使用します。

  • HTML タグ: <p> は段落、<br> は改行、<strong> は太字、<em> はイタリック、<a href="url"> はリンク、<ul>/<li> はリスト。

  • 例(標準入力からのプレーンテキスト):

    gog gmail send --to [email protected] \
      --subject "Meeting Follow-up" \
      --body-file - <<'EOF'
    Hi Name,
    
    Thanks for meeting today. Next steps:
    - Item one
    - Item two
    
    Best regards,
    Your Name
    EOF
    
  • 例(HTML リスト):

    gog gmail send --to [email protected] \
      --subject "Meeting Follow-up" \
      --body-html "<p>Hi Name,</p><p>Thanks for meeting today. Here are the next steps:</p><ul><li>Item one</li><li>Item two</li></ul><p>Best regards,<br>Your Name</p>"
    

注意事項

  • [email protected] を設定すると、--account の指定を省略できます。
  • スクリプト化する場合は、--json と --no-input を推奨します。
  • スプレッドシートの値は、--values-json(推奨)またはインライン行として渡せます。
  • ドキュメントはエクスポート/表示/コピーに対応しています。インプレース編集には Docs API クライアントが必要です(gog には含まれていません)。
  • gog gmail search はスレッドごとに1行を返します。個々のメールを1件ずつ返してほしい場合は、gog gmail messages search を使用してください。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

acp-router

Route plain-language requests for Claude Code, Cursor, Copilot, OpenClaw ACP, OpenCode, Gemini CLI, Grok Build, Qwen, Kiro, Kimi, iFlow, Factory Droid, Kilocode, or explicit ACP harness work into either OpenClaw ACP runtime sessions or direct acpx-driven sessions ("telephone game" flow). For coding-agent thread requests, read this skill first, then use only `sessions_spawn` for thread creation. Codex chat binding defaults to the native Codex app-server plugin unless ACP is explicit or background spawn needs ACP.

add-model-provider

Add and live-prove a model provider with non-interactive config one-liners, without exposing credentials.

agent-transcript

Requested GitHub PR/issue agent transcripts: redact, trim, preview, and insert safely.

apple-notes

Create, view, edit, delete, search, move, or export Apple Notes via the memo CLI on macOS.

apple-reminders

List, add, edit, complete, or delete Apple Reminders and reminder lists via remindctl.

auto-qa

Run OpenClaw-wide autonomous QA and live/stress campaigns across independent subsystem lanes, with verified fixes and a resumable evidence report.

autoreview

Structured code review through the shared OpenClaw agent-skills installation.

bear-notes

Create, search, and manage Bear notes via grizzly CLI.

blacksmith-testbox

Run Blacksmith Testbox for CI-parity checks, secrets, hosted services, migrations, or builds local cannot reproduce.

block-kit

Use proactively for structured or interactive Slack replies, and when asked to author or validate native Slack Block Kit JSON.

blogwatcher

Monitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.

blucli

BluOS CLI (blu) for discovery, playback, grouping, and volume.

bluebubbles

Send and manage iMessages via BlueBubbles, including attachments, tapbacks, edits, replies, and groups.

browser-automation

Use when controlling web pages with the OpenClaw browser tool, especially multi-step flows, login checks, tab management, or recovery from stale refs/timeouts.

camsnap

Capture frames or clips from RTSP/ONVIF cameras and local webcams, including USB pan/tilt/zoom control.

canvas

Present HTML on connected OpenClaw node canvases, navigate/eval/snapshot, and debug canvas host URLs.

channel-message-flows

Use when running QA Lab channel message flow evidence.

clawdtributor

Clawtributor PRs here, last week or another window: discover conversation refs, recheck GitHub, rank by impact.

clawhub

Search ClawHub for plugins by default, or skills when explicitly requested; install, verify, update, uninstall, publish, or sync skills.

関連スキル