google

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Google Personal Assistant

Google个人助手

A comprehensive skill for managing Google Workspace services via the
gog
CLI. Designed for Personal Assistant and Chief of Staff workflows with emphasis on efficient searching, filtering, and querying.
这是一款通过
gog
CLI管理Google Workspace服务的综合技能,专为个人助理、行政总监类工作流设计,重点优化了搜索、筛选和查询效率。

When to Use This Skill

何时使用该技能

  • Triaging and processing email inbox
  • Scheduling meetings and managing calendar events
  • Finding availability across multiple calendars
  • Searching and organizing Google Drive documents
  • Managing task lists and to-dos
  • Looking up and managing contacts
  • Reading/writing data in Google Sheets
  • Exporting Docs, Slides, or Sheets
  • Setting focus time or out-of-office status
  • 分类处理收件箱邮件
  • 安排会议、管理日历事件
  • 查询多个日历的可用时间
  • 搜索和整理Google Drive文档
  • 管理任务清单和待办事项
  • 查询和管理联系人
  • 读写Google Sheets中的数据
  • 导出Docs、Slides或Sheets文件
  • 设置专注时间或外出状态

Prerequisites

前置条件

Ensure
gog
is installed and authenticated:
bash
undefined
确保已安装
gog
并完成身份验证:
bash
undefined

Check installation

检查安装情况

gog version
gog version

Check authentication status

检查认证状态

gog auth status
gog auth status

Verify account access

验证账户访问权限

gog people me
gog people me

Add a new account if needed

按需添加新账户

gog auth add your@email.com --services=all
undefined
gog auth add your@email.com --services=all
undefined

Quick Start

快速开始

Gmail

Gmail

bash
undefined
bash
undefined

Search unread emails

搜索未读邮件

gog gmail search "is:unread" --max=20
gog gmail search "is:unread" --max=20

Search from specific sender

搜索指定发件人的邮件

gog gmail search "from:boss@company.com newer_than:7d"
gog gmail search "from:boss@company.com newer_than:7d"

Send an email

发送邮件

gog gmail send --to="recipient@example.com" --subject="Subject" --body="Message body"
gog gmail send --to="recipient@example.com" --subject="Subject" --body="Message body"

Reply to a thread

回复会话

gog gmail send --reply-to-message-id=MESSAGE_ID --body="Reply text"
gog gmail send --reply-to-message-id=MESSAGE_ID --body="Reply text"

Get message details

获取邮件详情

gog gmail get MESSAGE_ID
undefined
gog gmail get MESSAGE_ID
undefined

Calendar

Calendar

bash
undefined
bash
undefined

View today's events

查看今日事件

gog calendar events --today
gog calendar events --today

View this week

查看本周事件

gog calendar events --week
gog calendar events --week

Create an event with Google Meet

创建带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="person1@example.com,person2@example.com"
--with-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="person1@example.com,person2@example.com"
--with-meet

Check availability

查询可用时间

gog calendar freebusy "person1@example.com,person2@example.com"
--from="2026-01-15T09:00:00Z" --to="2026-01-15T17:00:00Z"
gog calendar freebusy "person1@example.com,person2@example.com"
--from="2026-01-15T09:00:00Z" --to="2026-01-15T17:00:00Z"

Find scheduling conflicts

查找排期冲突

gog calendar conflicts --week
undefined
gog calendar conflicts --week
undefined

Drive

Drive

bash
undefined
bash
undefined

List files in root

列出根目录下的文件

gog drive ls
gog drive ls

Search for documents

搜索文档

gog drive search "quarterly report"
gog drive search "quarterly report"

Download a file

下载文件

gog drive download FILE_ID
gog drive download FILE_ID

Upload a file

上传文件

gog drive upload /path/to/file.pdf --parent=FOLDER_ID
gog drive upload /path/to/file.pdf --parent=FOLDER_ID

Get shareable URL

获取可分享链接

gog drive url FILE_ID
undefined
gog drive url FILE_ID
undefined

Tasks

Tasks

bash
undefined
bash
undefined

List task lists

列出任务清单

gog tasks lists list
gog tasks lists list

View tasks in default list

查看默认清单中的任务

gog tasks list @default
gog tasks list @default

Add a task

添加任务

gog tasks add @default --title="Review report" --due="2026-01-15"
gog tasks add @default --title="Review report" --due="2026-01-15"

Mark task complete

标记任务完成

gog tasks done @default TASK_ID
undefined
gog tasks done @default TASK_ID
undefined

Sheets

Sheets

bash
undefined
bash
undefined

Read a range

读取指定范围的数据

gog sheets get SPREADSHEET_ID "Sheet1!A1:D10"
gog sheets get SPREADSHEET_ID "Sheet1!A1:D10"

Update values

更新数据

gog sheets update SPREADSHEET_ID "Sheet1!A1" "Value1" "Value2"
gog sheets update SPREADSHEET_ID "Sheet1!A1" "Value1" "Value2"

Append a row

追加一行数据

gog sheets append SPREADSHEET_ID "Sheet1!A:D" "Col1" "Col2" "Col3" "Col4"
undefined
gog sheets append SPREADSHEET_ID "Sheet1!A:D" "Col1" "Col2" "Col3" "Col4"
undefined

Gmail Search Syntax

Gmail搜索语法

Gmail search is powerful. Here are the essential operators:
Gmail搜索功能非常强大,以下是核心运算符:

Sender & Recipient

发件人和收件人

OperatorExampleDescription
from:
from:boss@company.com
Emails from sender
to:
to:team@company.com
Emails sent to recipient
cc:
cc:manager@company.com
CC'd recipient
bcc:
bcc:archive@company.com
BCC'd recipient
OperatorExample说明
from:
from:boss@company.com
指定发件人的邮件
to:
to:team@company.com
发送给指定收件人的邮件
cc:
cc:manager@company.com
抄送指定收件人的邮件
bcc:
bcc:archive@company.com
密送指定收件人的邮件

Status & Labels

状态和标签

OperatorExampleDescription
is:unread
is:unread
Unread messages
is:read
is:read
Read messages
is:starred
is:starred
Starred messages
is:important
is:important
Marked important
is:snoozed
is:snoozed
Snoozed messages
label:
label:work
Has specific label
in:inbox
in:inbox
In inbox
in:sent
in:sent
In sent folder
in:drafts
in:drafts
In drafts
in:trash
in:trash
In trash
in:spam
in:spam
In spam
in:anywhere
in:anywhere
All mail including spam/trash
OperatorExample说明
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
所有邮件,含垃圾邮件和垃圾箱内容

Content & Subject

内容和主题

OperatorExampleDescription
subject:
subject:urgent
Subject contains word
"exact phrase"
"quarterly report"
Exact phrase match
has:attachment
has:attachment
Has any attachment
filename:
filename:pdf
Attachment filename/type
filename:
filename:report.xlsx
Specific filename
OperatorExample说明
subject:
subject:urgent
主题包含指定关键词
"exact phrase"
"quarterly report"
精确匹配短语
has:attachment
has:attachment
包含任意附件
filename:
filename:pdf
附件文件名/类型匹配
filename:
filename:report.xlsx
匹配特定文件名

Date & Time

日期和时间

OperatorExampleDescription
newer_than:
newer_than:7d
Within last N days
older_than:
older_than:1y
Older than N years
after:
after:2026/01/01
After specific date
before:
before:2026/12/31
Before specific date
Units for newer_than/older_than:
d
(day),
m
(month),
y
(year)
OperatorExample说明
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
(年)

Size

大小

OperatorExampleDescription
larger:
larger:5M
Larger than size
smaller:
smaller:100K
Smaller than size
Units:
K
(KB),
M
(MB)
OperatorExample说明
larger:
larger:5M
大于指定大小
smaller:
smaller:100K
小于指定大小
单位:
K
(KB),
M
(MB)

Categories

分类

OperatorExampleDescription
category:primary
category:primary
Primary inbox
category:social
category:social
Social category
category:promotions
category:promotions
Promotions
category:updates
category:updates
Updates
category:forums
category:forums
Forums
OperatorExample说明
category:primary
category:primary
主收件箱
category:social
category:social
社交分类
category:promotions
category:promotions
推广内容
category:updates
category:updates
更新通知
category:forums
category:forums
论坛消息

Boolean Operators

布尔运算符

OperatorExampleDescription
AND
(or space)
from:alice subject:report
Both conditions
OR
from:alice OR from:bob
Either condition
-
(NOT)
-category:promotions
Exclude condition
()
(from:alice OR from:bob) is:unread
Grouping
{}
{from:alice from:bob}
OR shorthand
OperatorExample说明
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的简写形式

Example Queries

查询示例

bash
undefined
bash
undefined

Unread from VIPs this week

本周内来自重要人物的未读邮件

gog gmail search "is:unread from:(boss@company.com OR ceo@company.com) newer_than:7d"
gog gmail search "is:unread from:(boss@company.com OR ceo@company.com) newer_than:7d"

Large attachments

带大附件的邮件

gog gmail search "has:attachment larger:10M"
gog gmail search "has:attachment larger:10M"

Urgent subjects excluding promotions

排除推广内容的紧急主题未读邮件

gog gmail search "subject:(urgent OR asap OR EOD) -category:promotions is:unread"
gog gmail search "subject:(urgent OR asap OR EOD) -category:promotions is:unread"

Contracts from legal team

法务团队发送的带PDF附件的合同邮件

gog gmail search "from:legal@company.com subject:contract has:attachment filename:pdf"
gog gmail search "from:legal@company.com subject:contract has:attachment filename:pdf"

All messages in a thread (use thread ID from search results)

某个会话的所有消息(使用搜索结果中的thread ID)

gog gmail thread get THREAD_ID

See [references/gmail-search-syntax.md](references/gmail-search-syntax.md) for complete operator reference.
gog gmail thread get THREAD_ID

完整运算符参考请查看 [references/gmail-search-syntax.md](references/gmail-search-syntax.md)。

Drive Search Syntax

Drive搜索语法

Drive search uses a query language for precise file finding:
Drive搜索使用查询语言实现精准文件查找:

Basic Operators

基础运算符

OperatorExampleDescription
name contains
name contains 'report'
Filename contains
fullText contains
fullText contains 'budget'
Content search
mimeType =
mimeType = 'application/pdf'
File type
OperatorExample说明
name contains
name contains 'report'
文件名包含指定内容
fullText contains
fullText contains 'budget'
内容包含指定文本
mimeType =
mimeType = 'application/pdf'
指定文件类型

Date Filters

日期筛选

OperatorExampleDescription
modifiedTime >
modifiedTime > '2026-01-01'
Modified after
modifiedTime <
modifiedTime < '2026-01-01'
Modified before
createdTime >
createdTime > '2026-01-01'
Created after
viewedByMeTime >
viewedByMeTime > '2026-01-01'
Viewed after
OperatorExample说明
modifiedTime >
modifiedTime > '2026-01-01'
指定时间后修改
modifiedTime <
modifiedTime < '2026-01-01'
指定时间前修改
createdTime >
createdTime > '2026-01-01'
指定时间后创建
viewedByMeTime >
viewedByMeTime > '2026-01-01'
指定时间后查看过

Ownership & Sharing

所有权和共享

OperatorExampleDescription
'email' in owners
'me' in owners
Owned by user
'email' in writers
'user@example.com' in writers
User can edit
'email' in readers
'user@example.com' in readers
User can view
sharedWithMe
sharedWithMe
Shared with you
OperatorExample说明
'email' in owners
'me' in owners
归属指定用户所有
'email' in writers
'user@example.com' in writers
指定用户可编辑
'email' in readers
'user@example.com' in readers
指定用户可查看
sharedWithMe
sharedWithMe
共享给你的文件

Properties

属性

OperatorExampleDescription
starred
starred
Starred files
trashed = false
trashed = false
Not in trash
'folderId' in parents
'FOLDER_ID' in parents
In specific folder
OperatorExample说明
starred
starred
星标文件
trashed = false
trashed = false
不在垃圾箱内
'folderId' in parents
'FOLDER_ID' in parents
在指定文件夹内

Common MIME Types

常用MIME类型

TypeMIME Type
Google Doc
application/vnd.google-apps.document
Google Sheet
application/vnd.google-apps.spreadsheet
Google Slides
application/vnd.google-apps.presentation
Google Form
application/vnd.google-apps.form
Folder
application/vnd.google-apps.folder
PDF
application/pdf
Word
application/vnd.openxmlformats-officedocument.wordprocessingml.document
Excel
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
类型MIME Type
Google Doc
application/vnd.google-apps.document
Google Sheet
application/vnd.google-apps.spreadsheet
Google Slides
application/vnd.google-apps.presentation
Google Form
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

Boolean Operators

布尔运算符

  • and
    - Both conditions must match
  • or
    - Either condition matches
  • not
    - Negate condition
  • and
    - 同时满足两个条件
  • or
    - 满足任意一个条件
  • not
    - 否定条件

Example Queries

查询示例

bash
undefined
bash
undefined

Recent docs mentioning Q4

2026年以来提及Q4的近期文档

gog drive search "fullText contains 'Q4' and modifiedTime > '2026-01-01'"
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'"
gog drive search "sharedWithMe and mimeType = 'application/vnd.google-apps.spreadsheet'"

PDFs I own

我所有的PDF文件

gog drive search "'me' in owners and mimeType = 'application/pdf'"
gog drive search "'me' in owners and mimeType = 'application/pdf'"

Files modified this week

本周修改的文件

gog drive search "modifiedTime > '2026-01-03'"
gog drive search "modifiedTime > '2026-01-03'"

Documents in specific folder

指定文件夹内的文档

gog drive ls --parent=FOLDER_ID
gog drive ls --parent=FOLDER_ID

Starred presentations

星标演示文稿

gog drive search "starred and mimeType = 'application/vnd.google-apps.presentation'"

See [references/drive-search-syntax.md](references/drive-search-syntax.md) for complete query reference.
gog drive search "starred and mimeType = 'application/vnd.google-apps.presentation'"

完整查询参考请查看 [references/drive-search-syntax.md](references/drive-search-syntax.md)。

PA/CoS Workflows

PA/CoS 工作流

Morning Inbox Triage

晨间收件箱分类

bash
undefined
bash
undefined

1. Check unread counts by label

1. 按标签查看未读计数

gog gmail labels list --json | jq '.[] | select(.messagesUnread > 0) | {name, unread: .messagesUnread}'
gog gmail labels list --json | jq '.[] | select(.messagesUnread > 0) | {name, unread: .messagesUnread}'

2. Review unread from priority senders

2. 查看优先级发件人的未读邮件

gog gmail search "is:unread from:(boss@company.com OR vip@client.com)" --max=20
gog gmail search "is:unread from:(boss@company.com OR vip@client.com)" --max=20

3. Check for urgent subjects

3. 查看紧急主题的邮件

gog gmail search "is:unread subject:(urgent OR asap OR EOD OR "action required")" --max=10
gog gmail search "is:unread subject:(urgent OR asap OR EOD OR "action required")" --max=10

4. Review threads needing response (excludes noise)

4. 查看需要回复的会话(排除噪音内容)

gog gmail search "is:unread in:inbox -category:updates -category:promotions -category:social" --max=30
gog gmail search "is:unread in:inbox -category:updates -category:promotions -category:social" --max=30

5. Check for emails with attachments requiring action

5. 查看带附件需要处理的未读邮件

gog gmail search "is:unread has:attachment newer_than:2d" --max=15
undefined
gog gmail search "is:unread has:attachment newer_than:2d" --max=15
undefined

Schedule a Meeting

安排会议

bash
undefined
bash
undefined

1. Find availability for attendees

1. 查询参会人可用时间

gog calendar freebusy "person1@company.com,person2@company.com"
--from="2026-01-15T09:00:00-08:00"
--to="2026-01-15T17:00:00-08:00"
gog calendar freebusy "person1@company.com,person2@company.com"
--from="2026-01-15T09:00:00-08:00"
--to="2026-01-15T17:00:00-08:00"

2. Check your own conflicts

2. 检查自己的排期冲突

gog calendar conflicts --days=7
gog calendar conflicts --days=7

3. Create the meeting

3. 创建会议

gog calendar create primary
--summary="Project Kickoff"
--from="2026-01-15T14:00:00-08:00"
--to="2026-01-15T15:00:00-08:00"
--attendees="person1@company.com,person2@company.com"
--description="Agenda:\n1. Project overview\n2. Timeline review\n3. Action items"
--location="Conference Room A"
--with-meet
--reminder="popup:15m"
gog calendar create primary
--summary="Project Kickoff"
--from="2026-01-15T14:00:00-08:00"
--to="2026-01-15T15:00:00-08:00"
--attendees="person1@company.com,person2@company.com"
--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

4. 发送会议详情通知邮件

gog gmail send
--to="person1@company.com,person2@company.com"
--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"
undefined
gog gmail send
--to="person1@company.com,person2@company.com"
--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"
undefined

Weekly Calendar Prep

每周日历准备

bash
undefined
bash
undefined

1. View the week ahead

1. 查看下周安排

gog calendar events --week
gog calendar events --week

2. Check all calendars for the week

2. 查看所有日历的本周安排

gog calendar events --week --all
gog calendar events --week --all

3. Find and resolve conflicts

3. 查找并解决排期冲突

gog calendar conflicts --week
gog calendar conflicts --week

4. Check team availability (for group)

4. 查看团队可用时间(针对群组)

gog calendar team engineering@company.com --week
gog calendar team engineering@company.com --week

5. Block focus time

5. 预留专注时间

gog calendar focus-time
--from="2026-01-16T09:00:00-08:00"
--to="2026-01-16T12:00:00-08:00"
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)

6. 设置外出状态(按需)

gog calendar out-of-office
--from="2026-01-20"
--to="2026-01-21"
--summary="Out of office - personal day"
gog calendar out-of-office
--from="2026-01-20"
--to="2026-01-21"
--summary="Out of office - personal day"

7. Set working location

7. 设置工作地点

gog calendar working-location
--from="2026-01-17"
--to="2026-01-17"
--type="home"
undefined
gog calendar working-location
--from="2026-01-17"
--to="2026-01-17"
--type="home"
undefined

Document Search & Organization

文档搜索与整理

bash
undefined
bash
undefined

Find all docs from a project

查找项目相关的所有文档

gog drive search "fullText contains 'Project Alpha'"
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
gog drive search "'me' in owners and modifiedTime > '2026-01-01'" --max=50

Find docs shared by specific person

查找指定人员共享的文档

gog drive search "'colleague@company.com' in writers"
gog drive search "'colleague@company.com' in writers"

Find presentation decks

查找演示文稿

gog drive search "mimeType = 'application/vnd.google-apps.presentation' and modifiedTime > '2025-10-01'"
gog drive search "mimeType = 'application/vnd.google-apps.presentation' and modifiedTime > '2025-10-01'"

Download a doc as PDF

导出文档为PDF

gog docs export DOC_ID --format=pdf --output="./report.pdf"
gog docs export DOC_ID --format=pdf --output="./report.pdf"

Read doc contents (plain text for quick review)

读取文档内容(纯文本快速预览)

gog docs cat DOC_ID
gog docs cat DOC_ID

Export spreadsheet as Excel

导出电子表格为Excel

gog sheets export SPREADSHEET_ID --format=xlsx --output="./data.xlsx"
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
undefined
gog drive url FILE_ID gog drive share FILE_ID --role=reader --type=anyone
undefined

Daily Task Management

日常任务管理

bash
undefined
bash
undefined

1. List all task lists

1. 列出所有任务清单

gog tasks lists list
gog tasks lists list

2. View all tasks in default list

2. 查看默认清单的所有任务

gog tasks list @default
gog tasks list @default

3. View tasks due today

3. 查看今日到期的任务

gog tasks list @default --due-max="$(date -u +%Y-%m-%dT23:59:59Z)"
gog tasks list @default --due-max="$(date -u +%Y-%m-%dT23:59:59Z)"

4. Add a new task with due date

4. 添加带到期日的新任务

gog tasks add @default
--title="Review Q4 financials"
--due="2026-01-15"
--notes="Check revenue projections and expense reports"
gog tasks add @default
--title="Review Q4 financials"
--due="2026-01-15"
--notes="Check revenue projections and expense reports"

5. Complete a task

5. 标记任务完成

gog tasks done @default TASK_ID
gog tasks done @default TASK_ID

6. Reopen a completed task

6. 重新打开已完成的任务

gog tasks undo @default TASK_ID
gog tasks undo @default TASK_ID

7. Delete a task

7. 删除任务

gog tasks delete @default TASK_ID
gog tasks delete @default TASK_ID

8. Clear all completed tasks

8. 清空所有已完成任务

gog tasks clear @default
undefined
gog tasks clear @default
undefined

Contact Lookup

联系人查询

bash
undefined
bash
undefined

Search for a contact

搜索联系人

gog contacts search "John Smith"
gog contacts search "John Smith"

List all contacts

列出所有联系人

gog contacts list --max=100
gog contacts list --max=100

Get contact details

获取联系人详情

gog contacts get RESOURCE_NAME
gog contacts get RESOURCE_NAME

Create a new contact

创建新联系人

gog contacts create
--given="Jane"
--family="Doe"
--email="jane.doe@example.com"
--phone="+1-555-123-4567"
gog contacts create
--given="Jane"
--family="Doe"
--email="jane.doe@example.com"
--phone="+1-555-123-4567"

Search directory (Workspace)

搜索企业目录(Workspace专属)

gog contacts directory search "engineering"

See [references/common-workflows.md](references/common-workflows.md) for more workflow recipes.
gog contacts directory search "engineering"

更多工作流方案请查看 [references/common-workflows.md](references/common-workflows.md)。

Command Reference

命令参考

Gmail Commands

Gmail命令

CommandDescriptionKey Flags
gmail search <query>
Search threads
--max
,
--oldest
,
--page
gmail get <messageId>
Get message content
--format=full|metadata|raw
gmail send
Send email
--to
,
--cc
,
--bcc
,
--subject
,
--body
,
--attach
gmail thread get <id>
Get full thread-
gmail thread modify <id>
Modify thread labels
--add-labels
,
--remove-labels
gmail labels list
List all labels-
gmail labels get <name>
Get label details-
gmail labels modify <ids>
Bulk modify labels
--add
,
--remove
gmail attachment <msgId> <attId>
Download attachment-
gmail url <threadId>
Get Gmail web URL-
gmail batch delete <ids>
Bulk delete-
gmail drafts list
List drafts-
gmail drafts create
Create draftSame flags as send
命令说明核心参数
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网页端链接-
gmail batch delete <ids>
批量删除-
gmail drafts list
列出草稿-
gmail drafts create
创建草稿同发送邮件参数

Calendar Commands

Calendar命令

CommandDescriptionKey Flags
calendar calendars
List calendars-
calendar events [calId]
List events
--from
,
--to
,
--today
,
--week
,
--all
calendar event <calId> <eventId>
Get event details-
calendar create <calId>
Create event
--summary
,
--from
,
--to
,
--attendees
,
--with-meet
calendar update <calId> <eventId>
Update eventSame as create
calendar delete <calId> <eventId>
Delete event-
calendar freebusy <calendars>
Check availability
--from
,
--to
calendar conflicts
Find conflicts
--week
,
--days
calendar search <query>
Search events-
calendar respond <calId> <eventId>
RSVP
--status=accepted|declined|tentative
calendar focus-time
Create focus block
--from
,
--to
calendar out-of-office
Set OOO
--from
,
--to
calendar working-location
Set work location
--from
,
--to
,
--type
calendar team <groupEmail>
View team calendars-
命令说明核心参数
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>
提交RSVP
--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 Commands

Drive命令

CommandDescriptionKey Flags
drive ls
List files
--parent
drive search <query>
Full-text search
--max
drive get <fileId>
Get file metadata-
drive download <fileId>
Download file
--output
drive upload <path>
Upload file
--name
,
--parent
drive mkdir <name>
Create folder
--parent
drive delete <fileId>
Delete (trash)-
drive move <fileId>
Move file
--parent
drive rename <fileId> <name>
Rename file-
drive share <fileId>
Share file
--role
,
--type
,
--email
drive unshare <fileId> <permId>
Remove permission-
drive permissions <fileId>
List permissions-
drive url <fileId>
Get web URL-
drive copy <fileId> <name>
Copy file-
命令说明核心参数
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>
获取网页端链接-
drive copy <fileId> <name>
复制文件-

Sheets Commands

Sheets命令

CommandDescriptionKey Flags
sheets get <id> <range>
Read values-
sheets update <id> <range> [vals]
Update values
--input=RAW|USER_ENTERED
sheets append <id> <range> [vals]
Append row
--input
sheets clear <id> <range>
Clear values-
sheets metadata <id>
Get spreadsheet info-
sheets create <title>
Create spreadsheet-
sheets copy <id> <title>
Copy spreadsheet-
sheets export <id>
Export
--format=pdf|xlsx|csv
命令说明核心参数
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 Commands

Docs命令

CommandDescriptionKey Flags
docs cat <docId>
Print as plain text-
docs export <docId>
Export document
--format=pdf|docx|txt
docs info <docId>
Get metadata-
docs create <title>
Create document-
docs copy <docId> <title>
Copy document-
命令说明核心参数
docs cat <docId>
输出纯文本内容-
docs export <docId>
导出文档
--format=pdf|docx|txt
docs info <docId>
获取元数据-
docs create <title>
创建文档-
docs copy <docId> <title>
复制文档-

Slides Commands

Slides命令

CommandDescriptionKey Flags
slides export <id>
Export presentation
--format=pdf|pptx
slides info <id>
Get metadata-
slides create <title>
Create presentation-
slides copy <id> <title>
Copy presentation-
命令说明核心参数
slides export <id>
导出演示文稿
--format=pdf|pptx
slides info <id>
获取元数据-
slides create <title>
创建演示文稿-
slides copy <id> <title>
复制演示文稿-

Tasks Commands

Tasks命令

CommandDescriptionKey Flags
tasks lists list
List task lists-
tasks list <listId>
List tasks
--due-min
,
--due-max
,
--show-completed
tasks add <listId>
Add task
--title
,
--due
,
--notes
tasks update <listId> <taskId>
Update taskSame as add
tasks done <listId> <taskId>
Mark complete-
tasks undo <listId> <taskId>
Mark incomplete-
tasks delete <listId> <taskId>
Delete task-
tasks clear <listId>
Clear completed-
命令说明核心参数
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 Commands

Contacts命令

CommandDescriptionKey Flags
contacts search <query>
Search contacts-
contacts list
List all contacts
--max
contacts get <resourceName>
Get contact-
contacts create
Create contact
--given
,
--family
,
--email
,
--phone
contacts update <resourceName>
Update contactSame as create
contacts delete <resourceName>
Delete contact-
contacts directory search
Search directory-
命令说明核心参数
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 Commands

Groups命令

CommandDescriptionKey Flags
groups list
List your groups-
groups members <groupEmail>
List group members-
命令说明核心参数
groups list
列出你加入的群组-
groups members <groupEmail>
列出群组成员-

People Commands

People命令

CommandDescriptionKey Flags
people me
Show your profile-
命令说明核心参数
people me
显示你的个人资料-

Global Flags

全局参数

All
gog
commands support these flags:
FlagDescription
--json
Output JSON (best for scripting/piping to jq)
--plain
TSV output, no colors (for scripts/parsing)
--account=EMAIL
Use specific account (multi-account support)
--force
Skip confirmation prompts
--no-input
Never prompt, fail instead (CI/automation)
--verbose
Detailed logging for debugging
--color=<auto|always|never>
Control color output
所有
gog
命令都支持以下参数:
参数说明
--json
输出JSON格式(适合脚本/通过jq处理)
--plain
TSV格式输出,无颜色(适合脚本/解析)
--account=EMAIL
使用指定账户(支持多账户)
--force
跳过确认提示
--no-input
禁止交互提示,遇到需要输入的场景直接失败(适合CI/自动化场景)
--verbose
输出详细日志用于调试
--color=<auto|always|never>
控制颜色输出

Multi-Account Usage

多账户使用

bash
undefined
bash
undefined

Use specific account for a command

对单个命令使用指定账户

gog gmail search "is:unread" --account=work@company.com
gog gmail search "is:unread" --account=work@company.com

List available accounts

列出可用账户

gog auth list
undefined
gog auth list
undefined

JSON Output for Scripting

脚本场景的JSON输出

bash
undefined
bash
undefined

Get unread count for inbox

获取收件箱未读计数

gog gmail labels get INBOX --json | jq '.messagesUnread'
gog gmail labels get INBOX --json | jq '.messagesUnread'

Extract event IDs from today

提取今日事件的ID

gog calendar events --today --json | jq '.[].id'
gog calendar events --today --json | jq '.[].id'

List file IDs from search

列出搜索结果的文件ID

gog drive search "budget" --json | jq '.[].id'
gog drive search "budget" --json | jq '.[].id'

Process email subjects

处理邮件主题

gog gmail search "is:unread" --json | jq '.[].snippet'
undefined
gog gmail search "is:unread" --json | jq '.[].snippet'
undefined

Best Practices

最佳实践

Efficient Searching

高效搜索

  1. Start narrow, then broaden - Begin with specific queries, add filters if too many results
  2. Use date filters -
    newer_than:
    reduces noise dramatically
  3. Combine operators -
    is:unread from:boss newer_than:7d
    is better than browsing
  4. Use
    --max
    - Limit results when exploring:
    --max=10
  1. 先窄后宽 - 从精准查询开始,如果结果太少再放宽筛选条件
  2. 使用日期过滤器 -
    newer_than:
    可以大幅减少无效结果
  3. 组合运算符 -
    is:unread from:boss newer_than:7d
    比手动浏览高效得多
  4. 使用
    --max
    - 探索查询时限制结果数量:
    --max=10

Calendar Management

日历管理

  1. Always check freebusy before scheduling meetings with others
  2. Use
    --with-meet
    for remote meetings to auto-create video link
  3. Set reminders -
    --reminder="popup:15m"
    for important meetings
  4. Block focus time proactively to protect deep work
  1. 安排会议前务必先查freebusy确认参会人可用时间
  2. 远程会议使用
    --with-meet
    自动生成视频链接
  3. 重要会议设置提醒:
    --reminder="popup:15m"
  4. 主动预留专注时间保障深度工作

Drive Organization

Drive整理

  1. Use folder IDs - Store frequently-used folder IDs for quick access
  2. Search by content -
    fullText contains
    finds docs even if filename is unclear
  3. Filter by MIME type - Narrow to specific doc types
  4. Export early - Download important docs as PDF for offline access
  1. 使用文件夹ID - 保存常用文件夹ID以便快速访问
  2. 按内容搜索 - 即使文件名不明确,
    fullText contains
    也能找到对应文档
  3. 按MIME类型筛选 - 缩小到指定文档类型
  4. 提前导出 - 将重要文档下载为PDF方便离线访问

Automation Tips

自动化技巧

  1. Use
    --json
    for scripting - Parse with jq
  2. Use
    --plain
    for simple scripts - Tab-separated, no colors
  3. Use
    --no-input
    in CI - Prevents hangs on prompts
  4. Store IDs - Calendar, folder, and task list IDs for reuse
  1. 脚本场景使用
    --json
    输出,配合jq解析
  2. 简单脚本使用
    --plain
    输出,无颜色的制表符分隔格式更容易解析
  3. CI场景使用
    --no-input
    避免脚本挂起
  4. 保存常用ID - 日历、文件夹、任务清单ID可重复使用

Reference Files

参考文档

  • Gmail Search Syntax - Complete query operator reference
  • Drive Search Syntax - Complete Drive query reference
  • Calendar Scheduling - Event creation, time formats, RRULE
  • Common Workflows - Extended PA/CoS workflow recipes
  • Gmail搜索语法 - 完整查询运算符参考
  • Drive搜索语法 - 完整Drive查询参考
  • 日历排期 - 事件创建、时间格式、RRULE说明
  • 常用工作流 - 更多PA/CoS工作流方案