自动化32k · #9165
gws-events
它能做什么
这个工具可以帮你管理 Google Workspace 的事件通知。你可以创建、查看、更新或删除订阅,以便在你的账户中发生事情时收到提醒。
适用场景
- ✓当你想在收到新 Gmail 邮件时收到通知。
- ✓想知道 Google Drive 中的文件何时被修改时。
- ✓想及时收到 Google 日历事件提醒时。
技能链接
https://github.com/googleworkspace/cli/blob/main/skills/gws-events/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
请用这个技能帮我:https://github.com/googleworkspace/cli/blob/main/skills/gws-events/SKILL.md
阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
npx skills add googleworkspace/cli --skill gws-events
下载 SKILL.md,放进智能体的技能文件夹。
curl -L https://raw.githubusercontent.com/googleworkspace/cli/main/skills/gws-events/SKILL.md -o SKILL.md
可以这样问 AI
“每当我的主收件箱收到新邮件时,都通知我。”
每周 5 个新技能,1 分钟读完。
工作原理
你指定想要追踪的事件类型(比如新消息),工具就会设置 Google Workspace,把相关信息发送给你。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
events (v1)
PREREQUISITE: Read
../gws-shared/SKILL.mdfor auth, global flags, and security rules. If missing, rungws generate-skillsto create it.
gws events <resource> <method> [flags]
Helper Commands
| Command | Description |
|---|---|
+subscribe |
Subscribe to Workspace events and stream them as NDJSON |
+renew |
Renew/reactivate Workspace Events subscriptions |
API Resources
message
stream— SendStreamingMessage is a streaming call that will return a stream of task update events until the Task is in an interrupted or terminal state.
operations
get— Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
subscriptions
create— Creates a Google Workspace subscription. To learn how to use this method, see Create a Google Workspace subscription.delete— Deletes a Google Workspace subscription. To learn how to use this method, see Delete a Google Workspace subscription.get— Gets details about a Google Workspace subscription. To learn how to use this method, see Get details about a Google Workspace subscription.list— Lists Google Workspace subscriptions. To learn how to use this method, see List Google Workspace subscriptions.patch— Updates or renews a Google Workspace subscription. To learn how to use this method, see Update or renew a Google Workspace subscription.reactivate— Reactivates a suspended Google Workspace subscription. This method resets your subscription'sStatefield toACTIVE. Before you use this method, you must fix the error that suspended the subscription. This method will ignore or reject any subscription that isn't currently in a suspended state. To learn how to use this method, see Reactivate a Google Workspace subscription.
tasks
cancel— Cancel a task from the agent. If supported one should expect no more task updates for the task.get— Get the current state of a task from the agent.subscribe— TaskSubscription is a streaming call that will return a stream of task update events. This attaches the stream to an existing in process task. If the task is complete the stream will return the completed task (like GetTask) and close the stream.pushNotificationConfigs— Operations on the 'pushNotificationConfigs' resource
Discovering Commands
Before calling any API method, inspect it:
# Browse resources and methods
gws events --help
# Inspect a method's required params, types, and defaults
gws schema events.<resource>.<method>
Use gws schema output to build your --params and --json flags.
常见问题
什么是“订阅”?
订阅就像一份约定,让 Google Workspace 在特定情况发生时提醒你。
我可以选择接收哪些事件吗?
可以,你可以指定自己感兴趣的事件类型。
怎么知道我的通知是否正常工作?
你可以查看订阅的状态,确认它们是否处于激活状态并正在接收事件。
详情
热度
- GitHub 星标
- 32k
- 排名
- #9165
- 许可证
- Apache-2.0
- 更新时间
- 2026/10/6
评论
- …