用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Sheldenshi/gini-agent --skill google-calendar命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | google-calendar |
| description | Google Calendar via gws: list events, create, accept, find free time. |
| license | MIT |
| compatibility | macOS and Linux. Requires the `gws` CLI authenticated against a Google account with Calendar scopes. |
| metadata | {"gini":{"version":"1.1.2","author":"Gini","platforms":["macos","linux"],"prerequisites":{"commands":["gws"],"env":["GOOGLE_WORKSPACE_CLI_CLIENT_ID","GOOGLE_WORKSPACE_CLI_CLIENT_SECRET"]},"requires":{"credentials":["google-workspace-oauth"]}}} |
Use gws calendar to list events, create and update events, look up free/busy windows, and manage calendar ACLs. The CLI wraps the Calendar v3 API and produces structured JSON.
gws installed and authenticated. If gws is not on PATH OR gws auth status reports no authenticated user, do NOT silently call setup. Instead, in a single short reply to the user:
read_skillgoogle-workspace-setupgws calendar ... call fails mid-task with command not found / ENOENT, HTTP 401, "no credentials", or "scope required". Don't report the failure as a dead end — surface the missing prerequisite and ask if the user wants to set it up before moving on.calendar.readonlycalendar.events (or full calendar)calendarThe connected Google accounts (each with its tag, email, and config dir) are listed in your system context under "Connected Google accounts". To target a specific account, prefix the command with its config dir:
GOOGLE_WORKSPACE_CLI_CONFIG_DIR="<configDir>" gws calendar events list
Selection rule: one account connected → just use it. Two or more:
gws call per config dir) and aggregate, labeling each result by its tag and email. Don't pick just one, and don't ask — the user wants the whole picture across accounts.If no accounts are connected yet, fall back to the setup flow in Prerequisites (read_skill with google-workspace-setup).
apple-reminders for time-bound to-dos, not Calendar events.apple-notes or obsidian.google-docs for the doc and attach it to the event with a Drive link.The Calendar surface is the auto-generated v3 API (gws calendar events list, gws calendar events insert, gws calendar freebusy query, …) plus two curated helpers: +agenda for digests and +insert for creating events without hand-rolling the JSON body.
gws calendar +agenda # next ~7 days, all calendars
gws calendar +agenda --today
gws calendar +agenda --tomorrow
gws calendar +agenda --week --format table
gws calendar +agenda --days 14
gws calendar +agenda --today --calendar 'Work'
gws calendar +agenda --today --timezone America/New_York
+agenda is read-only and uses the user's Google account timezone by default. Override with --timezone <IANA> when the user is travelling.
gws calendar +insert \
--summary 'Standup' \
--start '2026-06-17T09:00:00-07:00' \
--end '2026-06-17T09:30:00-07:00'
# With attendees + Meet link
gws calendar +insert \
--summary 'Design review' \
--start '2026-06-17T14:00:00-07:00' \
--end '2026-06-17T15:00:00-07:00' \
--attendee alice@example.com \
--attendee bob@example.com \
--meet \
--location 'Room 4' \
--description 'Walk through the v2 mocks.'
Times are RFC 3339 / ISO 8601. Always include the offset (-07:00, +02:00, Z) — naked local times round-trip incorrectly across DST.
For natural-language event creation, the API surface also offers events.quickAdd:
gws calendar events quickAdd \
--params '{"calendarId":"primary","text":"Coffee with Pat tomorrow 3pm-3:30pm"}'
gws calendar events list \
--params '{"calendarId":"primary","timeMin":"2026-06-17T00:00:00Z","timeMax":"2026-06-18T00:00:00Z","singleEvents":true,"orderBy":"startTime"}'
gws calendar events get \
--params '{"calendarId":"primary","eventId":"<EVENT_ID>"}'
gws calendar events patch \
--params '{"calendarId":"primary","eventId":"<EVENT_ID>"}' \
--json '{"location":"Room 5"}'
gws calendar events delete \
--params '{"calendarId":"primary","eventId":"<EVENT_ID>"}'
Google does not expose a dedicated RSVP method — you respond by patching the event and updating the current user's entry in the attendees array. That means the agent needs three things first: the eventId, the user's own email address (so it can find its attendee entry), and the full existing attendees array (so the patch can preserve everyone else).
# 1. Look up the signed-in user's email — `gws auth status` returns
# structured JSON; the email lives at the top-level `.user` key.
# Strip stderr first (`2>/dev/null`) so the `Using keyring backend`
# preamble doesn't contaminate the JSON; never use `2>&1`.
gws auth status 2>/dev/null | jq -r '.user'
# 2. Fetch the event to read the existing attendees array.
gws calendar events get \
--params '{"calendarId":"primary","eventId":"<EVENT_ID>"}'
# 3. Patch the event with the full attendees array, flipping just the
# current user's responseStatus to accepted | declined | tentative.
gws calendar events patch \
--params '{"calendarId":"primary","eventId":"<EVENT_ID>","sendUpdates":"all"}' \
--json '{
"attendees": [
{"email":"alice@example.com"},
{"email":"bob@example.com"},
{"email":"me@example.com","responseStatus":"accepted"}
]
}'
Set sendUpdates to "all" (notify everyone), "externalOnly", or "none" based on what the user wants. RSVP changes always notify the organizer when sendUpdates is "all".
gws calendar freebusy query --json '{
"timeMin": "2026-06-17T09:00:00-07:00",
"timeMax": "2026-06-17T18:00:00-07:00",
"items": [{"id":"primary"},{"id":"alice@example.com"}]
}'
The response lists busy windows per calendar; free time is the complement within [timeMin, timeMax].
gws calendar calendarList list
gws calendar calendars insert --json '{"summary":"Side project"}'
gws calendar acl list --params '{"calendarId":"primary"}'
gws calendar acl insert --params '{"calendarId":"primary"}' \
--json '{"role":"reader","scope":{"type":"user","value":"alice@example.com"}}'
apple-reminders. For agent-internal alerts ("remind me in 2 hours"), use the cronjob tool. Confirm intent before deciding which.events.insert, events.patch, events.delete, or +insert. The runtime's terminal_exec approval gate is the user's safety net — if gws * isn't auto-approved they'll see the gate per-command; if it is, they've opted in to "just do it." When the user's command is clear ("remove dinner," "decline the 2pm"), execute. Do ask one clarifying question when the command is ambiguous — multiple events match the description, the user didn't specify which calendar, or sendUpdates would email attendees the user might not want notified.gws auth status 2>/dev/null | jq -r '.user' (or read it from the event's attendees array) so the patch updates the right attendee, and re-send the full attendees array so other invitees aren't dropped. RSVP changes email-notify the organizer when sendUpdates is "all".+insert and events.insert. Naked local times silently drift across DST boundaries.+insert over hand-rolling events.insert --json when the user just wants a normal event. The helper sets sane defaults (visibility, reminders) without forcing the agent to learn the full body schema.--meet to +insert creates a Google Meet space attached to the event — this is the simplest way to give the user a join link. Do not separately call google-meet to create a standalone space when an event will exist anyway.singleEvents:true and orderBy:"startTime" so recurring events expand into individual instances and arrive in chronological order. Without those, the response is grouped by recurrence master and confusing to summarize.events.list calls when the user only needs availability, not event content.+agenda defaults to the Google account timezone; only override with --timezone when the user is travelling.For flags not shown here, run gws calendar --help or gws calendar <verb> --help (e.g. gws calendar +insert --help).