fix: follow-up fixes for google-workspace gws migration

- Fix npm package name: @anthropic -> @googleworkspace/cli
- Add Homebrew install option
- Fix calendar_list to respect --start/--end args (uses raw Calendar
  API for date ranges, +agenda helper for default 7-day view)
- Improve check_auth partial scope output (list missing scopes)
- Add output format documentation with key JSON shapes
- Use npm install in troubleshooting (no Rust toolchain needed)

Follow-up to cherry-picked PR #6713
This commit is contained in:
Teknium
2026-04-09 12:54:12 -07:00
committed by Teknium
parent 127b4caf0d
commit 73eb59db8d
3 changed files with 47 additions and 13 deletions

View File

@@ -80,15 +80,30 @@ def gmail_modify(args):
# -- Calendar --
def calendar_list(args):
cmd = ["calendar", "+agenda", "--format", "json"]
if args.start and args.end:
# Calculate days between start and end for --days flag
cmd += ["--days", "7"]
if args.start or args.end:
# Specific date range — use raw Calendar API for precise timeMin/timeMax
from datetime import datetime, timedelta, timezone as tz
now = datetime.now(tz.utc)
time_min = args.start or now.isoformat()
time_max = args.end or (now + timedelta(days=7)).isoformat()
gws(
"calendar", "events", "list",
"--params", json.dumps({
"calendarId": args.calendar,
"timeMin": time_min,
"timeMax": time_max,
"maxResults": args.max,
"singleEvents": True,
"orderBy": "startTime",
}),
"--format", "json",
)
else:
cmd += ["--days", "7"]
if args.calendar != "primary":
cmd += ["--calendar", args.calendar]
gws(*cmd)
# No date range — use +agenda helper (defaults to 7 days)
cmd = ["calendar", "+agenda", "--days", "7", "--format", "json"]
if args.calendar != "primary":
cmd += ["--calendar", args.calendar]
gws(*cmd)
def calendar_create(args):
cmd = [