google-calendar
View and manage Google Calendar events. Check today's schedule, upcoming meetings, and calendar availability.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Google Calendar Integration
This skill provides access to Google Calendar via the Google Calendar API.
Setup Required
Uses OAuth with persistent refresh token (same setup for Calendar, Gmail, Drive).
One-time setup:
google-oauth-setup <path-to-client-secret.json>
See claude/skills/SETUP.md for detailed OAuth setup instructions.
Get Access Token (auto-refreshes):
ACCESS_TOKEN=$(google-oauth-token)
Required header for all requests:
-H "x-goog-user-project: ${GOOGLE_QUOTA_PROJECT}"
When to Use
Use this skill when the user:
- Asks about their calendar or schedule
- Wants to see today's or upcoming meetings
- Asks "what's on my calendar?"
- Needs to check availability
- Mentions meetings or events
API Endpoints
Base URL: https://www.googleapis.com/calendar/v3
List Calendars
curl -s "https://www.googleapis.com/calendar/v3/users/me/calendarList" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" | jq '.items[] | {summary, id}'
Get Events
Today's Events:
TODAY=$(date -u +"%Y-%m-%dT00:00:00Z")
TOMORROW=$(date -v+1d -u +"%Y-%m-%dT00:00:00Z")
curl -s -G "https://www.googleapis.com/calendar/v3/calendars/primary/events" \
--data-urlencode "timeMin=${TODAY}" \
--data-urlencode "timeMax=${TOMORROW}" \
--data-urlencode "singleEvents=true" \
--data-urlencode "orderBy=startTime" \
-H "Authorization: Bearer ${ACCESS_TOKEN}"
Next 7 Days:
NOW=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
WEEK=$(date -v+7d -u +"%Y-%m-%dT%H:%M:%SZ")
curl -s -G "https://www.googleapis.com/calendar/v3/calendars/primary/events" \
--data-urlencode "timeMin=${NOW}" \
--data-urlencode "timeMax=${WEEK}" \
--data-urlencode "singleEvents=true" \
--data-urlencode "orderBy=startTime" \
--data-urlencode "maxResults=20" \
-H "Authorization: Bearer ${ACCESS_TOKEN}"
Specific Date Range:
curl -s -G "https://www.googleapis.com/calendar/v3/calendars/primary/events" \
--data-urlencode "timeMin=2024-01-15T00:00:00Z" \
--data-urlencode "timeMax=2024-01-22T00:00:00Z" \
--data-urlencode "singleEvents=true" \
--data-urlencode "orderBy=startTime" \
-H "Authorization: Bearer ${ACCESS_TOKEN}"
Search Events
curl -s -G "https://www.googleapis.com/calendar/v3/calendars/primary/events" \
--data-urlencode "q=standup" \
--data-urlencode "singleEvents=true" \
--data-urlencode "orderBy=startTime" \
--data-urlencode "maxResults=10" \
-H "Authorization: Bearer ${ACCESS_TOKEN}"
Get Single Event
curl -s "https://www.googleapis.com/calendar/v3/calendars/primary/events/{EVENT_ID}" \
-H "Authorization: Bearer ${ACCESS_TOKEN}"
Free/Busy Query
curl -s -X POST "https://www.googleapis.com/calendar/v3/freeBusy" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"timeMin": "2024-01-15T00:00:00Z",
"timeMax": "2024-01-16T00:00:00Z",
"items": [{"id": "primary"}]
}'
Common Workflows
What's on my calendar today?
ACCESS_TOKEN=$(google-oauth-token)
TODAY=$(date -u +"%Y-%m-%dT00:00:00Z")
TOMORROW=$(date -v+1d -u +"%Y-%m-%dT00:00:00Z")
curl -s -G "https://www.googleapis.com/calendar/v3/calendars/primary/events" \
--data-urlencode "timeMin=${TODAY}" \
--data-urlencode "timeMax=${TOMORROW}" \
--data-urlencode "singleEvents=true" \
--data-urlencode "orderBy=startTime" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" | jq '.items[] | {
summary,
start: (.start.dateTime // .start.date),
end: (.end.dateTime // .end.date),
location
}'
What meetings do I have this week?
NOW=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
WEEK=$(date -v+7d -u +"%Y-%m-%dT%H:%M:%SZ")
curl -s -G "https://www.googleapis.com/calendar/v3/calendars/primary/events" \
--data-urlencode "timeMin=${NOW}" \
--data-urlencode "timeMax=${WEEK}" \
--data-urlencode "singleEvents=true" \
--data-urlencode "orderBy=startTime" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" | jq '.items[] | {
summary,
start: (.start.dateTime // .start.date),
attendees: [.attendees[]?.email] | join(", ")
}'
When is my next meeting?
NOW=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
curl -s -G "https://www.googleapis.com/calendar/v3/calendars/primary/events" \
--data-urlencode "timeMin=${NOW}" \
--data-urlencode "singleEvents=true" \
--data-urlencode "orderBy=startTime" \
--data-urlencode "maxResults=1" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" | jq '.items[0] | {summary, start: .start.dateTime}'
Find a specific meeting
curl -s -G "https://www.googleapis.com/calendar/v3/calendars/primary/events" \
--data-urlencode "q=1:1" \
--data-urlencode "singleEvents=true" \
--data-urlencode "orderBy=startTime" \
--data-urlencode "maxResults=5" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" | jq '.items[] | {summary, start: .start.dateTime}'
Event Properties
Key fields in event responses:
- summary: Event title
- start.dateTime / start.date: Start time (dateTime for timed events, date for all-day)
- end.dateTime / end.date: End time
- location: Meeting location or video link
- description: Event description
- attendees: Array of attendee objects with email, responseStatus
- hangoutLink: Google Meet link if present
- htmlLink: Link to view event in Google Calendar
Parameters
| Parameter | Description |
|---|---|
timeMin |
Lower bound (exclusive) for event end time (RFC3339) |
timeMax |
Upper bound (exclusive) for event start time (RFC3339) |
singleEvents |
Expand recurring events into instances (set to true) |
orderBy |
startTime (requires singleEvents=true) or updated |
maxResults |
Max events to return (default 250) |
q |
Free text search terms |
Notes
- Times must be in RFC3339 format (e.g.,
2024-01-15T09:00:00Zor with timezone offset) - Use
singleEvents=trueto expand recurring events -
primaryrefers to the user's primary calendar; use calendar ID for others - Access tokens expire after 1 hour; refresh as needed
- All-day events use
start.dateinstead ofstart.dateTime
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-26
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!