gmail

Gmail操作(検索・送信・返信・ラベル管理)を gog CLI (v0.10.0) で行う。 「メール送って」「〇〇からのメール探して」「未読メール確認」「メールに返信」 「メール検索」「添付ファイル付きで送信」「メール一覧」などで発火。

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "gmail" with this command: npx skills add naoterumaker/openclaw-gog-skills/naoterumaker-openclaw-gog-skills-gmail

Gmail 操作スキル (gog v0.10.0)

gog CLI でGmailを操作する。

実行パス: gog

認証アカウント: (gogで認証したアカウント)

Execution Notes

  • exec ツールで実行時、timeout: 60 を指定
  • 大量検索は --max で制限

メール検索

基本検索

gog gmail search "<query>"
gog gmail search "is:unread" --max 10
gog gmail search "from:someone@example.com"

検索クエリ一覧

クエリ説明
is:unread未読
is:starredスター付き
is:important重要
from:xxx送信者
to:xxx宛先
cc:xxxCC
subject:xxx件名に含む
"キーワード"完全一致検索
has:attachment添付ファイルあり
filename:pdfPDFファイル添付
larger:5M5MB以上
smaller:1M1MB以下
after:YYYY/MM/DD指定日以降
before:YYYY/MM/DD指定日以前
older_than:7d7日より前
newer_than:3d3日以内
label:xxx特定ラベル
in:inbox受信トレイ
in:sent送信済み
in:trashゴミ箱
in:anywhereすべて(ゴミ箱含む)

複合検索例

# 田中さんから今週届いた未読メール
gog gmail search "from:tanaka is:unread newer_than:7d"

# 請求書関連の添付ファイル付きメール
gog gmail search "subject:請求書 has:attachment"

# 2026年1月以降のPDF添付メール
gog gmail search "filename:pdf after:2026/01/01"

メール取得

スレッド・メッセージ取得

# メッセージ詳細(本文込み)
gog gmail get <messageId>

# メタデータのみ
gog gmail messages get <messageId> --format metadata

添付ファイルダウンロード

gog gmail attachment <messageId> <attachmentId>
gog gmail attachment <messageId> <attachmentId> --output "./download.pdf"

メール送信

基本送信

gog gmail send \
  --to "recipient@example.com" \
  --subject "件名" \
  --body "本文テキスト"

CC/BCC付き

gog gmail send \
  --to "main@example.com" \
  --cc "copy1@example.com,copy2@example.com" \
  --bcc "hidden@example.com" \
  --subject "件名" \
  --body "本文"

添付ファイル付き

gog gmail send \
  --to "recipient@example.com" \
  --subject "資料送付" \
  --body "添付ファイルをご確認ください。" \
  --attach "./report.pdf" \
  --attach "./data.xlsx"

HTML本文

gog gmail send \
  --to "recipient@example.com" \
  --subject "HTMLメール" \
  --body-html "<h1>見出し</h1><p>本文です。</p>"

ファイルから本文読み込み

gog gmail send \
  --to "recipient@example.com" \
  --subject "長文メール" \
  --body-file "./email_body.txt"

返信

スレッドに返信

gog gmail send \
  --thread-id "<threadId>" \
  --to "original-sender@example.com" \
  --subject "Re: 元の件名" \
  --body "返信本文"

メッセージに直接返信

gog gmail send \
  --reply-to-message-id "<messageId>" \
  --to "original-sender@example.com" \
  --subject "Re: 元の件名" \
  --body "返信本文"

全員に返信

gog gmail send \
  --reply-to-message-id "<messageId>" \
  --reply-all \
  --subject "Re: 元の件名" \
  --body "全員への返信"

ラベル操作

ラベル一覧

gog gmail labels list

ラベル追加/削除

# ラベル追加
gog gmail thread modify <threadId> --add-labels "重要"

# ラベル削除
gog gmail thread modify <threadId> --remove-labels "UNREAD"

# 既読にする
gog gmail thread modify <threadId> --remove-labels "UNREAD"

# アーカイブ
gog gmail thread modify <threadId> --remove-labels "INBOX"

送信オプション一覧

オプション説明
--to宛先(必須、カンマ区切りで複数可)
--ccCC(カンマ区切り)
--bccBCC(カンマ区切り)
--subject件名(必須)
--body本文(プレーンテキスト)
--body-htmlHTML本文
--body-file本文ファイル(- でstdin)
--attach添付ファイル(複数指定可)
--thread-id返信先スレッドID
--reply-to-message-id返信先メッセージID
--reply-all全員に返信
--from送信元アドレス(送信エイリアス)
--reply-toReply-Toヘッダー

出力オプション

オプション説明
--jsonJSON出力
--plainTSV出力
--max N最大N件
--all全ページ取得

典型ワークフロー

未読メール確認→返信

# 1. 未読検索
gog gmail search "is:unread" --max 5 --json

# 2. 詳細確認
gog gmail get <messageId>

# 3. 返信
gog gmail send \
  --reply-to-message-id "<messageId>" \
  --to "sender@example.com" \
  --subject "Re: 件名" \
  --body "ご連絡ありがとうございます。..."

添付ファイル検索→ダウンロード

# 1. 検索
gog gmail search "from:client has:attachment" --json

# 2. メッセージ取得(添付ID確認)
gog gmail get <messageId> --json

# 3. ダウンロード
gog gmail attachment <messageId> <attachmentId> --output "./downloaded.pdf"

メッセージ一覧

gog gmail messages                      # 受信メッセージ一覧
gog gmail messages --max 20 --json

スレッド操作

# スレッド取得(スレッド内の全メッセージ)
gog gmail thread <threadId>
gog gmail thread <threadId> --json

# スレッドのラベル変更
gog gmail thread modify <threadId> --add-labels "重要"
gog gmail thread modify <threadId> --remove-labels "UNREAD"

下書き操作

# 下書き一覧
gog gmail drafts list
gog gmail drafts list --json

# 下書き作成
gog gmail drafts create \
  --to "recipient@example.com" \
  --subject "件名" \
  --body "本文"

# 下書き送信
gog gmail drafts send <draftId>

# 下書き削除
gog gmail drafts delete <draftId>

トップレベル send コマンド

gog send はメール送信のショートカット:

gog send --to "recipient@example.com" --subject "件名" --body "本文"

gog gmail send と同等。


注意事項

  • 長い本文: --body-file を使う
  • 特殊文字: シェルエスケープに注意
  • 大量送信: レート制限に注意
  • 返信時: 件名に「Re: 」をつける

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

gog

No summary provided by upstream source.

Repository SourceNeeds Review
General

gdrive

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

google-sheets-ops

No summary provided by upstream source.

Repository SourceNeeds Review
General

gcal

No summary provided by upstream source.

Repository SourceNeeds Review