gog
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesegog - Google Workspace CLI (v0.10.0)
gog - Google Workspace CLI (v0.10.0)
Google サービスを操作するCLIツール。
アカウント: your-account@gmail.com (default)
実行パス:
gog一款用于操作Google服务的CLI工具。
账户: your-account@gmail.com (默认)
执行路径:
gogExecution Notes
执行注意事项
- ツールで実行時、
execを指定(API応答待ちのため)timeout: 60 - 長いリスト取得は で制限
--max
- 使用工具执行时,需指定
exec(用于等待API响应)timeout: 60 - 获取长列表时,可通过参数限制数量
--max
Gmail
Gmail
メール検索
邮件搜索
bash
undefinedbash
undefined基本検索
基础搜索
gog gmail search "検索クエリ"
gog gmail search "from:someone@example.com"
gog gmail search "is:unread" --max 10
gog gmail search "subject:請求書 after:2026/01/01"
gog gmail search "搜索关键词"
gog gmail search "from:someone@example.com"
gog gmail search "is:unread" --max 10
gog gmail search "subject:账单 after:2026/01/01"
全ページ取得
获取全页内容
gog gmail search "label:重要" --all
**検索クエリ例:**
- `is:unread` - 未読
- `from:xxx` - 送信者
- `to:xxx` - 宛先
- `subject:xxx` - 件名
- `has:attachment` - 添付あり
- `after:YYYY/MM/DD` - 日付以降
- `label:xxx` - ラベルgog gmail search "label:重要" --all
**搜索关键词示例:**
- `is:unread` - 未读邮件
- `from:xxx` - 发件人
- `to:xxx` - 收件人
- `subject:xxx` - 邮件主题
- `has:attachment` - 包含附件
- `after:YYYY/MM/DD` - 指定日期之后
- `label:xxx` - 标签筛选メール取得
获取邮件
bash
undefinedbash
undefinedメッセージ取得
获取邮件信息
gog gmail get <messageId>
gog gmail get <messageId> --body # 本文込み
gog gmail get <messageId>
gog gmail get <messageId> --body # 包含邮件正文
添付ファイルダウンロード
下载附件
gog gmail attachment <messageId> <attachmentId>
undefinedgog gmail attachment <messageId> <attachmentId>
undefinedメール送信
发送邮件
bash
undefinedbash
undefined基本送信
基础发送
gog gmail send --to "recipient@example.com" --subject "件名" --body "本文"
gog gmail send --to "recipient@example.com" --subject "邮件主题" --body "邮件正文"
CC/BCC付き
包含CC/BCC
gog gmail send --to "a@b.com" --cc "c@d.com" --bcc "e@f.com" --subject "件名" --body "本文"
gog gmail send --to "a@b.com" --cc "c@d.com" --bcc "e@f.com" --subject "邮件主题" --body "邮件正文"
添付ファイル付き
包含附件
gog gmail send --to "a@b.com" --subject "件名" --body "本文" --attach "./file.pdf"
gog gmail send --to "a@b.com" --subject "邮件主题" --body "邮件正文" --attach "./file.pdf"
スレッドに返信
回复至线程
gog gmail send --thread-id <threadId> --to "a@b.com" --subject "Re: 件名" --body "返信本文"
gog gmail send --thread-id <threadId> --to "a@b.com" --subject "Re: 邮件主题" --body "回复正文"
全員に返信
回复全部收件人
gog gmail send --reply-to-message-id <messageId> --reply-all --subject "Re: 件名" --body "返信"
**送信オプション:**
| オプション | 説明 |
|-----------|------|
| `--to` | 宛先(カンマ区切り) |
| `--cc` | CC |
| `--bcc` | BCC |
| `--subject` | 件名 |
| `--body` | 本文(プレーンテキスト) |
| `--body-html` | HTML本文 |
| `--body-file` | 本文ファイル |
| `--attach` | 添付ファイル(複数可) |
| `--thread-id` | スレッドID(返信時) |
| `--reply-to-message-id` | 返信元メッセージID |
| `--reply-all` | 全員に返信 |gog gmail send --reply-to-message-id <messageId> --reply-all --subject "Re: 邮件主题" --body "回复内容"
**发送选项:**
| 选项 | 说明 |
|-----------|------|
| `--to` | 收件人(逗号分隔) |
| `--cc` | 抄送 |
| `--bcc` | 密送 |
| `--subject` | 邮件主题 |
| `--body` | 纯文本正文 |
| `--body-html` | HTML格式正文 |
| `--body-file` | 从文件读取正文 |
| `--attach` | 附件(可指定多个) |
| `--thread-id` | 线程ID(回复时使用) |
| `--reply-to-message-id` | 回复源邮件ID |
| `--reply-all` | 回复全部收件人 |ラベル操作
标签操作
bash
undefinedbash
undefinedラベル一覧
列出所有标签
gog gmail labels list
gog gmail labels list
ラベル追加/削除
为线程添加/移除标签
gog gmail thread modify <threadId> --add-labels "INBOX" --remove-labels "UNREAD"
---gog gmail thread modify <threadId> --add-labels "INBOX" --remove-labels "UNREAD"
---Calendar
Calendar
予定一覧
日程列表
bash
undefinedbash
undefined今後の予定(デフォルト7日間)
未来的日程(默认7天)
gog calendar events
gog calendar events --max 20
gog calendar events
gog calendar events --max 20
期間指定
指定时间段
gog calendar events --from "2026-02-01" --to "2026-02-28"
gog calendar events --from "2026-02-01" --to "2026-02-28"
特定カレンダー
特定日历
gog calendar events primary
gog calendar events "user@example.com"
undefinedgog calendar events primary
gog calendar events "user@example.com"
undefined予定作成
创建日程
bash
undefinedbash
undefined通常の予定
普通日程
gog calendar create primary --summary "ミーティング" --from "2026-02-15T10:00:00+09:00" --to "2026-02-15T11:00:00+09:00"
gog calendar create primary --summary "会议" --from "2026-02-15T10:00:00+09:00" --to "2026-02-15T11:00:00+09:00"
終日予定
全天日程
gog calendar create primary --summary "休暇" --from "2026-02-20" --to "2026-02-21" --all-day
gog calendar create primary --summary "休假" --from "2026-02-20" --to "2026-02-21" --all-day
場所・参加者付き
包含地点和参会人的日程
gog calendar create primary --summary "会議" --from "2026-02-15T14:00:00+09:00" --to "2026-02-15T15:00:00+09:00"
--location "会議室A" --attendees "a@b.com,c@d.com"
--location "会議室A" --attendees "a@b.com,c@d.com"
gog calendar create primary --summary "部门会议" --from "2026-02-15T14:00:00+09:00" --to "2026-02-15T15:00:00+09:00"
--location "会议室A" --attendees "a@b.com,c@d.com"
--location "会议室A" --attendees "a@b.com,c@d.com"
Google Meet付き
包含Google Meet的日程
gog calendar create primary --summary "オンラインMTG" --from "2026-02-15T10:00:00+09:00" --to "2026-02-15T11:00:00+09:00" --with-meet
gog calendar create primary --summary "线上会议" --from "2026-02-15T10:00:00+09:00" --to "2026-02-15T11:00:00+09:00" --with-meet
リマインダー付き
包含提醒的日程
gog calendar create primary --summary "MTG" --from "2026-02-15T10:00:00+09:00" --to "2026-02-15T11:00:00+09:00" --reminder "popup:30m" --reminder "email:1d"
**作成オプション:**
| オプション | 説明 |
|-----------|------|
| `--summary` | タイトル |
| `--from` | 開始時刻(RFC3339) |
| `--to` | 終了時刻(RFC3339) |
| `--all-day` | 終日予定 |
| `--location` | 場所 |
| `--description` | 説明 |
| `--attendees` | 参加者(カンマ区切り) |
| `--with-meet` | Google Meet作成 |
| `--reminder` | リマインダー(popup:30m, email:1d等) |
| `--rrule` | 繰り返し |gog calendar create primary --summary "项目会议" --from "2026-02-15T10:00:00+09:00" --to "2026-02-15T11:00:00+09:00" --reminder "popup:30m" --reminder "email:1d"
**创建选项:**
| 选项 | 说明 |
|-----------|------|
| `--summary` | 日程标题 |
| `--from` | 开始时间(RFC3339格式) |
| `--to` | 结束时间(RFC3339格式) |
| `--all-day` | 标记为全天日程 |
| `--location` | 会议地点 |
| `--description` | 日程说明 |
| `--attendees` | 参会人(逗号分隔) |
| `--with-meet` | 创建Google Meet会议链接 |
| `--reminder` | 提醒设置(如popup:30m, email:1d等) |
| `--rrule` | 重复日程规则 |予定更新・削除
更新/删除日程
bash
undefinedbash
undefined更新
更新日程
gog calendar update primary <eventId> --summary "新タイトル"
gog calendar update primary <eventId> --summary "新标题"
削除
删除日程
gog calendar delete primary <eventId>
undefinedgog calendar delete primary <eventId>
undefined検索
搜索日程
bash
gog calendar search "ミーティング"bash
gog calendar search "会议"カレンダー一覧
列出所有日历
bash
gog calendar calendarsbash
gog calendar calendarsDrive
Drive
ファイル一覧
文件列表
bash
undefinedbash
undefinedルートフォルダ
根目录文件
gog drive ls
gog drive ls
特定フォルダ
特定文件夹内的文件
gog drive ls --parent <folderId>
gog drive ls --parent <folderId>
件数制限
限制显示数量
gog drive ls --max 20
undefinedgog drive ls --max 20
undefined検索
搜索文件
bash
gog drive search "レポート"
gog drive search "mimeType='application/pdf'"bash
gog drive search "报告"
gog drive search "mimeType='application/pdf'"ダウンロード・アップロード
下载/上传文件
bash
undefinedbash
undefinedダウンロード
下载文件
gog drive download <fileId>
gog drive download <fileId> --output "./local-file.pdf"
gog drive download <fileId>
gog drive download <fileId> --output "./local-file.pdf"
アップロード
上传文件
gog drive upload "./local-file.pdf"
gog drive upload "./file.pdf" --parent <folderId>
undefinedgog drive upload "./local-file.pdf"
gog drive upload "./file.pdf" --parent <folderId>
undefinedフォルダ作成・移動
创建/移动文件夹
bash
undefinedbash
undefinedフォルダ作成
创建文件夹
gog drive mkdir "新フォルダ"
gog drive mkdir "サブフォルダ" --parent <parentFolderId>
gog drive mkdir "新文件夹"
gog drive mkdir "子文件夹" --parent <parentFolderId>
移動
移动文件/文件夹
gog drive move <fileId> --parent <newFolderId>
gog drive move <fileId> --parent <newFolderId>
リネーム
重命名
gog drive rename <fileId> "新しい名前"
undefinedgog drive rename <fileId> "新名称"
undefinedコピー
复制文件
bash
gog drive copy <fileId> "コピー名"
gog drive copy <fileId> "コピー名" --parent <folderId>bash
gog drive copy <fileId> "副本名称"
gog drive copy <fileId> "副本名称" --parent <folderId>共有
共享文件
bash
undefinedbash
undefined共有
设置共享权限
gog drive share <fileId> --email "user@example.com" --role reader
gog drive share <fileId> --email "user@example.com" --role writer
gog drive share <fileId> --email "user@example.com" --role reader
gog drive share <fileId> --email "user@example.com" --role writer
権限一覧
列出所有权限
gog drive permissions <fileId>
gog drive permissions <fileId>
共有解除
取消共享权限
gog drive unshare <fileId> <permissionId>
---gog drive unshare <fileId> <permissionId>
---Sheets
Sheets
読み取り
读取数据
bash
gog sheets get <spreadsheetId> "シート1!A1:C10"
gog sheets get <spreadsheetId> "シート1!A:A" # 列全体bash
gog sheets get <spreadsheetId> "工作表1!A1:C10"
gog sheets get <spreadsheetId> "工作表1!A:A" # 整列读取書き込み
写入数据
bash
undefinedbash
undefinedパイプ区切りで複数セル
竖线分隔多单元格内容
gog sheets update <spreadsheetId> "シート1!A1:C1" "値1|値2|値3"
gog sheets update <spreadsheetId> "工作表1!A1:C1" "值1|值2|值3"
JSON形式(カンマ・パイプを含むデータ)
JSON格式(包含逗号、竖线的数据)
gog sheets update <spreadsheetId> "シート1!A1:C2" --values-json '[["名前","金額"],["田中","500,000"]]'
undefinedgog sheets update <spreadsheetId> "工作表1!A1:C2" --values-json '[["姓名","金额"],["田中","500,000"]]'
undefined追加(末尾に行追加)
追加数据(在末尾添加行)
bash
gog sheets append <spreadsheetId> "シート1" "値1|値2|値3"bash
gog sheets append <spreadsheetId> "工作表1" "值1|值2|值3"クリア
清除数据
bash
gog sheets clear <spreadsheetId> "シート1!A1:C10"bash
gog sheets clear <spreadsheetId> "工作表1!A1:C10"書式設定
设置格式
bash
FMT='{"backgroundColor":{"red":0.2,"green":0.4,"blue":0.7},"textFormat":{"bold":true}}'
gog sheets format <spreadsheetId> "シート1!A1:C1" --format-json "$FMT"bash
FMT='{"backgroundColor":{"red":0.2,"green":0.4,"blue":0.7},"textFormat":{"bold":true}}'
gog sheets format <spreadsheetId> "工作表1!A1:C1" --format-json "$FMT"作成・コピー
创建/复制表格
bash
undefinedbash
undefined新規作成
新建表格
gog sheets create "新しいスプレッドシート"
gog sheets create "タイトル" --sheets "シート1,シート2,シート3"
gog sheets create "新表格"
gog sheets create "表格标题" --sheets "工作表1,工作表2,工作表3"
コピー
复制表格
gog sheets copy <spreadsheetId> "コピー名"
undefinedgog sheets copy <spreadsheetId> "副本名称"
undefinedメタデータ・エクスポート
元数据与导出
bash
gog sheets metadata <spreadsheetId>
gog sheets export <spreadsheetId> --format csv
gog sheets export <spreadsheetId> --format xlsxbash
gog sheets metadata <spreadsheetId>
gog sheets export <spreadsheetId> --format csv
gog sheets export <spreadsheetId> --format xlsxContacts
Contacts
検索・一覧
搜索/列出联系人
bash
gog contacts list
gog contacts list --max 50
gog contacts search "田中"bash
gog contacts list
gog contacts list --max 50
gog contacts search "田中"取得・作成
获取/创建联系人
bash
gog contacts get <resourceName>
gog contacts create --name "山田太郎" --email "yamada@example.com" --phone "090-1234-5678"bash
gog contacts get <resourceName>
gog contacts create --name "山田太郎" --email "yamada@example.com" --phone "090-1234-5678"更新・削除
更新/删除联系人
bash
gog contacts update <resourceName> --name "新しい名前"
gog contacts delete <resourceName>bash
gog contacts update <resourceName> --name "新姓名"
gog contacts delete <resourceName>Tasks
Tasks
タスクリスト
任务列表
bash
gog tasks lists list # リスト一覧bash
gog tasks lists list # 列出所有任务列表タスク操作
任务操作
bash
undefinedbash
undefined一覧
列出任务
gog tasks list <tasklistId>
gog tasks list <tasklistId>
作成
创建任务
gog tasks add <tasklistId> --title "やること"
gog tasks add <tasklistId> --title "タスク" --notes "詳細メモ" --due "2026-02-20"
gog tasks add <tasklistId> --title "待办事项"
gog tasks add <tasklistId> --title "任务" --notes "详细备注" --due "2026-02-20"
完了
标记任务完成
gog tasks done <tasklistId> <taskId>
gog tasks done <tasklistId> <taskId>
未完了に戻す
取消任务完成状态
gog tasks undo <tasklistId> <taskId>
gog tasks undo <tasklistId> <taskId>
更新
更新任务
gog tasks update <tasklistId> <taskId> --title "新タイトル"
gog tasks update <tasklistId> <taskId> --title "新标题"
削除
删除任务
gog tasks delete <tasklistId> <taskId>
gog tasks delete <tasklistId> <taskId>
完了済みをクリア
清除已完成任务
gog tasks clear <tasklistId>
---gog tasks clear <tasklistId>
---共通オプション
通用选项
| オプション | 説明 |
|---|---|
| JSON出力 |
| TSV出力 |
| アカウント指定 |
| 最大件数 |
| 確認スキップ |
| 実行せずプレビュー |
| 选项 | 说明 |
|---|---|
| 输出JSON格式 |
| 输出TSV格式 |
| 指定操作账户 |
| 最大返回数量 |
| 跳过确认步骤 |
| 预览操作,不实际执行 |
Tips
小贴士
- SpreadsheetId: URL から取得
https://docs.google.com/spreadsheets/d/<ID>/edit - FileId: URL から取得
https://drive.google.com/file/d/<ID>/view - CalendarId: でメインカレンダー、または共有カレンダーのメールアドレス
primary - TasklistId: で確認
gog tasks lists list
- SpreadsheetId: 从URL 中获取
https://docs.google.com/spreadsheets/d/<ID>/edit - FileId: 从URL 中获取
https://drive.google.com/file/d/<ID>/view - CalendarId: 使用指代主日历,或使用共享日历的邮箱地址
primary - TasklistId: 通过命令查看
gog tasks lists list