Google Personal Assistant
gog CLI を介して Google Workspace サービスを管理するための包括的なスキルです。効率的な検索、フィルタリング、クエリに重点を置き、パーソナルアシスタントやチーフ・オブ・スタッフのワークフロー向けに設計されています。
このスキルを使用する場面
- メールの受信トレイの確認と処理
- 会議のスケジュール設定とカレンダーの予定の管理
- 複数のカレンダーをまたいだ空き時間の検索
- Google Drive ドキュメントの検索と整理
- タスクリストと ToDo の管理
- 連絡先の検索と管理
- Google Sheets のデータの読み取り/書き込み
- Docs、Slides、Sheets のエクスポート
- 集中時間や不在ステータスの設定
前提条件
gog がインストールされ、認証済みであることを確認します。
# Check installation
gog version
# Check authentication status
gog auth status
# Verify account access
gog people me
# Add a new account if needed
gog auth add [email protected] --services=all
クイックスタート
Gmail
# Search unread emails
gog gmail search "is:unread" --max=20
# Search from specific sender
gog gmail search "from:[email protected] newer_than:7d"
# Send an email
gog gmail send --to="[email protected]" --subject="Subject" --body="Message body"
# Reply to a thread
gog gmail send --reply-to-message-id=MESSAGE_ID --body="Reply text"
# Get message details
gog gmail get MESSAGE_ID
Calendar
# View today's events
gog calendar events --today
# View this week
gog calendar events --week
# Create an event with Google Meet
gog calendar create primary \
--summary="Team Sync" \
--from="2026-01-15T14:00:00-08:00" \
--to="2026-01-15T15:00:00-08:00" \
--attendees="[email protected],[email protected]" \
--with-meet
# Check availability
gog calendar freebusy "[email protected],[email protected]" \
--from="2026-01-15T09:00:00Z" --to="2026-01-15T17:00:00Z"
# Find scheduling conflicts
gog calendar conflicts --week
Drive
# List files in root
gog drive ls
# Search for documents
gog drive search "quarterly report"
# Download a file
gog drive download FILE_ID
# Upload a file
gog drive upload /path/to/file.pdf --parent=FOLDER_ID
# Get shareable URL
gog drive url FILE_ID
Tasks
# List task lists
gog tasks lists list
# View tasks in default list
gog tasks list @default
# Add a task
gog tasks add @default --title="Review report" --due="2026-01-15"
# Mark task complete
gog tasks done @default TASK_ID
Sheets
# Read a range
gog sheets get SPREADSHEET_ID "Sheet1!A1:D10"
# Update values
gog sheets update SPREADSHEET_ID "Sheet1!A1" "Value1" "Value2"
# Append a row
gog sheets append SPREADSHEET_ID "Sheet1!A:D" "Col1" "Col2" "Col3" "Col4"
Gmail の検索構文
Gmail の検索機能は強力です。基本的な演算子は次のとおりです。
送信者と宛先
ステータスとラベル
| 演算子 | 例 | 説明 |
|---|
is:unread | is:unread | 未読メッセージ |
is:read | is:read | 既読メッセージ |
is:starred | is:starred | スター付きメッセージ |
is:important | is:important | 重要としてマークされたメッセージ |
is:snoozed | is:snoozed | スヌーズ中のメッセージ |
label: | label:work | 特定のラベルが付いたメール |
in:inbox | in:inbox | 受信トレイ内 |
in:sent | in:sent | 送信済みフォルダ内 |
in:drafts | in:drafts | 下書き内 |
in:trash | in:trash | ゴミ箱内 |
in:spam | in:spam | 迷惑メール内 |
in:anywhere | in:anywhere | 迷惑メール/ゴミ箱を含むすべてのメール |
内容と件名
| 演算子 | 例 | 説明 |
|---|
subject: | subject:urgent | 件名に単語を含む |
"exact phrase" | "quarterly report" | 完全一致するフレーズ |
has:attachment | has:attachment | 添付ファイルがある |
filename: | filename:pdf | 添付ファイルの名前/種類 |
filename: | filename:report.xlsx | 特定のファイル名 |
日付と時刻
| 演算子 | 例 | 説明 |
|---|
newer_than: | newer_than:7d | 過去 N 日以内 |
older_than: | older_than:1y | N 年より前 |
after: | after:2026/01/01 | 指定した日付より後 |
before: | before:2026/12/31 | 指定した日付より前 |
newer_than/older_than の単位:d(日)、m(月)、y(年)
サイズ
| 演算子 | 例 | 説明 |
|---|
larger: | larger:5M | 指定サイズより大きい |
smaller: | smaller:100K | 指定サイズより小さい |
単位:K(KB)、M(MB)
カテゴリ
| 演算子 | 例 | 説明 |
|---|
category:primary | category:primary | メインの受信トレイ |
category:social | category:social | ソーシャルカテゴリ |
category:promotions | category:promotions | プロモーション |
category:updates | category:updates | アップデート |
category:forums | category:forums | フォーラム |
ブール演算子
| 演算子 | 例 | 説明 |
|---|
AND(またはスペース) | from:alice subject:report | 両方の条件 |
OR | from:alice OR from:bob | いずれかの条件 |
-(NOT) | -category:promotions | 条件を除外 |
() | (from:alice OR from:bob) is:unread | グループ化 |
{} | {from:alice from:bob} | OR の省略形 |
クエリの例
# Unread from VIPs this week
gog gmail search "is:unread from:([email protected] OR [email protected]) newer_than:7d"
# Large attachments
gog gmail search "has:attachment larger:10M"
# Urgent subjects excluding promotions
gog gmail search "subject:(urgent OR asap OR EOD) -category:promotions is:unread"
# Contracts from legal team
gog gmail search "from:[email protected] subject:contract has:attachment filename:pdf"
# All messages in a thread (use thread ID from search results)
gog gmail thread get THREAD_ID
すべての演算子については、references/gmail-search-syntax.md を参照してください。
Drive の検索構文
Drive の検索では、ファイルを正確に見つけるためのクエリ言語を使用します。
基本演算子
| 演算子 | 例 | 説明 |
|---|
name contains | name contains 'report' | ファイル名に含まれる |
fullText contains | fullText contains 'budget' | コンテンツを検索 |
mimeType = | mimeType = 'application/pdf' | ファイル形式 |
日付フィルター
| 演算子 | 例 | 説明 |
|---|
modifiedTime > | modifiedTime > '2026-01-01' | 指定日より後に更新 |
modifiedTime < | modifiedTime < '2026-01-01' | 指定日より前に更新 |
createdTime > | createdTime > '2026-01-01' | 指定日より後に作成 |
viewedByMeTime > | viewedByMeTime > '2026-01-01' | 指定日より後に閲覧 |
所有権と共有
| 演算子 | 例 | 説明 |
|---|
'email' in owners | 'me' in owners | ユーザーが所有 |
'email' in writers | '[email protected]' in writers | ユーザーが編集可能 |
'email' in readers | '[email protected]' in readers | ユーザーが閲覧可能 |
sharedWithMe | sharedWithMe | あなたと共有済み |
プロパティ
| 演算子 | 例 | 説明 |
|---|
starred | starred | スター付きファイル |
trashed = false | trashed = false | ゴミ箱にない |
'folderId' in parents | 'FOLDER_ID' in parents | 特定のフォルダー内 |
よく使われる MIME タイプ
| 種類 | MIME タイプ |
|---|
| Google ドキュメント | application/vnd.google-apps.document |
| Google スプレッドシート | application/vnd.google-apps.spreadsheet |
| Google スライド | application/vnd.google-apps.presentation |
| Google フォーム | application/vnd.google-apps.form |
| フォルダー | application/vnd.google-apps.folder |
| PDF | application/pdf |
| Word | application/vnd.openxmlformats-officedocument.wordprocessingml.document |
| Excel | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
ブール演算子
and - 両方の条件に一致する必要があります
or - いずれかの条件に一致します
not - 条件を否定します
クエリの例
# Recent docs mentioning Q4
gog drive search "fullText contains 'Q4' and modifiedTime > '2026-01-01'"
# All spreadsheets shared with me
gog drive search "sharedWithMe and mimeType = 'application/vnd.google-apps.spreadsheet'"
# PDFs I own
gog drive search "'me' in owners and mimeType = 'application/pdf'"
# Files modified this week
gog drive search "modifiedTime > '2026-01-03'"
# Documents in specific folder
gog drive ls --parent=FOLDER_ID
# Starred presentations
gog drive search "starred and mimeType = 'application/vnd.google-apps.presentation'"
クエリの詳細については、references/drive-search-syntax.md を参照してください。
PA/CoS のワークフロー
朝の受信トレイの仕分け
# 1. Check unread counts by label
gog gmail labels list --json | jq '.[] | select(.messagesUnread > 0) | {name, unread: .messagesUnread}'
# 2. Review unread from priority senders
gog gmail search "is:unread from:([email protected] OR [email protected])" --max=20
# 3. Check for urgent subjects
gog gmail search "is:unread subject:(urgent OR asap OR EOD OR \"action required\")" --max=10
# 4. Review threads needing response (excludes noise)
gog gmail search "is:unread in:inbox -category:updates -category:promotions -category:social" --max=30
# 5. Check for emails with attachments requiring action
gog gmail search "is:unread has:attachment newer_than:2d" --max=15
会議の予定を設定
# 1. Find availability for attendees
gog calendar freebusy "[email protected],[email protected]" \
--from="2026-01-15T09:00:00-08:00" \
--to="2026-01-15T17:00:00-08:00"
# 2. Check your own conflicts
gog calendar conflicts --days=7
# 3. Create the meeting
gog calendar create primary \
--summary="Project Kickoff" \
--from="2026-01-15T14:00:00-08:00" \
--to="2026-01-15T15:00:00-08:00" \
--attendees="[email protected],[email protected]" \
--description="Agenda:\n1. Project overview\n2. Timeline review\n3. Action items" \
--location="Conference Room A" \
--with-meet \
--reminder="popup:15m"
# 4. Send follow-up email with details
gog gmail send \
--to="[email protected],[email protected]" \
--subject="Meeting Scheduled: Project Kickoff - Jan 15 at 2pm" \
--body="Hi team,
I've scheduled our project kickoff meeting for Wednesday, January 15th at 2:00 PM.
Location: Conference Room A (Google Meet link in calendar invite)
Agenda:
1. Project overview
2. Timeline review
3. Action items
Please let me know if you have any conflicts.
Best regards"
週次カレンダーの準備
# 1. View the week ahead
gog calendar events --week
# 2. Check all calendars for the week
gog calendar events --week --all
# 3. Find and resolve conflicts
gog calendar conflicts --week
# 4. Check team availability (for group)
gog calendar team [email protected] --week
# 5. Block focus time
gog calendar focus-time \
--from="2026-01-16T09:00:00-08:00" \
--to="2026-01-16T12:00:00-08:00"
# 6. Set out of office (if needed)
gog calendar out-of-office \
--from="2026-01-20" \
--to="2026-01-21" \
--summary="Out of office - personal day"
# 7. Set working location
gog calendar working-location \
--from="2026-01-17" \
--to="2026-01-17" \
--type="home"
ドキュメントの検索と整理
# Find all docs from a project
gog drive search "fullText contains 'Project Alpha'"
# List recent docs you created
gog drive search "'me' in owners and modifiedTime > '2026-01-01'" --max=50
# Find docs shared by specific person
gog drive search "'[email protected]' in writers"
# Find presentation decks
gog drive search "mimeType = 'application/vnd.google-apps.presentation' and modifiedTime > '2025-10-01'"
# Download a doc as PDF
gog docs export DOC_ID --format=pdf --output="./report.pdf"
# Read doc contents (plain text for quick review)
gog docs cat DOC_ID
# Export spreadsheet as Excel
gog sheets export SPREADSHEET_ID --format=xlsx --output="./data.xlsx"
# Get shareable link
gog drive url FILE_ID
gog drive share FILE_ID --role=reader --type=anyone
毎日のタスク管理
# 1. List all task lists
gog tasks lists list
# 2. View all tasks in default list
gog tasks list @default
# 3. View tasks due today
gog tasks list @default --due-max="$(date -u +%Y-%m-%dT23:59:59Z)"
# 4. Add a new task with due date
gog tasks add @default \
--title="Review Q4 financials" \
--due="2026-01-15" \
--notes="Check revenue projections and expense reports"
# 5. Complete a task
gog tasks done @default TASK_ID
# 6. Reopen a completed task
gog tasks undo @default TASK_ID
# 7. Delete a task
gog tasks delete @default TASK_ID
# 8. Clear all completed tasks
gog tasks clear @default
連絡先の検索
# Search for a contact
gog contacts search "John Smith"
# List all contacts
gog contacts list --max=100
# Get contact details
gog contacts get RESOURCE_NAME
# Create a new contact
gog contacts create \
--given="Jane" \
--family="Doe" \
--email="[email protected]" \
--phone="+1-555-123-4567"
# Search directory (Workspace)
gog contacts directory search "engineering"
その他のワークフロー例については、references/common-workflows.md を参照してください。
コマンドリファレンス
Gmail コマンド
| コマンド | 説明 | 主なフラグ |
|---|
gmail search <query> | スレッドを検索 | --max、--oldest、--page |
gmail get <messageId> | メッセージの内容を取得 | --format=full|metadata|raw |
gmail send | メールを送信 | --to、--cc、--bcc、--subject、--body、--attach |
gmail thread get <id> | スレッド全体を取得 | - |
gmail thread modify <id> | スレッドのラベルを変更 | --add-labels、--remove-labels |
gmail labels list | すべてのラベルを一覧表示 | - |
gmail labels get <name> | ラベルの詳細を取得 | - |
gmail labels modify <ids> | ラベルを一括変更 | --add、--remove |
gmail attachment <msgId> <attId> | 添付ファイルをダウンロード | - |
gmail url <threadId> | Gmail のウェブ URL を取得 | - |
gmail batch delete <ids> | 一括削除 | - |
gmail drafts list | 下書きを一覧表示 | - |
gmail drafts create | 下書きを作成 | 送信と同じフラグ |
Calendar コマンド
| コマンド | 説明 | 主なフラグ |
|---|
calendar calendars | カレンダーを一覧表示 | - |
calendar events [calId] | イベントを一覧表示 | --from, --to, --today, --week, --all |
calendar event <calId> <eventId> | イベントの詳細を取得 | - |
calendar create <calId> | イベントを作成 | --summary, --from, --to, --attendees, --with-meet |
calendar update <calId> <eventId> | イベントを更新 | 作成時と同じ |
calendar delete <calId> <eventId> | イベントを削除 | - |
calendar freebusy <calendars> | 空き状況を確認 | --from, --to |
calendar conflicts | 予定の重複を検索 | --week, --days |
calendar search <query> | イベントを検索 | - |
calendar respond <calId> <eventId> | 出欠を回答 | --status=accepted|declined|tentative |
calendar focus-time | 集中時間の予定を作成 | --from, --to |
calendar out-of-office | 不在予定を設定 | --from, --to |
calendar working-location | 勤務場所を設定 | --from, --to, --type |
calendar team <groupEmail> | チームのカレンダーを表示 | - |
Drive コマンド
| コマンド | 説明 | 主なフラグ |
|---|
drive ls | ファイルを一覧表示 | --parent |
drive search <query> | 全文検索 | --max |
drive get <fileId> | ファイルのメタデータを取得 | - |
drive download <fileId> | ファイルをダウンロード | --output |
drive upload <path> | ファイルをアップロード | --name, --parent |
drive mkdir <name> | フォルダーを作成 | --parent |
drive delete <fileId> | 削除(ゴミ箱に移動) | - |
drive move <fileId> | ファイルを移動 | --parent |
drive rename <fileId> <name> | ファイル名を変更 | - |
drive share <fileId> | ファイルを共有 | --role, --type, --email |
drive unshare <fileId> <permId> | 権限を削除 | - |
drive permissions <fileId> | 権限を一覧表示 | - |
drive url <fileId> | ウェブ URL を取得 | - |
drive copy <fileId> <name> | ファイルをコピー | - |
Sheets コマンド
| コマンド | 説明 | 主なフラグ |
|---|
sheets get <id> <range> | 値を読み取る | - |
sheets update <id> <range> [vals] | 値を更新 | --input=RAW|USER_ENTERED |
sheets append <id> <range> [vals] | 行を追加 | --input |
sheets clear <id> <range> | 値をクリア | - |
sheets metadata <id> | スプレッドシートの情報を取得 | - |
sheets create <title> | スプレッドシートを作成 | - |
sheets copy <id> <title> | スプレッドシートをコピー | - |
sheets export <id> | エクスポート | --format=pdf|xlsx|csv |
Docs コマンド
| コマンド | 説明 | 主なフラグ |
|---|
docs cat <docId> | プレーンテキストとして出力 | - |
docs export <docId> | ドキュメントをエクスポート | --format=pdf|docx|txt |
docs info <docId> | メタデータを取得 | - |
docs create <title> | ドキュメントを作成 | - |
docs copy <docId> <title> | ドキュメントをコピー | - |
Slides コマンド
| コマンド | 説明 | 主なフラグ |
|---|
slides export <id> | プレゼンテーションをエクスポート | --format=pdf|pptx |
slides info <id> | メタデータを取得 | - |
slides create <title> | プレゼンテーションを作成 | - |
slides copy <id> <title> | プレゼンテーションをコピー | - |
Tasks コマンド
| コマンド | 説明 | 主なフラグ |
|---|
tasks lists list | タスクリストを一覧表示 | - |
tasks list <listId> | タスクを一覧表示 | --due-min, --due-max, --show-completed |
tasks add <listId> | タスクを追加 | --title, --due, --notes |
tasks update <listId> <taskId> | タスクを更新 | 追加時と同じ |
tasks done <listId> <taskId> | 完了としてマーク | - |
tasks undo <listId> <taskId> | 未完了としてマーク | - |
tasks delete <listId> <taskId> | タスクを削除 | - |
tasks clear <listId> | 完了済みタスクをクリア | - |
連絡先コマンド
| コマンド | 説明 | 主なフラグ |
|---|
contacts search <query> | 連絡先を検索 | - |
contacts list | すべての連絡先を一覧表示 | --max |
contacts get <resourceName> | 連絡先を取得 | - |
contacts create | 連絡先を作成 | --given、--family、--email、--phone |
contacts update <resourceName> | 連絡先を更新 | 作成時と同じ |
contacts delete <resourceName> | 連絡先を削除 | - |
contacts directory search | ディレクトリを検索 | - |
グループコマンド
| コマンド | 説明 | 主なフラグ |
|---|
groups list | 自分のグループを一覧表示 | - |
groups members <groupEmail> | グループのメンバーを一覧表示 | - |
People コマンド
| コマンド | 説明 | 主なフラグ |
|---|
people me | 自分のプロフィールを表示 | - |
グローバルフラグ
すべての gog コマンドで、次のフラグを使用できます。
| フラグ | 説明 |
|---|
--json | JSON を出力します(スクリプトや jq へのパイプ処理に最適) |
--plain | 色なしの TSV を出力します(スクリプトや解析向け) |
--account=EMAIL | 特定のアカウントを使用します(複数アカウントに対応) |
--force | 確認プロンプトを省略します |
--no-input | プロンプトを表示せず、代わりに失敗します(CI/自動化向け) |
--verbose | デバッグ用の詳細なログを出力します |
--color=<auto|always|never> | 色の出力を制御します |
複数アカウントの使用
# Use specific account for a command
gog gmail search "is:unread" [email protected]
# List available accounts
gog auth list
スクリプト用の JSON 出力
# Get unread count for inbox
gog gmail labels get INBOX --json | jq '.messagesUnread'
# Extract event IDs from today
gog calendar events --today --json | jq '.[].id'
# List file IDs from search
gog drive search "budget" --json | jq '.[].id'
# Process email subjects
gog gmail search "is:unread" --json | jq '.[].snippet'
ベストプラクティス
効率的な検索
- 絞り込んでから範囲を広げる - 具体的なクエリから始め、結果が多すぎる場合はフィルターを追加します
- 日付フィルターを使用する -
newer_than: を指定すると、ノイズを大幅に減らせます
- 演算子を組み合わせる -
is:unread from:boss newer_than:7d を使うと、一覧を閲覧するより効率的です
--max を使用する - 結果を確認する際に件数を制限します:--max=10
カレンダーの管理
- 他の人との会議を予定する前に、必ず空き時間を確認します
- リモート会議には
--with-meet を使用し、ビデオリンクを自動作成します
- リマインダーを設定します - 重要な会議には
--reminder="popup:15m" を指定します
- 集中作業の時間をあらかじめ確保し、深い作業に取り組めるようにします
Drive の整理
- フォルダー ID を使用する - よく使うフォルダー ID を保存して、すぐにアクセスできるようにします
- コンテンツで検索する -
fullText contains を使うと、ファイル名が不明確でもドキュメントを見つけられます
- MIME タイプで絞り込む - 特定のドキュメント形式に絞り込みます
- 早めにエクスポートする - 重要なドキュメントを PDF としてダウンロードし、オフラインでアクセスできるようにします
自動化のヒント
- スクリプトでは
--json を使用する - jq で解析します
- シンプルなスクリプトでは
--plain を使用する - タブ区切りで、色は付きません
- CI では
--no-input を使用する - プロンプトによる処理の停止を防ぎます
- ID を保存する - 再利用できるよう、カレンダー、フォルダー、タスクリストの ID を保存します
参考ファイル