CLI for Google Calendar API with local sync. Supports multiple Google accounts.
gcal <command> # Globally linkedRequires 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 defaultSwitch accounts with -a <email>:
gcal -a work@company.com eventsgcal 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 calendargcal event <id> # Full event detailsgcal 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"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"gcal delete <id> # Delete event
gcal delete <id> --notify # Delete and notify attendeesgcal rsvp <id> --accept # Accept invitation
gcal rsvp <id> --decline # Decline invitation
gcal rsvp <id> --tentative # Mark as tentativegcal calendars # List all calendarsSync 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 collectionsgcal sync-status # List synced accounts
gcal sync-status user@x.com # Status for account
gcal sync-reset user@x.com # Reset state~/.local/share/gcal/{email}/
├── profile.json
├── calendars/{id}.json
├── events/{id}.json
└── .sync-state.json
| Collection | Description |
|---|---|
| calendars | Calendar list (primary, shared, subscribed) |
| events | Calendar events with all details |
See schema.md for full field documentation.
| Flag | Format | Use Case |
|---|---|---|
| (default) | Markdown | Human readable |
-f json |
JSON | Parsing, scripting |
-f minimal |
Tab-separated | Simple processing |
- Config:
~/.config/gcal-cli/config.json - Sync data:
~/.local/share/gcal/ - OAuth tokens refresh automatically