返回顶部
g

google-calendar谷歌日历

Interact with Google Calendar via the Google Calendar API – list upcoming events, create new events, update or delete them. Use this skill when you need programmatic access to your calendar from OpenClaw.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 0.1.0
安全检测
已通过
13,389
下载量
免费
免费
11
收藏
概述
安装方式
版本历史

google-calendar

技能名称: google-calendar

Google日历技能

概述

本技能是对Google日历REST API的轻量封装。它允许您:
  • - 列出即将到来的事件(可选择按时间范围或查询条件过滤)
  • 添加新事件,包含标题、开始/结束时间、描述、地点和参与者
  • 通过ID更新现有事件
  • 通过ID删除事件

该技能使用Python实现(scripts/google_calendar.py)。它需要设置以下环境变量(您可以使用openclaw secret set安全存储):

GOOGLECLIENTID=…
GOOGLECLIENTSECRET=…
GOOGLEREFRESHTOKEN=… # 通过OAuth授权后获取
GOOGLECALENDARID=primary # 或特定日历的ID

首次运行该技能时,您可能需要执行OAuth流程以获取刷新令牌——请参阅下方的设置部分。

命令

google-calendar list [--from --to --max ]
google-calendar add --title <标题> [--start --end ]
[--desc <描述> --location <地点> --attendees <邮箱1,邮箱2>]
google-calendar update --event-id [--title <标题> ... 其他字段]
google-calendar delete --event-id

所有命令均将JSON数据输出到标准输出。错误信息输出到标准错误,并导致非零退出码。

设置

  1. 1. 创建Google Cloud项目并启用Google日历API
  2. 创建OAuth凭据(类型选择桌面应用)。记录clientid和clientsecret。
  3. 运行辅助脚本获取刷新令牌:
bash GOOGLECLIENTID=… GOOGLECLIENTSECRET=… python3 -m google_calendar.auth

该脚本将打开浏览器(或打印一个可在他处打开的URL)并请求您授予访问权限。批准后,复制其打印的refresh_token。

  1. 4. 安全存储凭据:

bash
openclaw secret set GOOGLECLIENTID <值>
openclaw secret set GOOGLECLIENTSECRET <值>
openclaw secret set GOOGLEREFRESHTOKEN <值>
openclaw secret set GOOGLECALENDARID primary # 可选

  1. 5. 安装所需的Python包(一次性操作):
bash pip install --user google-auth google-auth-oauthlib google-api-python-client

工作原理(简述)

脚本从环境加载凭据,使用刷新令牌更新访问令牌,构建service = build(calendar, v3, credentials=creds),然后调用相应的API方法。

参考

  • - Google日历API参考:https://developers.google.com/calendar/api/v3/reference
  • 已安装应用的OAuth 2.0:https://developers.google.com/identity/protocols/oauth2/native-app

注意: 本技能无需图形界面;它完全通过HTTP调用工作,因此适用于无头服务器。

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 google-calendar-1776371471 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 google-calendar-1776371471 技能

通过命令行安装

skillhub install google-calendar-1776371471

下载

⬇ 下载 google-calendar v0.1.0(免费)

文件大小: 4.93 KB | 发布时间: 2026-4-17 15:10

v0.1.0 最新 2026-4-17 15:10
- Initial release of the Google Calendar skill.
- Supports listing, creating, updating, and deleting events via the Google Calendar API.
- Command-line interface for all operations, with JSON output and error handling.
- Requires OAuth setup (client ID, secret, refresh token) and environment variable configuration.
- Setup and usage documented, including package dependencies and credential management.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部