Skip to content

feat(calendar): add calendar aliases#104

Open
zacharytamas wants to merge 7 commits intosteipete:mainfrom
zacharytamas:calendar-alias
Open

feat(calendar): add calendar aliases#104
zacharytamas wants to merge 7 commits intosteipete:mainfrom
zacharytamas:calendar-alias

Conversation

@zacharytamas
Copy link

Summary

  • Add support for calendar aliases, allowing users to map friendly names like family to full calendar IDs like 3656f8abc123@group.calendar.google.com
  • New CLI commands: gog calendar alias {list,set,unset}
  • All calendar commands now resolve aliases before using calendar IDs

Usage

# Set an alias
gog calendar alias set family 3656f8abc123@group.calendar.google.com

# Use the alias in any calendar command
gog calendar create family --summary "Dinner" --from "2026-01-24T18:00:00Z" --to "2026-01-24T20:00:00Z"
gog calendar events family --today
gog calendar search "birthday" --calendar family

# Aliases work in comma-separated lists too
gog calendar freebusy family,work --from "..." --to "..."

# List and remove aliases
gog calendar alias list
gog calendar alias unset family

Config

Aliases are stored in ~/.config/gog/config.json:

{
  "calendar_aliases": {
    "family": "3656f8abc123@group.calendar.google.com"
  }
}

Test plan

  • Unit tests for config CRUD operations
  • Unit tests for CLI commands
  • Unit tests for alias resolution helper
  • All existing tests pass

Add support for storing calendar aliases in config.json, following the
same pattern as account aliases. Includes CRUD functions and tests.
Add gog calendar alias {list,set,unset} commands for managing calendar
aliases. These allow mapping friendly names like 'family' to full
calendar IDs like '3656f8abc123@group.calendar.google.com'.
Add resolveCalendarID helper function and register CalendarAliasCmd
in the calendar command tree.
Update CalendarCreateCmd, CalendarUpdateCmd, CalendarDeleteCmd,
CalendarProposeTimeCmd, and CalendarRespondCmd to resolve calendar
aliases before using the calendar ID.
Update focus-time, out-of-office, working-location, and time commands
to resolve calendar aliases.
Update search, freebusy, and conflicts commands to resolve calendar
aliases. Multi-calendar commands now resolve each calendar ID in the
comma-separated list.
@salmonumbrella
Copy link
Contributor

Great addition. Thanks @zacharytamas

@visionik
Copy link
Collaborator

Hi Zachary -

Great idea.

Two things:

  1. Your PR has a CI failure check (see above). Can you fix and update?

  2. I am trying to decide if we should merge this as is, or create a more holistic alias system so you can use aliases anywhere in gog. For eample

gog docs family-history sed ...

Thoughts?

@visionik
Copy link
Collaborator

visionik commented Mar 2, 2026

@zacharytamas still out there? Would like to get the CI checkes cleared and wonder if you have thoughts on global sogcli alias support.

@salmonumbrella
Copy link
Contributor

salmonumbrella commented Mar 3, 2026

Opened a continuation PR because this branch cannot be updated from my account and CI needed cleanup: #393

This keeps the same feature scope and passes current CI locally (make ci).

Tagging for visibility: @zacharytamas @visionik

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.

3 participants