A command-line tool to manage Google Calendar events. Zero external dependencies — uses only Python 3 standard library.
- Create a Google Cloud project and enable the Google Calendar API.
- Create OAuth 2.0 credentials (Desktop app).
- Complete the OAuth consent flow to obtain a refresh token.
- Export your credentials:
export GOOGLE_CLIENT_ID="your-client-id"
export GOOGLE_CLIENT_SECRET="your-client-secret"
export GOOGLE_REFRESH_TOKEN="your-refresh-token"
export GOOGLE_CALENDAR_ID="primary" # optional, defaults to "primary"Credentials can also be passed as CLI flags (--client-id, --client-secret, --refresh-token, --calendar-id).
python3 scripts/google-calendar-cli.py <command> [options]| Command | Description |
|---|---|
list |
List upcoming events |
today |
Show today's events |
add |
Create a new event |
update |
Update an existing event |
delete |
Delete an event |
# List next 10 events
python3 scripts/google-calendar-cli.py list
# Today's events
python3 scripts/google-calendar-cli.py today
# Events in a date range
python3 scripts/google-calendar-cli.py list --from 2025-06-01T00:00:00Z --to 2025-06-30T23:59:59Z
# Search events
python3 scripts/google-calendar-cli.py list --query "standup"
# Add an event
python3 scripts/google-calendar-cli.py add --title "Meeting" \
--start 2025-06-01T09:00:00+08:00 --end 2025-06-01T10:00:00+08:00
# Add an all-day event
python3 scripts/google-calendar-cli.py add --title "Holiday" \
--start 2025-06-01 --end 2025-06-02
# Update an event
python3 scripts/google-calendar-cli.py update --event-id EVENT_ID --title "New Title"
# Delete an event
python3 scripts/google-calendar-cli.py delete --event-id EVENT_ID
# Raw JSON output
python3 scripts/google-calendar-cli.py --json listRun python3 scripts/google-calendar-cli.py -h for full help.
MIT