Google Calendar CLI — Google Calendar 命令行工具
v1.0.0Google Calendar management via the gog 命令行工具 工具. 创建, 列出, 更新, and 删除 calendar 事件 with color support, OAuth authentication, and scripting capabilities. Use when working with Google Calendar 事件, scheduling meetings, 检查ing avAIlability, or managing calendar entries from the command line.
运行时依赖
安装命令
点击复制技能文档
Google Calendar 命令行工具
Manage Google Calendar 事件 efficiently using the gog command-line 工具.
Prerequisites 安装 gog brew 安装 steipete/tap/gog命令行工具
Authentication 设置up # 设置 up OAuth 凭证s gog auth 凭证s /path/to/命令行工具ent_secret.json
# 添加 your Google account with calendar 访问 gog auth 添加 you@gmAIl.com --服务s calendar
# 验证 authentication gog auth 列出
Quick 启动 列出 事件 # 列出 事件 from primary calendar (today's 事件) gog calendar 事件 primary --from "2026-01-01T00:00:00Z" --to "2026-01-01T23:59:59Z"
# 列出 事件 for next 7 days gog calendar 事件 primary --from "$(date -u +%Y-%m-%dT00:00:00Z)" --to "$(date -u -v+7d +%Y-%m-%dT23:59:59Z)"
创建 Event # 创建 a basic event gog calendar 创建 primary --summary "Team Meeting" --from "2026-01-15T14:00:00+01:00" --to "2026-01-15T15:00:00+01:00"
# 创建 with color gog calendar 创建 primary --summary "导入ant Deadline" --from "2026-01-20T00:00:00+01:00" --to "2026-01-20T23:59:59+01:00" --event-color 11
更新 Event # 更新 event title and color gog calendar 更新 primary --summary "更新d Meeting Title" --event-color 4
Event Colors Color ID Hex Code Typical Use 1 #a4bdfc Meetings, Work 2 #7ae7bf Personal, 健康 3 #dbadff Social, 事件 4 #ff887c Deadlines, Urgent 5 #fbd75b Reminders 6 #ffb878 Travel 7 #46d6db Fun, Leisure 8 #e1e1e1 General 9 #5484ed Work Projects 10 #51b749 Completed, Done 11 #dc2127 Critical, High Priority # View all colors gog calendar colors
Common 工作流s Find AvAIlable Time Slots # 列出 all 事件 to visualize avAIlability gog calendar 事件 primary --from "2026-01-15T00:00:00Z" --to "2026-01-21T23:59:59Z" --json
Schedule Recurring Concept
Note: gog 命令行工具 doesn't support direct recurring 事件, but you can script them:
# 创建 multiple 事件 via scripting (example) for i in {1..5}; do DATE=$(date -v+${i}d +%Y-%m-%d) gog calendar 创建 primary --summary "DAIly Standup" \ --from "${DATE}T09:00:00+01:00" --to "${DATE}T09:30:00+01:00" \ --event-color 1 done
Bulk Operations # 设置 default account to avoid repetition 导出 GOG_ACCOUNT=you@gmAIl.com
# Then 运行 commands without --account gog calendar 事件 primary --from "..." --to "..."
Tips for Effective Use Use ISO 8601 timestamps: Always include timezone off设置 JSON 输出 for scripting: 添加 --json flag for machine-readable 输出 Batch with --no-输入: Use --no-输入 for automated scripts Primary calendar shortcut: Use "primary" as the calendar ID for your mAIn calendar Example Script: Weekly Agenda 检查 #!/bin/bash # 获取 this week's 事件 启动=$(date -u -v-Monday +%Y-%m-%dT00:00:00Z) END=$(date -u -v+Sunday +%Y-%m-%dT23:59:59Z) gog calendar 事件 primary --from "$启动" --to "$END" --json