Skip to content

fix(calendar): wire -f/-p global options through to calendar subcommands; add --past to events#3

Open
seanlee02001 wants to merge 2 commits into
ianpatrickhines:masterfrom
seanlee02001:master
Open

fix(calendar): wire -f/-p global options through to calendar subcommands; add --past to events#3
seanlee02001 wants to merge 2 commits into
ianpatrickhines:masterfrom
seanlee02001:master

Conversation

@seanlee02001

Copy link
Copy Markdown

Problem

calendar.ts's list/events/search actions read options.format / options.profile from the local subcommand options instead of command.parent?.optsWithGlobals() (the pattern gmail.ts already uses correctly). As a result, -f json and an explicit -p <profile> were silently ignored for the whole calendar subtree — always falling back to table output and the config's default profile. Anyone scripting against gwcli calendar -p work -f json was silently querying the wrong account.

Fix

  • Calendar read subcommands now resolve format/profile via optsWithGlobals(), matching gmail.
  • Adds an additive --past flag to calendar events: listEvents/search hardcode timeMin=now, and Google's API filters timeMin on an event's END time, so a fully-ended event was permanently unlistable via any existing subcommand. --past flips the query window to [now-days, now]; default forward-looking behavior is unchanged for existing callers.

Also syncs package-lock.json's name field with the earlier package rename (separate commit).

Found while wiring gwcli into an automated daily calendar-ingestion job; both fixes are running in production on my fork.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RxX9wGuESwVBwxgvWhcjvp

seanlee02001 and others added 2 commits July 13, 2026 01:42
… to events

calendar.ts's list/events/search actions read options.format/options.profile
from the local subcommand options instead of command.parent?.optsWithGlobals()
(the pattern gmail.ts already uses correctly) — so -f json and an explicit
-p <profile> were both silently ignored for the whole calendar subtree,
always falling back to table output and the config's default profile.

Also adds an additive --past flag to 'calendar events': listEvents/search
hardcode timeMin=now, and Google's API filters timeMin on an event's END
time, so a fully-ended event was permanently unlistable via any existing
subcommand. --past flips the query window to [now-days, now]; default
(forward-looking) behavior is unchanged for existing callers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant