--- name: google-calendar description: Accesses the Google Calendar and Tasks API. Use this skill to view or manage calendars, events, schedules, or Google tasks. --- # Google Calendar + Tasks Access ## Quick start - Create a Google Cloud OAuth client (Desktop app) and save the credentials JSON to `~/.config/google-calendar/credentials.json`. - Install dependencies (venv recommended): ```bash python3 -m venv ~/.config/google-calendar/venv ~/.config/google-calendar/venv/bin/pip install -r /scripts/requirements.txt ``` - Authenticate and store a token: - Calendar only: - `/scripts/gcal-auth` - Tasks only: - `/scripts/gcal-auth --scopes https://www.googleapis.com/auth/tasks` - Calendar + Tasks (single token): - `/scripts/gcal-auth --scopes https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/tasks` - Call the API: - `/scripts/gcal list-calendars` ## Credentials and tokens - Credentials are expected at `~/.config/google-calendar/credentials.json` by default. - Tokens are stored at `~/.config/google-calendar/token.json` by default. - Use `--token` or `GCAL_TOKEN_PATH` to switch accounts or isolate environments. ## Date/time rules - Use RFC3339 for timed events (e.g., `2026-01-22T10:00:00-08:00`). - Use `YYYY-MM-DD` for all-day events and set `end` to the next day (exclusive). - Set `--time-zone` when the datetime has no offset. ## Common commands - List calendars: - `/scripts/gcal list-calendars` - List events: - `/scripts/gcal list-events --calendar-id primary --time-min 2026-01-22T00:00:00-08:00 --time-max 2026-01-22T23:59:59-08:00` - Search events: - `/scripts/gcal list-events --calendar-id primary --q "standup" --time-min ... --time-max ...` - Create event (simple): - `/scripts/gcal create-event --calendar-id primary --summary "Review" --start 2026-01-22T10:00:00-08:00 --end 2026-01-22T11:00:00-08:00` - Update event (simple): - `/scripts/gcal update-event --calendar-id primary --event-id --summary "New title"` - Delete event: - `/scripts/gcal delete-event --calendar-id primary --event-id ` - Free/busy: - `/scripts/gcal freebusy --calendars primary,team@company.com --time-min ... --time-max ...` - List task lists: - `/scripts/gcal list-tasklists` - List tasks: - `/scripts/gcal list-tasks --tasklist ` - Create task: - `/scripts/gcal create-task --tasklist --title "Buy milk" --due 2026-01-22T10:00:00-08:00` - Update task: - `/scripts/gcal update-task --tasklist --task-id --notes "Bring receipt"` - Delete task: - `/scripts/gcal delete-task --tasklist --task-id ` ## Advanced usage - Use `call` to hit any Calendar API endpoint: - `/scripts/gcal call GET /users/me/calendarList` - `/scripts/gcal call POST /calendars/primary/events --body-file /path/to/event.json` - Use `--body-file` or `--body` (JSON string) for complex payloads (attendees, recurrence, conferenceData). - Run multiple accounts by using different token files with `--token`. ## Safety - Confirm intent before creating, updating, or deleting events. - Keep OAuth credentials and token files out of git.