From 48310bf6093add5f706b20fdf6a08e610b82e55b Mon Sep 17 00:00:00 2001 From: Alex Hillman Date: Mon, 16 Mar 2026 20:09:41 -0400 Subject: [PATCH 1/2] feat(calendar): add create-calendar command Create new secondary Google Calendars via the API. Usage: gog calendar create-calendar "My Calendar" --timezone America/New_York Supports --description, --timezone, --location flags. Outputs calendar ID and summary in both text and JSON modes. Includes dry-run support. Co-Authored-By: Claude Opus 4.6 (1M context) --- internal/cmd/calendar.go | 1 + internal/cmd/calendar_create_calendar.go | 70 ++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 internal/cmd/calendar_create_calendar.go diff --git a/internal/cmd/calendar.go b/internal/cmd/calendar.go index f51bb227..86d896d7 100644 --- a/internal/cmd/calendar.go +++ b/internal/cmd/calendar.go @@ -3,6 +3,7 @@ package cmd type CalendarCmd struct { Calendars CalendarCalendarsCmd `cmd:"" name:"calendars" help:"List calendars"` Subscribe CalendarSubscribeCmd `cmd:"" name:"subscribe" aliases:"sub,add-calendar" help:"Add a calendar to your calendar list"` + CreateCalendar CalendarCreateCalendarCmd `cmd:"" name:"create-calendar" aliases:"new-calendar" help:"Create a new secondary calendar"` ACL CalendarAclCmd `cmd:"" name:"acl" aliases:"permissions,perms" help:"List calendar ACL"` Alias CalendarAliasCmd `cmd:"" name:"alias" help:"Manage calendar aliases"` Events CalendarEventsCmd `cmd:"" name:"events" aliases:"list,ls" help:"List events from a calendar or all calendars"` diff --git a/internal/cmd/calendar_create_calendar.go b/internal/cmd/calendar_create_calendar.go new file mode 100644 index 00000000..6c27ca95 --- /dev/null +++ b/internal/cmd/calendar_create_calendar.go @@ -0,0 +1,70 @@ +package cmd + +import ( + "context" + "fmt" + "os" + "strings" + + "google.golang.org/api/calendar/v3" + + "github.com/steipete/gogcli/internal/outfmt" + "github.com/steipete/gogcli/internal/ui" +) + +type CalendarCreateCalendarCmd struct { + Summary string `arg:"" name:"summary" help:"Calendar display name"` + Description string `name:"description" help:"Calendar description"` + TimeZone string `name:"timezone" aliases:"tz" help:"IANA timezone (e.g., America/New_York)"` + Location string `name:"location" help:"Calendar location"` +} + +func (c *CalendarCreateCalendarCmd) Run(ctx context.Context, flags *RootFlags) error { + u := ui.FromContext(ctx) + summary := strings.TrimSpace(c.Summary) + if summary == "" { + return usage("required: calendar name (positional argument)") + } + + account, err := requireAccount(flags) + if err != nil { + return err + } + + svc, err := newCalendarService(ctx, account) + if err != nil { + return err + } + + cal := &calendar.Calendar{ + Summary: summary, + Description: strings.TrimSpace(c.Description), + TimeZone: strings.TrimSpace(c.TimeZone), + Location: strings.TrimSpace(c.Location), + } + + if dryRunErr := dryRunExit(ctx, flags, "calendar.create-calendar", map[string]any{ + "calendar": cal, + }); dryRunErr != nil { + return dryRunErr + } + + created, err := svc.Calendars.Insert(cal).Context(ctx).Do() + if err != nil { + return fmt.Errorf("create calendar: %w", err) + } + + if outfmt.IsJSON(ctx) { + return outfmt.WriteJSON(ctx, os.Stdout, map[string]any{"calendar": created}) + } + + u.Out().Printf("id\t%s", created.Id) + u.Out().Printf("summary\t%s", created.Summary) + if created.TimeZone != "" { + u.Out().Printf("timezone\t%s", created.TimeZone) + } + if created.Description != "" { + u.Out().Printf("description\t%s", created.Description) + } + return nil +} From c9f2e83f2e60a3cd6506610ea18a5bdd80c9713c Mon Sep 17 00:00:00 2001 From: Alex Hillman Date: Fri, 20 Mar 2026 21:09:57 -0400 Subject: [PATCH 2/2] Add byline commit classification cache Co-Authored-By: Claude Opus 4.6 (1M context) --- .byline/commits/46bb78b2c.json | 268 +++++++++++++++++++++++++++++++++ .byline/commits/48310bf60.json | 62 ++++++++ .byline/commits/5b0322b81.json | 44 ++++++ .byline/commits/7527b2615.json | 62 ++++++++ 4 files changed, 436 insertions(+) create mode 100644 .byline/commits/46bb78b2c.json create mode 100644 .byline/commits/48310bf60.json create mode 100644 .byline/commits/5b0322b81.json create mode 100644 .byline/commits/7527b2615.json diff --git a/.byline/commits/46bb78b2c.json b/.byline/commits/46bb78b2c.json new file mode 100644 index 00000000..5a7318ae --- /dev/null +++ b/.byline/commits/46bb78b2c.json @@ -0,0 +1,268 @@ +{ + "sha": "46bb78b2c28a27100d293f64cd02fccf86d1bba7", + "shortSha": "46bb78b2c", + "parentSha": "4b06fabb4c62551be5eb72b4624f95e84cdac2fd", + "timestamp": "2026-03-11T20:03:52-04:00", + "message": "feat(sheets): add tab management commands (add-tab, rename-tab, delete-tab)", + "files": { + "internal/cmd/sheets.go": { + "path": "internal/cmd/sheets.go", + "summary": { + "mine": 66, + "machine": 0, + "ours": 0 + }, + "segments": [ + { + "line": 48, + "colStart": 60, + "colEnd": 80, + "category": "mine", + "source": "Human edit" + }, + { + "line": 49, + "colStart": 63, + "colEnd": 86, + "category": "mine", + "source": "Human edit" + }, + { + "line": 50, + "colStart": 63, + "colEnd": 86, + "category": "mine", + "source": "Human edit" + } + ] + }, + "internal/cmd/sheets_tab.go": { + "path": "internal/cmd/sheets_tab.go", + "summary": { + "mine": 0, + "machine": 704, + "ours": 0 + }, + "segments": [ + { + "line": 4, + "colStart": 0, + "colEnd": 0, + "category": "machine", + "source": "Write tool call" + }, + { + "line": 17, + "colStart": 0, + "colEnd": 0, + "category": "machine", + "source": "Write tool call" + }, + { + "line": 32, + "colStart": 1, + "colEnd": 17, + "category": "machine", + "source": "Write tool call" + }, + { + "line": 35, + "colStart": 2, + "colEnd": 65, + "category": "machine", + "source": "Write tool call" + }, + { + "line": 53, + "colStart": 0, + "colEnd": 0, + "category": "machine", + "source": "Write tool call" + }, + { + "line": 65, + "colStart": 17, + "colEnd": 22, + "category": "machine", + "source": "Write tool call" + }, + { + "line": 76, + "colStart": 5, + "colEnd": 16, + "category": "machine", + "source": "Write tool call" + }, + { + "line": 80, + "colStart": 2, + "colEnd": 5, + "category": "machine", + "source": "Write tool call" + }, + { + "line": 80, + "colStart": 42, + "colEnd": 23, + "category": "machine", + "source": "Write tool call" + }, + { + "line": 88, + "colStart": 4, + "colEnd": 4, + "category": "machine", + "source": "Write tool call" + }, + { + "line": 89, + "colStart": 14, + "colEnd": 21, + "category": "machine", + "source": "Write tool call" + }, + { + "line": 90, + "colStart": 4, + "colEnd": 25, + "category": "machine", + "source": "Write tool call" + }, + { + "line": 94, + "colStart": 39, + "colEnd": 49, + "category": "machine", + "source": "Write tool call" + }, + { + "line": 94, + "colStart": 73, + "colEnd": 112, + "category": "machine", + "source": "Write tool call" + }, + { + "line": 167, + "colStart": 14, + "colEnd": 15, + "category": "machine", + "source": "Write tool call" + }, + { + "line": 168, + "colStart": 7, + "colEnd": 14, + "category": "machine", + "source": "Write tool call" + }, + { + "line": 169, + "colStart": 7, + "colEnd": 22, + "category": "machine", + "source": "Write tool call" + }, + { + "line": 213, + "colStart": 17, + "colEnd": 38, + "category": "machine", + "source": "Write tool call" + }, + { + "line": 217, + "colStart": 2, + "colEnd": 16, + "category": "machine", + "source": "Write tool call" + }, + { + "line": 217, + "colStart": 34, + "colEnd": 39, + "category": "machine", + "source": "Write tool call" + }, + { + "line": 217, + "colStart": 47, + "colEnd": 48, + "category": "machine", + "source": "Write tool call" + }, + { + "line": 238, + "colStart": 5, + "colEnd": 8, + "category": "machine", + "source": "Write tool call" + }, + { + "line": 239, + "colStart": 4, + "colEnd": 7, + "category": "machine", + "source": "Write tool call" + }, + { + "line": 239, + "colStart": 9, + "colEnd": 10, + "category": "machine", + "source": "Write tool call" + }, + { + "line": 239, + "colStart": 14, + "colEnd": 18, + "category": "machine", + "source": "Write tool call" + } + ] + }, + "internal/cmd/sheets_tab_test.go": { + "path": "internal/cmd/sheets_tab_test.go", + "summary": { + "mine": 0, + "machine": 531, + "ours": 0 + }, + "segments": [ + { + "line": 46, + "colStart": 94, + "colEnd": 106, + "category": "machine", + "source": "Write tool call" + }, + { + "line": 88, + "colStart": 0, + "colEnd": 0, + "category": "machine", + "source": "Write tool call" + } + ] + } + }, + "totals": { + "mine": 66, + "machine": 1235, + "ours": 0, + "percent": { + "mine": 5, + "machine": 95, + "ours": 0 + } + }, + "sessions": [ + "ba694c7d-06d6-445f-bcd9-e56e98313e63" + ], + "meta": { + "analyzedAt": "2026-03-12T00:03:52.348Z", + "version": "0.2.0", + "retroactive": false, + "confidence": 0.95 + } +} \ No newline at end of file diff --git a/.byline/commits/48310bf60.json b/.byline/commits/48310bf60.json new file mode 100644 index 00000000..fb67162d --- /dev/null +++ b/.byline/commits/48310bf60.json @@ -0,0 +1,62 @@ +{ + "sha": "48310bf6093add5f706b20fdf6a08e610b82e55b", + "shortSha": "48310bf60", + "parentSha": "4067cc6e570fdc70d6ef19d1f20a1f0d10b54a82", + "timestamp": "2026-03-16T20:09:41-04:00", + "message": "feat(calendar): add create-calendar command", + "files": { + "internal/cmd/calendar.go": { + "path": "internal/cmd/calendar.go", + "summary": { + "mine": 0, + "machine": 138, + "ours": 0 + }, + "segments": [ + { + "line": 5, + "colStart": 0, + "colEnd": 0, + "category": "machine", + "source": "Edit tool call" + } + ] + }, + "internal/cmd/calendar_create_calendar.go": { + "path": "internal/cmd/calendar_create_calendar.go", + "summary": { + "mine": 0, + "machine": 1787, + "ours": 0 + }, + "segments": [ + { + "line": 0, + "colStart": 0, + "colEnd": 0, + "category": "machine", + "source": "Write tool call" + } + ] + } + }, + "totals": { + "mine": 0, + "machine": 1925, + "ours": 0, + "percent": { + "mine": 0, + "machine": 100, + "ours": 0 + } + }, + "sessions": [ + "335cde1a-80fc-4d33-92b3-ba8d1da1dba8" + ], + "meta": { + "analyzedAt": "2026-03-17T00:09:41.652Z", + "version": "0.2.0", + "retroactive": false, + "confidence": 0.95 + } +} \ No newline at end of file diff --git a/.byline/commits/5b0322b81.json b/.byline/commits/5b0322b81.json new file mode 100644 index 00000000..800a2383 --- /dev/null +++ b/.byline/commits/5b0322b81.json @@ -0,0 +1,44 @@ +{ + "sha": "5b0322b815d0182503a77dd2ef238efedd409a66", + "shortSha": "5b0322b81", + "parentSha": "d25dbfdc5ed43e990658dcd3957b775d9a5ef55c", + "timestamp": "2026-03-16T19:54:22-04:00", + "message": "Add `calendar create-calendar` command", + "files": { + "internal/cmd/calendar.go": { + "path": "internal/cmd/calendar.go", + "summary": { + "mine": 19292, + "machine": 0, + "ours": 0 + }, + "segments": [] + }, + "internal/cmd/calendar_create_calendar.go": { + "path": "internal/cmd/calendar_create_calendar.go", + "summary": { + "mine": 1873, + "machine": 0, + "ours": 0 + }, + "segments": [] + } + }, + "totals": { + "mine": 21165, + "machine": 0, + "ours": 0, + "percent": { + "mine": 100, + "machine": 0, + "ours": 0 + } + }, + "sessions": [], + "meta": { + "analyzedAt": "2026-03-16T23:54:22.827Z", + "version": "0.2.0", + "retroactive": false, + "confidence": 1 + } +} \ No newline at end of file diff --git a/.byline/commits/7527b2615.json b/.byline/commits/7527b2615.json new file mode 100644 index 00000000..2f1b3df0 --- /dev/null +++ b/.byline/commits/7527b2615.json @@ -0,0 +1,62 @@ +{ + "sha": "7527b26158c058d3753d25eebb80d2744e2ddb28", + "shortSha": "7527b2615", + "parentSha": "d25dbfdc5ed43e990658dcd3957b775d9a5ef55c", + "timestamp": "2026-03-16T19:54:22-04:00", + "message": "feat(calendar): add create-calendar command", + "files": { + "internal/cmd/calendar.go": { + "path": "internal/cmd/calendar.go", + "summary": { + "mine": 53, + "machine": 0, + "ours": 0 + }, + "segments": [ + { + "line": 23, + "colStart": 0, + "colEnd": 0, + "category": "mine", + "source": "Human edit" + } + ] + }, + "internal/cmd/calendar_create_calendar.go": { + "path": "internal/cmd/calendar_create_calendar.go", + "summary": { + "mine": 1873, + "machine": 0, + "ours": 0 + }, + "segments": [ + { + "line": 0, + "colStart": 0, + "colEnd": 0, + "category": "mine", + "source": "Human edit" + } + ] + } + }, + "totals": { + "mine": 1926, + "machine": 0, + "ours": 0, + "percent": { + "mine": 100, + "machine": 0, + "ours": 0 + } + }, + "sessions": [ + "335cde1a-80fc-4d33-92b3-ba8d1da1dba8" + ], + "meta": { + "analyzedAt": "2026-03-16T23:59:19.153Z", + "version": "0.2.0", + "retroactive": false, + "confidence": 0.95 + } +} \ No newline at end of file