A single-file CLI that exposes your Google Calendar to AI coding agents (or just your terminal) via the private iCal URL — no MCP, no OAuth, no CLI auth dance.
Install the script and a config template with one command:
curl -fsSL https://gist.githubusercontent.com/parasquid/a5e6cfe1e6d8d5864bf7cd2b21bf4d4a/raw/install.sh | shThen edit ~/.local/bin/.env to add your Google Calendar Secret iCal URL, and run:
calendar-todayRequires uv and curl. ~/.local/bin must be on your PATH. The installer checks both and tells you if either is missing.
Don't want to pipe remote scripts into your shell? Manual install:
# 1. Install the script
mkdir -p ~/.local/bin
curl -fsSL https://gist.githubusercontent.com/parasquid/a5e6cfe1e6d8d5864bf7cd2b21bf4d4a/raw/calendar-today -o ~/.local/bin/calendar-today
chmod +x ~/.local/bin/calendar-today
# 2. Create the config
cat > ~/.local/bin/.env <<'EOF'
CALENDAR_ICS_URL=
EOF
chmod 600 ~/.local/bin/.env
# 3. Edit ~/.local/bin/.env and set CALENDAR_ICS_URL to your Secret iCal URLMost ways of giving an AI coding agent access to your calendar are heavy:
- MCP Google Calendar servers — install, configure, OAuth, permission prompts.
- CLIs like
gcalcli/gws— OAuth flow, scope management, token refresh. - Google Calendar API directly — service accounts, credentials, SDK.
For the narrow use case of "let my AI agent see my own calendar so it can help me organize my day," all of that is overkill. Google Calendar exposes a private iCal URL per user — a single secret URL that returns the calendar as .ics. That's enough.
This script:
- Reads the private iCal URL from a colocated
.envfile. - Fetches the feed with
curl. - Parses with
icalendar(installed on the fly viauv— no virtualenv to manage). - Expands recurring events correctly — RRULE + EXDATE +
RECURRENCE-IDoverrides. An event moved from 14:00 to 13:30 shows at 13:30, not both. - Prints a clean, grep-friendly list to stdout.
AI agents (Claude Code, Cursor, Aider, etc.) can now run calendar-today as a normal command and see your schedule. No tokens, no refresh, no MCP.
- "What's on my calendar today?" → agent runs
calendar-today. - "Help me plan tomorrow" →
calendar-today --date 2026-04-20. - "Summarize my week" →
calendar-today --week. - Timesheet generation — agent reads your calendar, drafts FreshBooks / Toggl / Harvest entries.
- Meeting prep — agent scans events and drafts notes or agendas.
- Open Google Calendar.
- Click the gear icon → Settings.
- Under "Settings for my calendars," click the calendar you want to expose.
- Scroll to Integrate calendar.
- Copy the Secret address in iCal format.
⚠️ This URL is a credential. Anyone with it can read your calendar. Don't paste it into chat, issue trackers, or git. If you leak it, click Reset in the same section to invalidate it.
calendar-today # today
calendar-today --date 2026-04-20 # specific day
calendar-today --days 3 # next 3 days starting today
calendar-today --week # next 7 days
Example output:
Friday 2026-04-17
09:00–09:30 Morning stand-up
13:30–14:00 Delivery Stand Up
14:00–15:30 Investment Time: How I AI @ Office
For Claude Code, add this to ~/.claude/CLAUDE.md (global) or .claude/CLAUDE.md (project):
## Calendar access
Run `calendar-today` to see my schedule. Flags: `--date YYYY-MM-DD`, `--days N`, `--week`.
The script reads my private iCal URL from `~/.local/bin/.env`. Don't echo its contents back.Other agents — point their instruction file at the same command.
- The Secret iCal URL is read-only and scoped to a single calendar. It cannot modify your calendar or access other Google services.
- Treat it like a password.
chmod 600on the.env. Don't commit it. - Some work/school Google accounts disable the Secret Address feature — your admin can turn it off.
- The script has no telemetry, no network traffic beyond the single fetch to
calendar.google.com, and no third-party services.
The script uses PEP 723 inline script metadata — dependencies (icalendar, python-dateutil) are declared at the top of the file. uv run reads that, downloads to a cache, and reuses on subsequent runs. No requirements.txt, no virtualenv, no pip install. Delete the script and the cache cleans itself up.
AGPL-3.0-or-later. Share improvements.