Skip to content

Latest commit

 

History

History
133 lines (96 loc) · 3.06 KB

File metadata and controls

133 lines (96 loc) · 3.06 KB

Google Calendar CLI Skill

CLI for Google Calendar API with local sync. Supports multiple Google accounts.

Running

gcal <command>     # Globally linked

Authentication

Requires OAuth2 credentials from Google Cloud Console (Calendar API enabled):

gcal auth setup <client-id> <client-secret>  # One-time setup
gcal auth login                               # Opens browser
gcal auth list                                # List accounts
gcal auth default user@gmail.com              # Set default

Switch accounts with -a <email>:

gcal -a work@company.com events

Quick Reference

List Events

gcal events                        # Upcoming events
gcal events --today                # Today's events
gcal events --week                 # This week's events
gcal events -n 50                  # Limit results
gcal events -c "Work"              # From specific calendar

View Event

gcal event <id>                    # Full event details

Create Events

gcal create --title "Meeting" --start "2024-03-15T10:00:00" --end "2024-03-15T11:00:00"
gcal create --title "Lunch" --start "2024-03-15T12:00:00" --duration 1h
gcal create --title "Sync" --start "2024-03-15T14:00:00" --attendees "a@x.com,b@x.com"

Update Events

gcal update <id> --title "New Title"
gcal update <id> --start "2024-03-15T11:00:00"
gcal update <id> --attendees "a@x.com,b@x.com"

Delete Events

gcal delete <id>                   # Delete event
gcal delete <id> --notify          # Delete and notify attendees

RSVP

gcal rsvp <id> --accept            # Accept invitation
gcal rsvp <id> --decline           # Decline invitation
gcal rsvp <id> --tentative         # Mark as tentative

Calendars

gcal calendars                     # List all calendars

Sync (Local Data Cache)

Sync calendar data to local JSON files for offline access and querying.

gcal sync                          # Incremental sync
gcal sync --full                   # Full sync
gcal sync -a user@gmail.com        # Sync one account
gcal sync -c calendars,events      # Sync specific collections

Sync Status

gcal sync-status                   # List synced accounts
gcal sync-status user@x.com        # Status for account
gcal sync-reset user@x.com         # Reset state

Data Location

~/.local/share/gcal/{email}/
├── profile.json
├── calendars/{id}.json
├── events/{id}.json
└── .sync-state.json

Collections

Collection Description
calendars Calendar list (primary, shared, subscribed)
events Calendar events with all details

See schema.md for full field documentation.

Output Formats

Flag Format Use Case
(default) Markdown Human readable
-f json JSON Parsing, scripting
-f minimal Tab-separated Simple processing

Notes

  • Config: ~/.config/gcal-cli/config.json
  • Sync data: ~/.local/share/gcal/
  • OAuth tokens refresh automatically