cmd

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(args []string) (err error)

func ExitCode added in v0.3.0

func ExitCode(err error) int

func VersionString added in v0.3.0

func VersionString() string

Types

type AuthAddCmd added in v0.4.2

type AuthAddCmd struct {
	Email        string `arg:"" name:"email" help:"Email"`
	Manual       bool   `name:"manual" help:"Browserless auth flow (paste redirect URL)"`
	ForceConsent bool   `name:"force-consent" help:"Force consent screen to obtain a refresh token"`
	ServicesCSV  string `` /* 163-byte string literal not displayed */
	Readonly     bool   `name:"readonly" help:"Use read-only scopes where available (still includes OIDC identity scopes)"`
	DriveScope   string `name:"drive-scope" help:"Drive scope mode: full|readonly|file" enum:"full,readonly,file" default:"full"`
}

func (*AuthAddCmd) Run added in v0.4.2

func (c *AuthAddCmd) Run(ctx context.Context) error

type AuthCmd added in v0.4.2

type AuthCmd struct {
	Credentials AuthCredentialsCmd    `cmd:"" name:"credentials" help:"Store OAuth client credentials"`
	Add         AuthAddCmd            `cmd:"" name:"add" help:"Authorize and store a refresh token"`
	Services    AuthServicesCmd       `cmd:"" name:"services" help:"List supported auth services and scopes"`
	List        AuthListCmd           `cmd:"" name:"list" help:"List stored accounts"`
	Status      AuthStatusCmd         `cmd:"" name:"status" help:"Show auth configuration and keyring backend"`
	Keyring     AuthKeyringCmd        `cmd:"" name:"keyring" help:"Configure keyring backend"`
	Remove      AuthRemoveCmd         `cmd:"" name:"remove" help:"Remove a stored refresh token"`
	Tokens      AuthTokensCmd         `cmd:"" name:"tokens" help:"Manage stored refresh tokens"`
	Manage      AuthManageCmd         `cmd:"" name:"manage" help:"Open accounts manager in browser" aliases:"login"`
	ServiceAcct AuthServiceAccountCmd `cmd:"" name:"service-account" help:"Configure service account (Workspace only; domain-wide delegation)"`
	Keep        AuthKeepCmd           `cmd:"" name:"keep" help:"Configure service account for Google Keep (Workspace only)"`
}

type AuthCredentialsCmd added in v0.4.2

type AuthCredentialsCmd struct {
	Path string `arg:"" name:"credentials" help:"Path to credentials.json or '-' for stdin"`
}

func (*AuthCredentialsCmd) Run added in v0.4.2

type AuthKeepCmd added in v0.5.0

type AuthKeepCmd struct {
	Email string `arg:"" name:"email" help:"Email to impersonate when using Keep"`
	Key   string `name:"key" required:"" help:"Path to service account JSON key file"`
}

func (*AuthKeepCmd) Run added in v0.5.0

func (c *AuthKeepCmd) Run(ctx context.Context) error

type AuthKeyringCmd added in v0.5.0

type AuthKeyringCmd struct {
	Backend  string `arg:"" optional:"" name:"backend" help:"Keyring backend: auto|keychain|file"`
	Backend2 string `arg:"" optional:"" name:"backend2" help:"(compat) Use: gog auth keyring set <backend>"`
}

func (*AuthKeyringCmd) Run added in v0.5.0

func (c *AuthKeyringCmd) Run(ctx context.Context) error

type AuthListCmd added in v0.4.2

type AuthListCmd struct {
	Check   bool          `name:"check" help:"Verify refresh tokens by exchanging for an access token (requires credentials.json)"`
	Timeout time.Duration `name:"timeout" help:"Per-token check timeout" default:"15s"`
}

func (*AuthListCmd) Run added in v0.4.2

func (c *AuthListCmd) Run(ctx context.Context) error

type AuthManageCmd added in v0.4.2

type AuthManageCmd struct {
	ForceConsent bool          `name:"force-consent" help:"Force consent screen when adding accounts"`
	ServicesCSV  string        `` /* 163-byte string literal not displayed */
	Timeout      time.Duration `name:"timeout" help:"Server timeout duration" default:"10m"`
}

func (*AuthManageCmd) Run added in v0.4.2

func (c *AuthManageCmd) Run(ctx context.Context) error

type AuthRemoveCmd added in v0.4.2

type AuthRemoveCmd struct {
	Email string `arg:"" name:"email" help:"Email"`
}

func (*AuthRemoveCmd) Run added in v0.4.2

func (c *AuthRemoveCmd) Run(ctx context.Context, flags *RootFlags) error

type AuthServiceAccountCmd added in v0.6.0

type AuthServiceAccountCmd struct {
	Set    AuthServiceAccountSetCmd    `cmd:"" name:"set" help:"Store a service account key for impersonation"`
	Unset  AuthServiceAccountUnsetCmd  `cmd:"" name:"unset" help:"Remove stored service account key"`
	Status AuthServiceAccountStatusCmd `cmd:"" name:"status" help:"Show stored service account key status"`
}

type AuthServiceAccountSetCmd added in v0.6.0

type AuthServiceAccountSetCmd struct {
	Email string `arg:"" name:"email" help:"Email to impersonate (Workspace user email)" required:""`
	Key   string `name:"key" required:"" help:"Path to service account JSON key file"`
}

func (*AuthServiceAccountSetCmd) Run added in v0.6.0

type AuthServiceAccountStatusCmd added in v0.6.0

type AuthServiceAccountStatusCmd struct {
	Email string `arg:"" name:"email" help:"Email (impersonated user)" required:""`
}

func (*AuthServiceAccountStatusCmd) Run added in v0.6.0

type AuthServiceAccountUnsetCmd added in v0.6.0

type AuthServiceAccountUnsetCmd struct {
	Email string `arg:"" name:"email" help:"Email (impersonated user)" required:""`
}

func (*AuthServiceAccountUnsetCmd) Run added in v0.6.0

type AuthServicesCmd added in v0.5.0

type AuthServicesCmd struct {
	Markdown bool `name:"markdown" help:"Output Markdown table"`
}

func (*AuthServicesCmd) Run added in v0.5.0

func (c *AuthServicesCmd) Run(ctx context.Context) error

type AuthStatusCmd added in v0.5.0

type AuthStatusCmd struct{}

func (*AuthStatusCmd) Run added in v0.5.0

func (c *AuthStatusCmd) Run(ctx context.Context, flags *RootFlags) error

type AuthTokensCmd added in v0.4.2

type AuthTokensCmd struct {
	List   AuthTokensListCmd   `cmd:"" name:"list" help:"List stored tokens (by key only)"`
	Delete AuthTokensDeleteCmd `cmd:"" name:"delete" help:"Delete a stored refresh token"`
	Export AuthTokensExportCmd `cmd:"" name:"export" help:"Export a refresh token to a file (contains secrets)"`
	Import AuthTokensImportCmd `cmd:"" name:"import" help:"Import a refresh token file into keyring (contains secrets)"`
}

type AuthTokensDeleteCmd added in v0.4.2

type AuthTokensDeleteCmd struct {
	Email string `arg:"" name:"email" help:"Email"`
}

func (*AuthTokensDeleteCmd) Run added in v0.4.2

func (c *AuthTokensDeleteCmd) Run(ctx context.Context, flags *RootFlags) error

type AuthTokensExportCmd added in v0.4.2

type AuthTokensExportCmd struct {
	Email     string                 `arg:"" name:"email" help:"Email"`
	Output    OutputPathRequiredFlag `embed:""`
	Overwrite bool                   `name:"overwrite" help:"Overwrite output file if it exists"`
}

func (*AuthTokensExportCmd) Run added in v0.4.2

type AuthTokensImportCmd added in v0.4.2

type AuthTokensImportCmd struct {
	InPath string `arg:"" name:"inPath" help:"Input path or '-' for stdin"`
}

func (*AuthTokensImportCmd) Run added in v0.4.2

type AuthTokensListCmd added in v0.4.2

type AuthTokensListCmd struct{}

func (*AuthTokensListCmd) Run added in v0.4.2

func (c *AuthTokensListCmd) Run(ctx context.Context) error

type CLI added in v0.4.2

type CLI struct {
	RootFlags `embed:""`

	Version kong.VersionFlag `help:"Print version and exit"`

	Auth       AuthCmd       `cmd:"" help:"Auth and credentials"`
	Groups     GroupsCmd     `cmd:"" help:"Google Groups"`
	Drive      DriveCmd      `cmd:"" help:"Google Drive"`
	Docs       DocsCmd       `cmd:"" help:"Google Docs (export via Drive)"`
	Slides     SlidesCmd     `cmd:"" help:"Google Slides"`
	Calendar   CalendarCmd   `cmd:"" help:"Google Calendar"`
	Gmail      GmailCmd      `cmd:"" aliases:"mail,email" help:"Gmail"`
	Contacts   ContactsCmd   `cmd:"" help:"Google Contacts"`
	Tasks      TasksCmd      `cmd:"" help:"Google Tasks"`
	People     PeopleCmd     `cmd:"" help:"Google People"`
	Keep       KeepCmd       `cmd:"" help:"Google Keep (Workspace only)"`
	Sheets     SheetsCmd     `cmd:"" help:"Google Sheets"`
	VersionCmd VersionCmd    `cmd:"" name:"version" help:"Print version"`
	Completion CompletionCmd `cmd:"" help:"Generate shell completion scripts"`
}

type CalendarAclCmd added in v0.4.2

type CalendarAclCmd struct {
	CalendarID string `arg:"" name:"calendarId" help:"Calendar ID"`
	Max        int64  `name:"max" aliases:"limit" help:"Max results" default:"100"`
	Page       string `name:"page" help:"Page token"`
}

func (*CalendarAclCmd) Run added in v0.4.2

func (c *CalendarAclCmd) Run(ctx context.Context, flags *RootFlags) error

type CalendarCalendarsCmd added in v0.4.2

type CalendarCalendarsCmd struct {
	Max  int64  `name:"max" aliases:"limit" help:"Max results" default:"100"`
	Page string `name:"page" help:"Page token"`
}

func (*CalendarCalendarsCmd) Run added in v0.4.2

func (c *CalendarCalendarsCmd) Run(ctx context.Context, flags *RootFlags) error

type CalendarCmd added in v0.4.2

type CalendarCmd struct {
	Calendars       CalendarCalendarsCmd       `cmd:"" name:"calendars" help:"List calendars"`
	ACL             CalendarAclCmd             `cmd:"" name:"acl" help:"List calendar ACL"`
	Events          CalendarEventsCmd          `cmd:"" name:"events" aliases:"list" help:"List events from a calendar or all calendars"`
	Event           CalendarEventCmd           `cmd:"" name:"event" help:"Get event"`
	Create          CalendarCreateCmd          `cmd:"" name:"create" help:"Create an event"`
	Update          CalendarUpdateCmd          `cmd:"" name:"update" help:"Update an event"`
	Delete          CalendarDeleteCmd          `cmd:"" name:"delete" help:"Delete an event"`
	FreeBusy        CalendarFreeBusyCmd        `cmd:"" name:"freebusy" help:"Get free/busy"`
	Respond         CalendarRespondCmd         `cmd:"" name:"respond" help:"Respond to an event invitation"`
	Colors          CalendarColorsCmd          `cmd:"" name:"colors" help:"Show calendar colors"`
	Conflicts       CalendarConflictsCmd       `cmd:"" name:"conflicts" help:"Find conflicts"`
	Search          CalendarSearchCmd          `cmd:"" name:"search" help:"Search events"`
	Time            CalendarTimeCmd            `cmd:"" name:"time" help:"Show server time"`
	Users           CalendarUsersCmd           `cmd:"" name:"users" help:"List workspace users (use their email as calendar ID)"`
	Team            CalendarTeamCmd            `cmd:"" name:"team" help:"Show events for all members of a Google Group"`
	FocusTime       CalendarFocusTimeCmd       `cmd:"" name:"focus-time" help:"Create a Focus Time block"`
	OOO             CalendarOOOCmd             `cmd:"" name:"out-of-office" aliases:"ooo" help:"Create an Out of Office event"`
	WorkingLocation CalendarWorkingLocationCmd `cmd:"" name:"working-location" aliases:"wl" help:"Set working location (home/office/custom)"`
}

type CalendarColorsCmd added in v0.4.2

type CalendarColorsCmd struct{}

func (*CalendarColorsCmd) Run added in v0.4.2

func (c *CalendarColorsCmd) Run(ctx context.Context, flags *RootFlags) error

type CalendarConflictsCmd added in v0.4.2

type CalendarConflictsCmd struct {
	From      string `name:"from" help:"Start time (RFC3339, date, or relative: today, tomorrow, monday)"`
	To        string `name:"to" help:"End time (RFC3339, date, or relative)"`
	Today     bool   `name:"today" help:"Today only (timezone-aware)"`
	Week      bool   `name:"week" help:"This week (uses --week-start, default Mon)"`
	Days      int    `name:"days" help:"Next N days (timezone-aware)" default:"0"`
	WeekStart string `name:"week-start" help:"Week start day for --week (sun, mon, ...)" default:""`
	Calendars string `name:"calendars" help:"Comma-separated calendar IDs" default:"primary"`
}

func (*CalendarConflictsCmd) Run added in v0.4.2

func (c *CalendarConflictsCmd) Run(ctx context.Context, flags *RootFlags) error

type CalendarCreateCmd added in v0.4.2

type CalendarCreateCmd struct {
	CalendarID            string   `arg:"" name:"calendarId" help:"Calendar ID"`
	Summary               string   `name:"summary" help:"Event summary/title"`
	From                  string   `name:"from" help:"Start time (RFC3339)"`
	To                    string   `name:"to" help:"End time (RFC3339)"`
	Description           string   `name:"description" help:"Description"`
	Location              string   `name:"location" help:"Location"`
	Attendees             string   `name:"attendees" help:"Comma-separated attendee emails"`
	AllDay                bool     `name:"all-day" help:"All-day event (use date-only in --from/--to)"`
	Recurrence            []string `name:"rrule" help:"Recurrence rules (e.g., 'RRULE:FREQ=MONTHLY;BYMONTHDAY=11'). Can be repeated."`
	Reminders             []string `name:"reminder" help:"Custom reminders as method:duration (e.g., popup:30m, email:1d). Can be repeated (max 5)."`
	ColorId               string   `name:"event-color" help:"Event color ID (1-11). Use 'gog calendar colors' to see available colors."`
	Visibility            string   `name:"visibility" help:"Event visibility: default, public, private, confidential"`
	Transparency          string   `name:"transparency" help:"Show as busy (opaque) or free (transparent). Aliases: busy, free"`
	SendUpdates           string   `name:"send-updates" help:"Notification mode: all, externalOnly, none (default: all)"`
	GuestsCanInviteOthers *bool    `name:"guests-can-invite" help:"Allow guests to invite others"`
	GuestsCanModify       *bool    `name:"guests-can-modify" help:"Allow guests to modify event"`
	GuestsCanSeeOthers    *bool    `name:"guests-can-see-others" help:"Allow guests to see other guests"`
	WithMeet              bool     `name:"with-meet" help:"Create a Google Meet video conference for this event"`
	SourceUrl             string   `name:"source-url" help:"URL where event was created/imported from"`
	SourceTitle           string   `name:"source-title" help:"Title of the source"`
	Attachments           []string `name:"attachment" help:"File attachment URL (can be repeated)"`
	PrivateProps          []string `name:"private-prop" help:"Private extended property (key=value, can be repeated)"`
	SharedProps           []string `name:"shared-prop" help:"Shared extended property (key=value, can be repeated)"`
}

func (*CalendarCreateCmd) Run added in v0.4.2

func (c *CalendarCreateCmd) Run(ctx context.Context, flags *RootFlags) error

type CalendarDeleteCmd added in v0.4.2

type CalendarDeleteCmd struct {
	CalendarID        string `arg:"" name:"calendarId" help:"Calendar ID"`
	EventID           string `arg:"" name:"eventId" help:"Event ID"`
	Scope             string `name:"scope" help:"For recurring events: single, future, all" default:"all"`
	OriginalStartTime string `name:"original-start" help:"Original start time of instance (required for scope=single,future)"`
}

func (*CalendarDeleteCmd) Run added in v0.4.2

func (c *CalendarDeleteCmd) Run(ctx context.Context, flags *RootFlags) error

type CalendarEventCmd added in v0.4.2

type CalendarEventCmd struct {
	CalendarID string `arg:"" name:"calendarId" help:"Calendar ID"`
	EventID    string `arg:"" name:"eventId" help:"Event ID"`
}

func (*CalendarEventCmd) Run added in v0.4.2

func (c *CalendarEventCmd) Run(ctx context.Context, flags *RootFlags) error

type CalendarEventsCmd added in v0.4.2

type CalendarEventsCmd struct {
	CalendarID        string `arg:"" name:"calendarId" optional:"" help:"Calendar ID"`
	From              string `name:"from" help:"Start time (RFC3339, date, or relative: today, tomorrow, monday)"`
	To                string `name:"to" help:"End time (RFC3339, date, or relative)"`
	Today             bool   `name:"today" help:"Today only (timezone-aware)"`
	Tomorrow          bool   `name:"tomorrow" help:"Tomorrow only (timezone-aware)"`
	Week              bool   `name:"week" help:"This week (uses --week-start, default Mon)"`
	Days              int    `name:"days" help:"Next N days (timezone-aware)" default:"0"`
	WeekStart         string `name:"week-start" help:"Week start day for --week (sun, mon, ...)" default:""`
	Max               int64  `name:"max" aliases:"limit" help:"Max results" default:"10"`
	Page              string `name:"page" help:"Page token"`
	Query             string `name:"query" help:"Free text search"`
	All               bool   `name:"all" help:"Fetch events from all calendars"`
	PrivatePropFilter string `name:"private-prop-filter" help:"Filter by private extended property (key=value)"`
	SharedPropFilter  string `name:"shared-prop-filter" help:"Filter by shared extended property (key=value)"`
	Fields            string `name:"fields" help:"Comma-separated fields to return"`
}

func (*CalendarEventsCmd) Run added in v0.4.2

func (c *CalendarEventsCmd) Run(ctx context.Context, flags *RootFlags) error

type CalendarFocusTimeCmd added in v0.5.0

type CalendarFocusTimeCmd struct {
	CalendarID     string   `arg:"" name:"calendarId" help:"Calendar ID (default: primary)" default:"primary"`
	Summary        string   `name:"summary" help:"Focus time title" default:"Focus Time"`
	From           string   `name:"from" required:"" help:"Start time (RFC3339)"`
	To             string   `name:"to" required:"" help:"End time (RFC3339)"`
	AutoDecline    string   `name:"auto-decline" help:"Auto-decline mode: none, all, new" default:"all"`
	DeclineMessage string   `name:"decline-message" help:"Message for declined invitations"`
	ChatStatus     string   `name:"chat-status" help:"Chat status: available, doNotDisturb" default:"doNotDisturb"`
	Recurrence     []string `name:"rrule" help:"Recurrence rules. Can be repeated."`
}

func (*CalendarFocusTimeCmd) Run added in v0.5.0

func (c *CalendarFocusTimeCmd) Run(ctx context.Context, flags *RootFlags) error

type CalendarFreeBusyCmd added in v0.4.2

type CalendarFreeBusyCmd struct {
	CalendarIDs string `arg:"" name:"calendarIds" help:"Comma-separated calendar IDs"`
	From        string `name:"from" help:"Start time (RFC3339, required)"`
	To          string `name:"to" help:"End time (RFC3339, required)"`
}

func (*CalendarFreeBusyCmd) Run added in v0.4.2

func (c *CalendarFreeBusyCmd) Run(ctx context.Context, flags *RootFlags) error

type CalendarOOOCmd added in v0.5.0

type CalendarOOOCmd struct {
	CalendarID     string `arg:"" name:"calendarId" help:"Calendar ID (default: primary)" default:"primary"`
	Summary        string `name:"summary" help:"Out of office title" default:"Out of office"`
	From           string `name:"from" required:"" help:"Start date or datetime (RFC3339 or YYYY-MM-DD)"`
	To             string `name:"to" required:"" help:"End date or datetime (RFC3339 or YYYY-MM-DD)"`
	AutoDecline    string `name:"auto-decline" help:"Auto-decline mode: none, all, new" default:"all"`
	DeclineMessage string `name:"decline-message" help:"Message for declined invitations" default:"I am out of office and will respond when I return."`
	AllDay         bool   `name:"all-day" help:"Create as all-day event"`
}

func (*CalendarOOOCmd) Run added in v0.5.0

func (c *CalendarOOOCmd) Run(ctx context.Context, flags *RootFlags) error

type CalendarRespondCmd added in v0.4.2

type CalendarRespondCmd struct {
	CalendarID string `arg:"" name:"calendarId" help:"Calendar ID"`
	EventID    string `arg:"" name:"eventId" help:"Event ID"`
	Status     string `name:"status" help:"Response status (accepted, declined, tentative, needsAction)"`
	Comment    string `name:"comment" help:"Optional comment/note to include with response"`
}

func (*CalendarRespondCmd) Run added in v0.4.2

func (c *CalendarRespondCmd) Run(ctx context.Context, flags *RootFlags) error

type CalendarSearchCmd added in v0.4.2

type CalendarSearchCmd struct {
	Query string `arg:"" name:"query" help:"Search query"`
	TimeRangeFlags
	CalendarID string `name:"calendar" help:"Calendar ID" default:"primary"`
	Max        int64  `name:"max" aliases:"limit" help:"Max results" default:"25"`
}

func (*CalendarSearchCmd) Run added in v0.4.2

func (c *CalendarSearchCmd) Run(ctx context.Context, flags *RootFlags) error

type CalendarTeamCmd added in v0.5.0

type CalendarTeamCmd struct {
	GroupEmail string `arg:"" help:"Google Group email (e.g., [email protected])"`
	FreeBusy   bool   `name:"freebusy" help:"Show only busy/free blocks (faster, single API call)"`
	Query      string `name:"query" short:"q" help:"Filter events by title (case-insensitive)"`
	Max        int64  `name:"max" help:"Max events per calendar" default:"100"`
	NoDedup    bool   `name:"no-dedup" help:"Show each person's view without deduplication"`
	TimeRangeFlags
}

func (*CalendarTeamCmd) Run added in v0.5.0

func (c *CalendarTeamCmd) Run(ctx context.Context, flags *RootFlags) error

type CalendarTimeCmd added in v0.4.2

type CalendarTimeCmd struct {
	CalendarID string `name:"calendar" help:"Calendar ID to get timezone from" default:"primary"`
	Timezone   string `name:"timezone" help:"Override timezone (e.g., America/New_York, UTC)"`
}

func (*CalendarTimeCmd) Run added in v0.4.2

func (c *CalendarTimeCmd) Run(ctx context.Context, flags *RootFlags) error

type CalendarUpdateCmd added in v0.4.2

type CalendarUpdateCmd struct {
	CalendarID            string   `arg:"" name:"calendarId" help:"Calendar ID"`
	EventID               string   `arg:"" name:"eventId" help:"Event ID"`
	Summary               string   `name:"summary" help:"New summary/title (set empty to clear)"`
	From                  string   `name:"from" help:"New start time (RFC3339; set empty to clear)"`
	To                    string   `name:"to" help:"New end time (RFC3339; set empty to clear)"`
	Description           string   `name:"description" help:"New description (set empty to clear)"`
	Location              string   `name:"location" help:"New location (set empty to clear)"`
	Attendees             string   `name:"attendees" help:"Comma-separated attendee emails (replaces all; set empty to clear)"`
	AddAttendee           string   `name:"add-attendee" help:"Comma-separated attendee emails to add (preserves existing attendees)"`
	AllDay                bool     `name:"all-day" help:"All-day event (use date-only in --from/--to)"`
	Recurrence            []string `name:"rrule" help:"Recurrence rules (e.g., 'RRULE:FREQ=MONTHLY;BYMONTHDAY=11'). Can be repeated. Set empty to clear."`
	Reminders             []string `` /* 132-byte string literal not displayed */
	ColorId               string   `name:"event-color" help:"Event color ID (1-11, or empty to clear)"`
	Visibility            string   `name:"visibility" help:"Event visibility: default, public, private, confidential"`
	Transparency          string   `name:"transparency" help:"Show as busy (opaque) or free (transparent). Aliases: busy, free"`
	GuestsCanInviteOthers *bool    `name:"guests-can-invite" help:"Allow guests to invite others"`
	GuestsCanModify       *bool    `name:"guests-can-modify" help:"Allow guests to modify event"`
	GuestsCanSeeOthers    *bool    `name:"guests-can-see-others" help:"Allow guests to see other guests"`
	Scope                 string   `name:"scope" help:"For recurring events: single, future, all" default:"all"`
	OriginalStartTime     string   `name:"original-start" help:"Original start time of instance (required for scope=single,future)"`
	PrivateProps          []string `name:"private-prop" help:"Private extended property (key=value, can be repeated)"`
	SharedProps           []string `name:"shared-prop" help:"Shared extended property (key=value, can be repeated)"`
}

func (*CalendarUpdateCmd) Run added in v0.4.2

func (c *CalendarUpdateCmd) Run(ctx context.Context, kctx *kong.Context, flags *RootFlags) error

type CalendarUsersCmd added in v0.5.0

type CalendarUsersCmd struct {
	Max  int64  `name:"max" aliases:"limit" help:"Max results" default:"100"`
	Page string `name:"page" help:"Page token"`
}

func (*CalendarUsersCmd) Run added in v0.5.0

func (c *CalendarUsersCmd) Run(ctx context.Context, flags *RootFlags) error

type CalendarWorkingLocationCmd added in v0.5.0

type CalendarWorkingLocationCmd struct {
	CalendarID  string `arg:"" name:"calendarId" help:"Calendar ID (default: primary)" default:"primary"`
	From        string `name:"from" required:"" help:"Start date (YYYY-MM-DD)"`
	To          string `name:"to" required:"" help:"End date (YYYY-MM-DD)"`
	Type        string `name:"type" required:"" help:"Location type: home, office, custom"`
	OfficeLabel string `name:"office-label" help:"Office name/label"`
	BuildingId  string `name:"building-id" help:"Building ID"`
	FloorId     string `name:"floor-id" help:"Floor ID"`
	DeskId      string `name:"desk-id" help:"Desk ID"`
	CustomLabel string `name:"custom-label" help:"Custom location label"`
}

func (*CalendarWorkingLocationCmd) Run added in v0.5.0

type CompletionCmd added in v0.4.2

type CompletionCmd struct {
	Shell string `arg:"" name:"shell" help:"Shell (bash|zsh|fish|powershell)" enum:"bash,zsh,fish,powershell"`
}

func (*CompletionCmd) Run added in v0.4.2

func (c *CompletionCmd) Run(_ context.Context) error

type ContactsCmd added in v0.4.2

type ContactsCmd struct {
	Search    ContactsSearchCmd    `cmd:"" name:"search" help:"Search contacts by name/email/phone"`
	List      ContactsListCmd      `cmd:"" name:"list" help:"List contacts"`
	Get       ContactsGetCmd       `cmd:"" name:"get" help:"Get a contact"`
	Create    ContactsCreateCmd    `cmd:"" name:"create" help:"Create a contact"`
	Update    ContactsUpdateCmd    `cmd:"" name:"update" help:"Update a contact"`
	Delete    ContactsDeleteCmd    `cmd:"" name:"delete" help:"Delete a contact"`
	Directory ContactsDirectoryCmd `cmd:"" name:"directory" help:"Directory contacts"`
	Other     ContactsOtherCmd     `cmd:"" name:"other" help:"Other contacts"`
}

type ContactsCreateCmd added in v0.4.2

type ContactsCreateCmd struct {
	Given  string `name:"given" help:"Given name (required)"`
	Family string `name:"family" help:"Family name"`
	Email  string `name:"email" help:"Email address"`
	Phone  string `name:"phone" help:"Phone number"`
}

func (*ContactsCreateCmd) Run added in v0.4.2

func (c *ContactsCreateCmd) Run(ctx context.Context, flags *RootFlags) error

type ContactsDeleteCmd added in v0.4.2

type ContactsDeleteCmd struct {
	ResourceName string `arg:"" name:"resourceName" help:"Resource name (people/...)"`
}

func (*ContactsDeleteCmd) Run added in v0.4.2

func (c *ContactsDeleteCmd) Run(ctx context.Context, flags *RootFlags) error

type ContactsDirectoryCmd added in v0.4.2

type ContactsDirectoryCmd struct {
	List   ContactsDirectoryListCmd   `cmd:"" name:"list" help:"List people from the Workspace directory"`
	Search ContactsDirectorySearchCmd `cmd:"" name:"search" help:"Search people in the Workspace directory"`
}

type ContactsDirectoryListCmd added in v0.4.2

type ContactsDirectoryListCmd struct {
	Max  int64  `name:"max" aliases:"limit" help:"Max results" default:"50"`
	Page string `name:"page" help:"Page token"`
}

func (*ContactsDirectoryListCmd) Run added in v0.4.2

type ContactsDirectorySearchCmd added in v0.4.2

type ContactsDirectorySearchCmd struct {
	Query []string `arg:"" name:"query" help:"Search query"`
	Max   int64    `name:"max" aliases:"limit" help:"Max results" default:"50"`
	Page  string   `name:"page" help:"Page token"`
}

func (*ContactsDirectorySearchCmd) Run added in v0.4.2

type ContactsGetCmd added in v0.4.2

type ContactsGetCmd struct {
	Identifier string `arg:"" name:"resourceName" help:"Resource name (people/...) or email"`
}

func (*ContactsGetCmd) Run added in v0.4.2

func (c *ContactsGetCmd) Run(ctx context.Context, flags *RootFlags) error

type ContactsListCmd added in v0.4.2

type ContactsListCmd struct {
	Max  int64  `name:"max" aliases:"limit" help:"Max results" default:"100"`
	Page string `name:"page" help:"Page token"`
}

func (*ContactsListCmd) Run added in v0.4.2

func (c *ContactsListCmd) Run(ctx context.Context, flags *RootFlags) error

type ContactsOtherCmd added in v0.4.2

type ContactsOtherCmd struct {
	List   ContactsOtherListCmd   `cmd:"" name:"list" help:"List other contacts"`
	Search ContactsOtherSearchCmd `cmd:"" name:"search" help:"Search other contacts"`
	Delete ContactsOtherDeleteCmd `cmd:"" name:"delete" help:"Delete an other contact"`
}

type ContactsOtherDeleteCmd added in v0.5.0

type ContactsOtherDeleteCmd struct {
	ResourceName string `arg:"" name:"resourceName" help:"Resource name (otherContacts/...)"`
}

func (*ContactsOtherDeleteCmd) Run added in v0.5.0

type ContactsOtherListCmd added in v0.4.2

type ContactsOtherListCmd struct {
	Max  int64  `name:"max" aliases:"limit" help:"Max results" default:"100"`
	Page string `name:"page" help:"Page token"`
}

func (*ContactsOtherListCmd) Run added in v0.4.2

func (c *ContactsOtherListCmd) Run(ctx context.Context, flags *RootFlags) error

type ContactsOtherSearchCmd added in v0.4.2

type ContactsOtherSearchCmd struct {
	Query []string `arg:"" name:"query" help:"Search query"`
	Max   int64    `name:"max" aliases:"limit" help:"Max results" default:"50"`
}

func (*ContactsOtherSearchCmd) Run added in v0.4.2

type ContactsSearchCmd added in v0.4.2

type ContactsSearchCmd struct {
	Query []string `arg:"" name:"query" help:"Search query"`
	Max   int64    `name:"max" aliases:"limit" help:"Max results" default:"50"`
}

func (*ContactsSearchCmd) Run added in v0.4.2

func (c *ContactsSearchCmd) Run(ctx context.Context, flags *RootFlags) error

type ContactsUpdateCmd added in v0.4.2

type ContactsUpdateCmd struct {
	ResourceName string `arg:"" name:"resourceName" help:"Resource name (people/...)"`
	Given        string `name:"given" help:"Given name"`
	Family       string `name:"family" help:"Family name"`
	Email        string `name:"email" help:"Email address (empty clears)"`
	Phone        string `name:"phone" help:"Phone number (empty clears)"`
}

func (*ContactsUpdateCmd) Run added in v0.4.2

func (c *ContactsUpdateCmd) Run(ctx context.Context, kctx *kong.Context, flags *RootFlags) error

type DocsCatCmd added in v0.4.2

type DocsCatCmd struct {
	DocID    string `arg:"" name:"docId" help:"Doc ID"`
	MaxBytes int64  `name:"max-bytes" help:"Max bytes to read (0 = unlimited)" default:"2000000"`
}

func (*DocsCatCmd) Run added in v0.4.2

func (c *DocsCatCmd) Run(ctx context.Context, flags *RootFlags) error

type DocsCmd added in v0.4.2

type DocsCmd struct {
	Export DocsExportCmd `cmd:"" name:"export" help:"Export a Google Doc (pdf|docx|txt)"`
	Info   DocsInfoCmd   `cmd:"" name:"info" help:"Get Google Doc metadata"`
	Create DocsCreateCmd `cmd:"" name:"create" help:"Create a Google Doc"`
	Copy   DocsCopyCmd   `cmd:"" name:"copy" help:"Copy a Google Doc"`
	Cat    DocsCatCmd    `cmd:"" name:"cat" help:"Print a Google Doc as plain text"`
}

type DocsCopyCmd added in v0.4.2

type DocsCopyCmd struct {
	DocID  string `arg:"" name:"docId" help:"Doc ID"`
	Title  string `arg:"" name:"title" help:"New title"`
	Parent string `name:"parent" help:"Destination folder ID"`
}

func (*DocsCopyCmd) Run added in v0.4.2

func (c *DocsCopyCmd) Run(ctx context.Context, flags *RootFlags) error

type DocsCreateCmd added in v0.4.2

type DocsCreateCmd struct {
	Title  string `arg:"" name:"title" help:"Doc title"`
	Parent string `name:"parent" help:"Destination folder ID"`
}

func (*DocsCreateCmd) Run added in v0.4.2

func (c *DocsCreateCmd) Run(ctx context.Context, flags *RootFlags) error

type DocsExportCmd added in v0.4.2

type DocsExportCmd struct {
	DocID  string         `arg:"" name:"docId" help:"Doc ID"`
	Output OutputPathFlag `embed:""`
	Format string         `name:"format" help:"Export format: pdf|docx|txt" default:"pdf"`
}

func (*DocsExportCmd) Run added in v0.4.2

func (c *DocsExportCmd) Run(ctx context.Context, flags *RootFlags) error

type DocsInfoCmd added in v0.4.2

type DocsInfoCmd struct {
	DocID string `arg:"" name:"docId" help:"Doc ID"`
}

func (*DocsInfoCmd) Run added in v0.4.2

func (c *DocsInfoCmd) Run(ctx context.Context, flags *RootFlags) error

type DriveCmd added in v0.4.2

type DriveCmd struct {
	Ls          DriveLsCmd          `cmd:"" name:"ls" help:"List files in a folder (default: root)"`
	Search      DriveSearchCmd      `cmd:"" name:"search" help:"Full-text search across Drive"`
	Get         DriveGetCmd         `cmd:"" name:"get" help:"Get file metadata"`
	Download    DriveDownloadCmd    `cmd:"" name:"download" help:"Download a file (exports Google Docs formats)"`
	Copy        DriveCopyCmd        `cmd:"" name:"copy" help:"Copy a file"`
	Upload      DriveUploadCmd      `cmd:"" name:"upload" help:"Upload a file"`
	Mkdir       DriveMkdirCmd       `cmd:"" name:"mkdir" help:"Create a folder"`
	Delete      DriveDeleteCmd      `cmd:"" name:"delete" help:"Delete a file (moves to trash)" aliases:"rm,del"`
	Move        DriveMoveCmd        `cmd:"" name:"move" help:"Move a file to a different folder"`
	Rename      DriveRenameCmd      `cmd:"" name:"rename" help:"Rename a file or folder"`
	Share       DriveShareCmd       `cmd:"" name:"share" help:"Share a file or folder"`
	Unshare     DriveUnshareCmd     `cmd:"" name:"unshare" help:"Remove a permission from a file"`
	Permissions DrivePermissionsCmd `cmd:"" name:"permissions" help:"List permissions on a file"`
	URL         DriveURLCmd         `cmd:"" name:"url" help:"Print web URLs for files"`
	Comments    DriveCommentsCmd    `cmd:"" name:"comments" help:"Manage comments on files"`
}

type DriveCommentReplyCmd added in v0.5.0

type DriveCommentReplyCmd struct {
	FileID    string `arg:"" name:"fileId" help:"File ID"`
	CommentID string `arg:"" name:"commentId" help:"Comment ID"`
	Content   string `arg:"" name:"content" help:"Reply text"`
}

func (*DriveCommentReplyCmd) Run added in v0.5.0

func (c *DriveCommentReplyCmd) Run(ctx context.Context, flags *RootFlags) error

type DriveCommentsCmd added in v0.5.0

type DriveCommentsCmd struct {
	List   DriveCommentsListCmd   `cmd:"" name:"list" help:"List comments on a file"`
	Get    DriveCommentsGetCmd    `cmd:"" name:"get" help:"Get a comment by ID"`
	Create DriveCommentsCreateCmd `cmd:"" name:"create" help:"Create a comment on a file"`
	Update DriveCommentsUpdateCmd `cmd:"" name:"update" help:"Update a comment"`
	Delete DriveCommentsDeleteCmd `cmd:"" name:"delete" help:"Delete a comment"`
	Reply  DriveCommentReplyCmd   `cmd:"" name:"reply" help:"Reply to a comment"`
}

DriveCommentsCmd is the parent command for comments subcommands

type DriveCommentsCreateCmd added in v0.5.0

type DriveCommentsCreateCmd struct {
	FileID  string `arg:"" name:"fileId" help:"File ID"`
	Content string `arg:"" name:"content" help:"Comment text"`
	Quoted  string `name:"quoted" help:"Text to anchor the comment to (for Google Docs)"`
}

func (*DriveCommentsCreateCmd) Run added in v0.5.0

type DriveCommentsDeleteCmd added in v0.5.0

type DriveCommentsDeleteCmd struct {
	FileID    string `arg:"" name:"fileId" help:"File ID"`
	CommentID string `arg:"" name:"commentId" help:"Comment ID"`
}

func (*DriveCommentsDeleteCmd) Run added in v0.5.0

type DriveCommentsGetCmd added in v0.5.0

type DriveCommentsGetCmd struct {
	FileID    string `arg:"" name:"fileId" help:"File ID"`
	CommentID string `arg:"" name:"commentId" help:"Comment ID"`
}

func (*DriveCommentsGetCmd) Run added in v0.5.0

func (c *DriveCommentsGetCmd) Run(ctx context.Context, flags *RootFlags) error

type DriveCommentsListCmd added in v0.5.0

type DriveCommentsListCmd struct {
	FileID        string `arg:"" name:"fileId" help:"File ID"`
	Max           int64  `name:"max" help:"Max results" default:"100"`
	Page          string `name:"page" help:"Page token"`
	IncludeQuoted bool   `name:"include-quoted" help:"Include the quoted content the comment is anchored to"`
}

func (*DriveCommentsListCmd) Run added in v0.5.0

func (c *DriveCommentsListCmd) Run(ctx context.Context, flags *RootFlags) error

type DriveCommentsUpdateCmd added in v0.5.0

type DriveCommentsUpdateCmd struct {
	FileID    string `arg:"" name:"fileId" help:"File ID"`
	CommentID string `arg:"" name:"commentId" help:"Comment ID"`
	Content   string `arg:"" name:"content" help:"New comment text"`
}

func (*DriveCommentsUpdateCmd) Run added in v0.5.0

type DriveCopyCmd added in v0.4.2

type DriveCopyCmd struct {
	FileID string `arg:"" name:"fileId" help:"File ID"`
	Name   string `arg:"" name:"name" help:"New file name"`
	Parent string `name:"parent" help:"Destination folder ID"`
}

func (*DriveCopyCmd) Run added in v0.4.2

func (c *DriveCopyCmd) Run(ctx context.Context, flags *RootFlags) error

type DriveDeleteCmd added in v0.4.2

type DriveDeleteCmd struct {
	FileID string `arg:"" name:"fileId" help:"File ID"`
}

func (*DriveDeleteCmd) Run added in v0.4.2

func (c *DriveDeleteCmd) Run(ctx context.Context, flags *RootFlags) error

type DriveDownloadCmd added in v0.4.2

type DriveDownloadCmd struct {
	FileID string         `arg:"" name:"fileId" help:"File ID"`
	Output OutputPathFlag `embed:""`
	Format string         `name:"format" help:"Export format for Google Docs files: pdf|csv|xlsx|pptx|txt|png|docx (default: auto)"`
}

func (*DriveDownloadCmd) Run added in v0.4.2

func (c *DriveDownloadCmd) Run(ctx context.Context, flags *RootFlags) error

type DriveGetCmd added in v0.4.2

type DriveGetCmd struct {
	FileID string `arg:"" name:"fileId" help:"File ID"`
}

func (*DriveGetCmd) Run added in v0.4.2

func (c *DriveGetCmd) Run(ctx context.Context, flags *RootFlags) error

type DriveLsCmd added in v0.4.2

type DriveLsCmd struct {
	Max    int64  `name:"max" aliases:"limit" help:"Max results" default:"20"`
	Page   string `name:"page" help:"Page token"`
	Query  string `name:"query" help:"Drive query filter"`
	Parent string `name:"parent" help:"Folder ID to list (default: root)"`
}

func (*DriveLsCmd) Run added in v0.4.2

func (c *DriveLsCmd) Run(ctx context.Context, flags *RootFlags) error

type DriveMkdirCmd added in v0.4.2

type DriveMkdirCmd struct {
	Name   string `arg:"" name:"name" help:"Folder name"`
	Parent string `name:"parent" help:"Parent folder ID"`
}

func (*DriveMkdirCmd) Run added in v0.4.2

func (c *DriveMkdirCmd) Run(ctx context.Context, flags *RootFlags) error

type DriveMoveCmd added in v0.4.2

type DriveMoveCmd struct {
	FileID string `arg:"" name:"fileId" help:"File ID"`
	Parent string `name:"parent" help:"New parent folder ID (required)"`
}

func (*DriveMoveCmd) Run added in v0.4.2

func (c *DriveMoveCmd) Run(ctx context.Context, flags *RootFlags) error

type DrivePermissionsCmd added in v0.4.2

type DrivePermissionsCmd struct {
	FileID string `arg:"" name:"fileId" help:"File ID"`
	Max    int64  `name:"max" aliases:"limit" help:"Max results" default:"100"`
	Page   string `name:"page" help:"Page token"`
}

func (*DrivePermissionsCmd) Run added in v0.4.2

func (c *DrivePermissionsCmd) Run(ctx context.Context, flags *RootFlags) error

type DriveRenameCmd added in v0.4.2

type DriveRenameCmd struct {
	FileID  string `arg:"" name:"fileId" help:"File ID"`
	NewName string `arg:"" name:"newName" help:"New name"`
}

func (*DriveRenameCmd) Run added in v0.4.2

func (c *DriveRenameCmd) Run(ctx context.Context, flags *RootFlags) error

type DriveSearchCmd added in v0.4.2

type DriveSearchCmd struct {
	Query []string `arg:"" name:"query" help:"Search query"`
	Max   int64    `name:"max" aliases:"limit" help:"Max results" default:"20"`
	Page  string   `name:"page" help:"Page token"`
}

func (*DriveSearchCmd) Run added in v0.4.2

func (c *DriveSearchCmd) Run(ctx context.Context, flags *RootFlags) error

type DriveShareCmd added in v0.4.2

type DriveShareCmd struct {
	FileID       string `arg:"" name:"fileId" help:"File ID"`
	Anyone       bool   `name:"anyone" help:"Make publicly accessible"`
	Email        string `name:"email" help:"Share with specific user"`
	Role         string `name:"role" help:"Permission: reader|writer" default:"reader"`
	Discoverable bool   `name:"discoverable" help:"Allow file discovery in search (anyone/domain only)"`
}

func (*DriveShareCmd) Run added in v0.4.2

func (c *DriveShareCmd) Run(ctx context.Context, flags *RootFlags) error

type DriveURLCmd added in v0.4.2

type DriveURLCmd struct {
	FileIDs []string `arg:"" name:"fileId" help:"File IDs"`
}

func (*DriveURLCmd) Run added in v0.4.2

func (c *DriveURLCmd) Run(ctx context.Context, flags *RootFlags) error

type DriveUnshareCmd added in v0.4.2

type DriveUnshareCmd struct {
	FileID       string `arg:"" name:"fileId" help:"File ID"`
	PermissionID string `arg:"" name:"permissionId" help:"Permission ID"`
}

func (*DriveUnshareCmd) Run added in v0.4.2

func (c *DriveUnshareCmd) Run(ctx context.Context, flags *RootFlags) error

type DriveUploadCmd added in v0.4.2

type DriveUploadCmd struct {
	LocalPath string `arg:"" name:"localPath" help:"Path to local file"`
	Name      string `name:"name" help:"Override filename"`
	Parent    string `name:"parent" help:"Destination folder ID"`
}

func (*DriveUploadCmd) Run added in v0.4.2

func (c *DriveUploadCmd) Run(ctx context.Context, flags *RootFlags) error

type ExitError added in v0.3.0

type ExitError struct {
	Code int
	Err  error
}

func (*ExitError) Error added in v0.3.0

func (e *ExitError) Error() string

func (*ExitError) Unwrap added in v0.3.0

func (e *ExitError) Unwrap() error

type GmailAttachmentCmd added in v0.4.2

type GmailAttachmentCmd struct {
	MessageID    string         `arg:"" name:"messageId" help:"Message ID"`
	AttachmentID string         `arg:"" name:"attachmentId" help:"Attachment ID"`
	Output       OutputPathFlag `embed:""`
	Name         string         `name:"name" help:"Filename (only used when --out is empty)"`
}

func (*GmailAttachmentCmd) Run added in v0.4.2

func (c *GmailAttachmentCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailAutoForwardCmd added in v0.4.2

type GmailAutoForwardCmd struct {
	Get    GmailAutoForwardGetCmd    `cmd:"" name:"get" help:"Get current auto-forwarding settings"`
	Update GmailAutoForwardUpdateCmd `cmd:"" name:"update" help:"Update auto-forwarding settings"`
}

type GmailAutoForwardGetCmd added in v0.4.2

type GmailAutoForwardGetCmd struct{}

func (*GmailAutoForwardGetCmd) Run added in v0.4.2

type GmailAutoForwardUpdateCmd added in v0.4.2

type GmailAutoForwardUpdateCmd struct {
	Enable      bool   `name:"enable" help:"Enable auto-forwarding"`
	Disable     bool   `name:"disable" help:"Disable auto-forwarding"`
	Email       string `name:"email" help:"Email address to forward to (must be verified first)"`
	Disposition string `name:"disposition" help:"What to do with forwarded messages: leaveInInbox, archive, trash, markRead"`
}

func (*GmailAutoForwardUpdateCmd) Run added in v0.4.2

type GmailBatchCmd added in v0.4.2

type GmailBatchCmd struct {
	Delete GmailBatchDeleteCmd `cmd:"" name:"delete" help:"Permanently delete multiple messages"`
	Modify GmailBatchModifyCmd `cmd:"" name:"modify" help:"Modify labels on multiple messages"`
}

type GmailBatchDeleteCmd added in v0.4.2

type GmailBatchDeleteCmd struct {
	MessageIDs []string `arg:"" name:"messageId" help:"Message IDs"`
}

func (*GmailBatchDeleteCmd) Run added in v0.4.2

func (c *GmailBatchDeleteCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailBatchModifyCmd added in v0.4.2

type GmailBatchModifyCmd struct {
	MessageIDs []string `arg:"" name:"messageId" help:"Message IDs"`
	Add        string   `name:"add" help:"Labels to add (comma-separated, name or ID)"`
	Remove     string   `name:"remove" help:"Labels to remove (comma-separated, name or ID)"`
}

func (*GmailBatchModifyCmd) Run added in v0.4.2

func (c *GmailBatchModifyCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailCmd added in v0.4.2

type GmailCmd struct {
	Search     GmailSearchCmd     `cmd:"" name:"search" group:"Read" help:"Search threads using Gmail query syntax"`
	Thread     GmailThreadCmd     `cmd:"" name:"thread" group:"Organize" help:"Thread operations (get, modify)"`
	Get        GmailGetCmd        `cmd:"" name:"get" group:"Read" help:"Get a message (full|metadata|raw)"`
	Attachment GmailAttachmentCmd `cmd:"" name:"attachment" group:"Read" help:"Download a single attachment"`
	URL        GmailURLCmd        `cmd:"" name:"url" group:"Read" help:"Print Gmail web URLs for threads"`
	History    GmailHistoryCmd    `cmd:"" name:"history" group:"Read" help:"Gmail history"`

	Labels GmailLabelsCmd `cmd:"" name:"labels" group:"Organize" help:"Label operations"`
	Batch  GmailBatchCmd  `cmd:"" name:"batch" group:"Organize" help:"Batch operations"`

	Send   GmailSendCmd   `cmd:"" name:"send" group:"Write" help:"Send an email"`
	Track  GmailTrackCmd  `cmd:"" name:"track" group:"Write" help:"Email open tracking"`
	Drafts GmailDraftsCmd `cmd:"" name:"drafts" group:"Write" help:"Draft operations"`

	Settings GmailSettingsCmd `cmd:"" name:"settings" group:"Admin" help:"Settings and admin"`

	// Kept for backwards-compatibility; hidden from default help.
	Watch       GmailWatchCmd       `cmd:"" name:"watch" hidden:"" help:"Manage Gmail watch"`
	AutoForward GmailAutoForwardCmd `cmd:"" name:"autoforward" hidden:"" help:"Auto-forwarding settings"`
	Delegates   GmailDelegatesCmd   `cmd:"" name:"delegates" hidden:"" help:"Delegate operations"`
	Filters     GmailFiltersCmd     `cmd:"" name:"filters" hidden:"" help:"Filter operations"`
	Forwarding  GmailForwardingCmd  `cmd:"" name:"forwarding" hidden:"" help:"Forwarding addresses"`
	SendAs      GmailSendAsCmd      `cmd:"" name:"sendas" hidden:"" help:"Send-as settings"`
	Vacation    GmailVacationCmd    `cmd:"" name:"vacation" hidden:"" help:"Vacation responder"`
}

type GmailDelegatesAddCmd added in v0.4.2

type GmailDelegatesAddCmd struct {
	DelegateEmail string `arg:"" name:"delegateEmail" help:"Delegate email"`
}

func (*GmailDelegatesAddCmd) Run added in v0.4.2

func (c *GmailDelegatesAddCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailDelegatesCmd added in v0.4.2

type GmailDelegatesCmd struct {
	List   GmailDelegatesListCmd   `cmd:"" name:"list" help:"List all delegates"`
	Get    GmailDelegatesGetCmd    `cmd:"" name:"get" help:"Get a specific delegate's information"`
	Add    GmailDelegatesAddCmd    `cmd:"" name:"add" help:"Add a delegate"`
	Remove GmailDelegatesRemoveCmd `cmd:"" name:"remove" help:"Remove a delegate"`
}

type GmailDelegatesGetCmd added in v0.4.2

type GmailDelegatesGetCmd struct {
	DelegateEmail string `arg:"" name:"delegateEmail" help:"Delegate email"`
}

func (*GmailDelegatesGetCmd) Run added in v0.4.2

func (c *GmailDelegatesGetCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailDelegatesListCmd added in v0.4.2

type GmailDelegatesListCmd struct{}

func (*GmailDelegatesListCmd) Run added in v0.4.2

func (c *GmailDelegatesListCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailDelegatesRemoveCmd added in v0.4.2

type GmailDelegatesRemoveCmd struct {
	DelegateEmail string `arg:"" name:"delegateEmail" help:"Delegate email"`
}

func (*GmailDelegatesRemoveCmd) Run added in v0.4.2

type GmailDraftsCmd added in v0.4.2

type GmailDraftsCmd struct {
	List   GmailDraftsListCmd   `cmd:"" name:"list" help:"List drafts"`
	Get    GmailDraftsGetCmd    `cmd:"" name:"get" help:"Get draft details"`
	Delete GmailDraftsDeleteCmd `cmd:"" name:"delete" help:"Delete a draft"`
	Send   GmailDraftsSendCmd   `cmd:"" name:"send" help:"Send a draft"`
	Create GmailDraftsCreateCmd `cmd:"" name:"create" help:"Create a draft"`
	Update GmailDraftsUpdateCmd `cmd:"" name:"update" help:"Update a draft"`
}

type GmailDraftsCreateCmd added in v0.4.2

type GmailDraftsCreateCmd struct {
	To               string   `name:"to" help:"Recipients (comma-separated)"`
	Cc               string   `name:"cc" help:"CC recipients (comma-separated)"`
	Bcc              string   `name:"bcc" help:"BCC recipients (comma-separated)"`
	Subject          string   `name:"subject" help:"Subject (required)"`
	Body             string   `name:"body" help:"Body (plain text; required unless --body-html is set)"`
	BodyFile         string   `name:"body-file" help:"Body file path (plain text; '-' for stdin)"`
	BodyHTML         string   `name:"body-html" help:"Body (HTML; optional)"`
	ReplyToMessageID string   `name:"reply-to-message-id" help:"Reply to Gmail message ID (sets In-Reply-To/References and thread)"`
	ReplyTo          string   `name:"reply-to" help:"Reply-To header address"`
	Attach           []string `name:"attach" help:"Attachment file path (repeatable)"`
	From             string   `name:"from" help:"Send from this email address (must be a verified send-as alias)"`
}

func (*GmailDraftsCreateCmd) Run added in v0.4.2

func (c *GmailDraftsCreateCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailDraftsDeleteCmd added in v0.4.2

type GmailDraftsDeleteCmd struct {
	DraftID string `arg:"" name:"draftId" help:"Draft ID"`
}

func (*GmailDraftsDeleteCmd) Run added in v0.4.2

func (c *GmailDraftsDeleteCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailDraftsGetCmd added in v0.4.2

type GmailDraftsGetCmd struct {
	DraftID  string `arg:"" name:"draftId" help:"Draft ID"`
	Download bool   `name:"download" help:"Download draft attachments"`
}

func (*GmailDraftsGetCmd) Run added in v0.4.2

func (c *GmailDraftsGetCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailDraftsListCmd added in v0.4.2

type GmailDraftsListCmd struct {
	Max  int64  `name:"max" aliases:"limit" help:"Max results" default:"20"`
	Page string `name:"page" help:"Page token"`
}

func (*GmailDraftsListCmd) Run added in v0.4.2

func (c *GmailDraftsListCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailDraftsSendCmd added in v0.4.2

type GmailDraftsSendCmd struct {
	DraftID string `arg:"" name:"draftId" help:"Draft ID"`
}

func (*GmailDraftsSendCmd) Run added in v0.4.2

func (c *GmailDraftsSendCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailDraftsUpdateCmd added in v0.5.0

type GmailDraftsUpdateCmd struct {
	DraftID          string   `arg:"" name:"draftId" help:"Draft ID"`
	To               *string  `name:"to" help:"Recipients (comma-separated; omit to keep existing)"`
	Cc               string   `name:"cc" help:"CC recipients (comma-separated)"`
	Bcc              string   `name:"bcc" help:"BCC recipients (comma-separated)"`
	Subject          string   `name:"subject" help:"Subject (required)"`
	Body             string   `name:"body" help:"Body (plain text; required unless --body-html is set)"`
	BodyFile         string   `name:"body-file" help:"Body file path (plain text; '-' for stdin)"`
	BodyHTML         string   `name:"body-html" help:"Body (HTML; optional)"`
	ReplyToMessageID string   `name:"reply-to-message-id" help:"Reply to Gmail message ID (sets In-Reply-To/References and thread)"`
	ReplyTo          string   `name:"reply-to" help:"Reply-To header address"`
	Attach           []string `name:"attach" help:"Attachment file path (repeatable)"`
	From             string   `name:"from" help:"Send from this email address (must be a verified send-as alias)"`
}

func (*GmailDraftsUpdateCmd) Run added in v0.5.0

func (c *GmailDraftsUpdateCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailFiltersCmd added in v0.4.2

type GmailFiltersCmd struct {
	List   GmailFiltersListCmd   `cmd:"" name:"list" help:"List all email filters"`
	Get    GmailFiltersGetCmd    `cmd:"" name:"get" help:"Get a specific filter"`
	Create GmailFiltersCreateCmd `cmd:"" name:"create" help:"Create a new email filter"`
	Delete GmailFiltersDeleteCmd `cmd:"" name:"delete" help:"Delete a filter"`
}

type GmailFiltersCreateCmd added in v0.4.2

type GmailFiltersCreateCmd struct {
	From          string `name:"from" help:"Match messages from this sender"`
	To            string `name:"to" help:"Match messages to this recipient"`
	Subject       string `name:"subject" help:"Match messages with this subject"`
	Query         string `name:"query" help:"Advanced Gmail search query for matching"`
	HasAttachment bool   `name:"has-attachment" help:"Match messages with attachments"`
	AddLabel      string `name:"add-label" help:"Label(s) to add to matching messages (comma-separated, name or ID)"`
	RemoveLabel   string `name:"remove-label" help:"Label(s) to remove from matching messages (comma-separated, name or ID)"`
	Archive       bool   `name:"archive" help:"Archive matching messages (skip inbox)"`
	MarkRead      bool   `name:"mark-read" help:"Mark matching messages as read"`
	Star          bool   `name:"star" help:"Star matching messages"`
	Forward       string `name:"forward" help:"Forward to this email address"`
	Trash         bool   `name:"trash" help:"Move matching messages to trash"`
	NeverSpam     bool   `name:"never-spam" help:"Never mark as spam"`
	Important     bool   `name:"important" help:"Mark as important"`
}

func (*GmailFiltersCreateCmd) Run added in v0.4.2

func (c *GmailFiltersCreateCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailFiltersDeleteCmd added in v0.4.2

type GmailFiltersDeleteCmd struct {
	FilterID string `arg:"" name:"filterId" help:"Filter ID"`
}

func (*GmailFiltersDeleteCmd) Run added in v0.4.2

func (c *GmailFiltersDeleteCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailFiltersGetCmd added in v0.4.2

type GmailFiltersGetCmd struct {
	FilterID string `arg:"" name:"filterId" help:"Filter ID"`
}

func (*GmailFiltersGetCmd) Run added in v0.4.2

func (c *GmailFiltersGetCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailFiltersListCmd added in v0.4.2

type GmailFiltersListCmd struct{}

func (*GmailFiltersListCmd) Run added in v0.4.2

func (c *GmailFiltersListCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailForwardingCmd added in v0.4.2

type GmailForwardingCmd struct {
	List   GmailForwardingListCmd   `cmd:"" name:"list" help:"List all forwarding addresses"`
	Get    GmailForwardingGetCmd    `cmd:"" name:"get" help:"Get a specific forwarding address"`
	Create GmailForwardingCreateCmd `cmd:"" name:"create" help:"Create/add a forwarding address"`
	Delete GmailForwardingDeleteCmd `cmd:"" name:"delete" help:"Delete a forwarding address"`
}

type GmailForwardingCreateCmd added in v0.4.2

type GmailForwardingCreateCmd struct {
	ForwardingEmail string `arg:"" name:"forwardingEmail" help:"Forwarding email"`
}

func (*GmailForwardingCreateCmd) Run added in v0.4.2

type GmailForwardingDeleteCmd added in v0.4.2

type GmailForwardingDeleteCmd struct {
	ForwardingEmail string `arg:"" name:"forwardingEmail" help:"Forwarding email"`
}

func (*GmailForwardingDeleteCmd) Run added in v0.4.2

type GmailForwardingGetCmd added in v0.4.2

type GmailForwardingGetCmd struct {
	ForwardingEmail string `arg:"" name:"forwardingEmail" help:"Forwarding email"`
}

func (*GmailForwardingGetCmd) Run added in v0.4.2

func (c *GmailForwardingGetCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailForwardingListCmd added in v0.4.2

type GmailForwardingListCmd struct{}

func (*GmailForwardingListCmd) Run added in v0.4.2

type GmailGetCmd added in v0.4.2

type GmailGetCmd struct {
	MessageID string `arg:"" name:"messageId" help:"Message ID"`
	Format    string `name:"format" help:"Message format: full|metadata|raw" default:"full"`
	Headers   string `name:"headers" help:"Metadata headers (comma-separated; only for --format=metadata)"`
}

func (*GmailGetCmd) Run added in v0.4.2

func (c *GmailGetCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailHistoryCmd added in v0.4.2

type GmailHistoryCmd struct {
	Since string `name:"since" help:"Start history ID"`
	Max   int64  `name:"max" aliases:"limit" help:"Max results" default:"100"`
	Page  string `name:"page" help:"Page token"`
}

func (*GmailHistoryCmd) Run added in v0.4.2

func (c *GmailHistoryCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailLabelsCmd added in v0.4.2

type GmailLabelsCmd struct {
	List   GmailLabelsListCmd   `cmd:"" name:"list" help:"List labels"`
	Get    GmailLabelsGetCmd    `cmd:"" name:"get" help:"Get label details (including counts)"`
	Create GmailLabelsCreateCmd `cmd:"" name:"create" help:"Create a new label"`
	Modify GmailLabelsModifyCmd `cmd:"" name:"modify" help:"Modify labels on threads"`
}

type GmailLabelsCreateCmd added in v0.5.0

type GmailLabelsCreateCmd struct {
	Name string `arg:"" help:"Label name"`
}

func (*GmailLabelsCreateCmd) Run added in v0.5.0

func (c *GmailLabelsCreateCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailLabelsGetCmd added in v0.4.2

type GmailLabelsGetCmd struct {
	Label string `arg:"" name:"labelIdOrName" help:"Label ID or name"`
}

func (*GmailLabelsGetCmd) Run added in v0.4.2

func (c *GmailLabelsGetCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailLabelsListCmd added in v0.4.2

type GmailLabelsListCmd struct{}

func (*GmailLabelsListCmd) Run added in v0.4.2

func (c *GmailLabelsListCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailLabelsModifyCmd added in v0.4.2

type GmailLabelsModifyCmd struct {
	ThreadIDs []string `arg:"" name:"threadId" help:"Thread IDs"`
	Add       string   `name:"add" help:"Labels to add (comma-separated, name or ID)"`
	Remove    string   `name:"remove" help:"Labels to remove (comma-separated, name or ID)"`
}

func (*GmailLabelsModifyCmd) Run added in v0.4.2

func (c *GmailLabelsModifyCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailSearchCmd added in v0.4.2

type GmailSearchCmd struct {
	Query  []string `arg:"" name:"query" help:"Search query"`
	Max    int64    `name:"max" aliases:"limit" help:"Max results" default:"10"`
	Page   string   `name:"page" help:"Page token"`
	Oldest bool     `name:"oldest" help:"Show first message date instead of last"`
}

func (*GmailSearchCmd) Run added in v0.4.2

func (c *GmailSearchCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailSendAsCmd added in v0.4.2

type GmailSendAsCmd struct {
	List   GmailSendAsListCmd   `cmd:"" name:"list" help:"List send-as aliases"`
	Get    GmailSendAsGetCmd    `cmd:"" name:"get" help:"Get details of a send-as alias"`
	Create GmailSendAsCreateCmd `cmd:"" name:"create" help:"Create a new send-as alias"`
	Verify GmailSendAsVerifyCmd `cmd:"" name:"verify" help:"Resend verification email for a send-as alias"`
	Delete GmailSendAsDeleteCmd `cmd:"" name:"delete" help:"Delete a send-as alias"`
	Update GmailSendAsUpdateCmd `cmd:"" name:"update" help:"Update a send-as alias"`
}

type GmailSendAsCreateCmd added in v0.4.2

type GmailSendAsCreateCmd struct {
	Email        string `arg:"" name:"email" help:"Send-as email"`
	DisplayName  string `name:"display-name" help:"Name that appears in the From field"`
	ReplyTo      string `name:"reply-to" help:"Reply-to address (optional)"`
	Signature    string `name:"signature" help:"HTML signature for emails sent from this alias"`
	TreatAsAlias bool   `name:"treat-as-alias" help:"Treat as alias (replies sent from Gmail web)" default:"true"`
}

func (*GmailSendAsCreateCmd) Run added in v0.4.2

func (c *GmailSendAsCreateCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailSendAsDeleteCmd added in v0.4.2

type GmailSendAsDeleteCmd struct {
	Email string `arg:"" name:"email" help:"Send-as email"`
}

func (*GmailSendAsDeleteCmd) Run added in v0.4.2

func (c *GmailSendAsDeleteCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailSendAsGetCmd added in v0.4.2

type GmailSendAsGetCmd struct {
	Email string `arg:"" name:"email" help:"Send-as email"`
}

func (*GmailSendAsGetCmd) Run added in v0.4.2

func (c *GmailSendAsGetCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailSendAsListCmd added in v0.4.2

type GmailSendAsListCmd struct{}

func (*GmailSendAsListCmd) Run added in v0.4.2

func (c *GmailSendAsListCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailSendAsUpdateCmd added in v0.4.2

type GmailSendAsUpdateCmd struct {
	Email        string `arg:"" name:"email" help:"Send-as email"`
	DisplayName  string `name:"display-name" help:"Name that appears in the From field"`
	ReplyTo      string `name:"reply-to" help:"Reply-to address"`
	Signature    string `name:"signature" help:"HTML signature"`
	TreatAsAlias bool   `name:"treat-as-alias" help:"Treat as alias" default:"true"`
	MakeDefault  bool   `name:"make-default" help:"Make this the default send-as address"`
}

func (*GmailSendAsUpdateCmd) Run added in v0.4.2

func (c *GmailSendAsUpdateCmd) Run(ctx context.Context, kctx *kong.Context, flags *RootFlags) error

type GmailSendAsVerifyCmd added in v0.4.2

type GmailSendAsVerifyCmd struct {
	Email string `arg:"" name:"email" help:"Send-as email"`
}

func (*GmailSendAsVerifyCmd) Run added in v0.4.2

func (c *GmailSendAsVerifyCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailSendCmd added in v0.4.2

type GmailSendCmd struct {
	To               string   `name:"to" help:"Recipients (comma-separated; required unless --reply-all is used)"`
	Cc               string   `name:"cc" help:"CC recipients (comma-separated)"`
	Bcc              string   `name:"bcc" help:"BCC recipients (comma-separated)"`
	Subject          string   `name:"subject" help:"Subject (required)"`
	Body             string   `name:"body" help:"Body (plain text; required unless --body-html is set)"`
	BodyFile         string   `name:"body-file" help:"Body file path (plain text; '-' for stdin)"`
	BodyHTML         string   `name:"body-html" help:"Body (HTML; optional)"`
	ReplyToMessageID string   `name:"reply-to-message-id" aliases:"in-reply-to" help:"Reply to Gmail message ID (sets In-Reply-To/References and thread)"`
	ThreadID         string   `name:"thread-id" help:"Reply within a Gmail thread (uses latest message for headers)"`
	ReplyAll         bool     `name:"reply-all" help:"Auto-populate recipients from original message (requires --reply-to-message-id or --thread-id)"`
	ReplyTo          string   `name:"reply-to" help:"Reply-To header address"`
	Attach           []string `name:"attach" help:"Attachment file path (repeatable)"`
	From             string   `name:"from" help:"Send from this email address (must be a verified send-as alias)"`
	Track            bool     `name:"track" help:"Enable open tracking (requires tracking setup)"`
	TrackSplit       bool     `name:"track-split" help:"Send tracked messages separately per recipient"`
}

func (*GmailSendCmd) Run added in v0.4.2

func (c *GmailSendCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailSettingsCmd added in v0.5.0

type GmailSettingsCmd struct {
	Filters     GmailFiltersCmd     `cmd:"" name:"filters" group:"Organize" help:"Filter operations"`
	Delegates   GmailDelegatesCmd   `cmd:"" name:"delegates" group:"Admin" help:"Delegate operations"`
	Forwarding  GmailForwardingCmd  `cmd:"" name:"forwarding" group:"Admin" help:"Forwarding addresses"`
	AutoForward GmailAutoForwardCmd `cmd:"" name:"autoforward" group:"Admin" help:"Auto-forwarding settings"`
	SendAs      GmailSendAsCmd      `cmd:"" name:"sendas" group:"Admin" help:"Send-as settings"`
	Vacation    GmailVacationCmd    `cmd:"" name:"vacation" group:"Admin" help:"Vacation responder"`
	Watch       GmailWatchCmd       `cmd:"" name:"watch" group:"Admin" help:"Manage Gmail watch"`
}

type GmailThreadAttachmentsCmd added in v0.5.0

type GmailThreadAttachmentsCmd struct {
	ThreadID  string        `arg:"" name:"threadId" help:"Thread ID"`
	Download  bool          `name:"download" help:"Download all attachments"`
	OutputDir OutputDirFlag `embed:""`
}

GmailThreadAttachmentsCmd lists all attachments in a thread.

func (*GmailThreadAttachmentsCmd) Run added in v0.5.0

type GmailThreadCmd added in v0.4.2

type GmailThreadCmd struct {
	Get         GmailThreadGetCmd         `cmd:"" name:"get" help:"Get a thread with all messages (optionally download attachments)"`
	Modify      GmailThreadModifyCmd      `cmd:"" name:"modify" help:"Modify labels on all messages in a thread"`
	Attachments GmailThreadAttachmentsCmd `cmd:"" name:"attachments" help:"List all attachments in a thread"`
}

type GmailThreadGetCmd added in v0.4.2

type GmailThreadGetCmd struct {
	ThreadID  string        `arg:"" name:"threadId" help:"Thread ID"`
	Download  bool          `name:"download" help:"Download attachments"`
	Full      bool          `name:"full" help:"Show full message bodies"`
	OutputDir OutputDirFlag `embed:""`
}

func (*GmailThreadGetCmd) Run added in v0.4.2

func (c *GmailThreadGetCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailThreadModifyCmd added in v0.4.2

type GmailThreadModifyCmd struct {
	ThreadID string `arg:"" name:"threadId" help:"Thread ID"`
	Add      string `name:"add" help:"Labels to add (comma-separated, name or ID)"`
	Remove   string `name:"remove" help:"Labels to remove (comma-separated, name or ID)"`
}

func (*GmailThreadModifyCmd) Run added in v0.4.2

func (c *GmailThreadModifyCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailTrackCmd added in v0.5.0

type GmailTrackCmd struct {
	Setup  GmailTrackSetupCmd  `cmd:"" help:"Set up email tracking (deploy Cloudflare Worker)"`
	Opens  GmailTrackOpensCmd  `cmd:"" help:"Query email opens"`
	Status GmailTrackStatusCmd `cmd:"" help:"Show tracking configuration status"`
}

GmailTrackCmd groups tracking-related subcommands

type GmailTrackOpensCmd added in v0.5.0

type GmailTrackOpensCmd struct {
	TrackingID string `arg:"" optional:"" help:"Tracking ID from send command"`
	To         string `name:"to" help:"Filter by recipient email"`
	Since      string `name:"since" help:"Filter by time (e.g., '24h', '2024-01-01')"`
}

func (*GmailTrackOpensCmd) Run added in v0.5.0

func (c *GmailTrackOpensCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailTrackSetupCmd added in v0.5.0

type GmailTrackSetupCmd struct {
	WorkerName   string `name:"worker-name" help:"Cloudflare Worker name (defaults to gog-email-tracker-<account>)"`
	DatabaseName string `name:"db-name" help:"D1 database name (defaults to worker name)"`
	WorkerURL    string `name:"worker-url" aliases:"domain" help:"Tracking worker base URL (e.g. https://gog-email-tracker.<acct>.workers.dev)"`
	TrackingKey  string `name:"tracking-key" help:"Tracking key (base64; generates one if omitted)"`
	AdminKey     string `name:"admin-key" help:"Admin key for /opens (generates one if omitted)"`
	Deploy       bool   `name:"deploy" help:"Provision D1 + deploy the worker (requires wrangler)"`
	WorkerDir    string `name:"worker-dir" help:"Worker directory (default: internal/tracking/worker)"`
}

func (*GmailTrackSetupCmd) Run added in v0.5.0

func (c *GmailTrackSetupCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailTrackStatusCmd added in v0.5.0

type GmailTrackStatusCmd struct{}

func (*GmailTrackStatusCmd) Run added in v0.5.0

func (c *GmailTrackStatusCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailURLCmd added in v0.4.2

type GmailURLCmd struct {
	ThreadIDs []string `arg:"" name:"threadId" help:"Thread IDs"`
}

func (*GmailURLCmd) Run added in v0.4.2

func (c *GmailURLCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailVacationCmd added in v0.4.2

type GmailVacationCmd struct {
	Get    GmailVacationGetCmd    `cmd:"" name:"get" help:"Get current vacation responder settings"`
	Update GmailVacationUpdateCmd `cmd:"" name:"update" help:"Update vacation responder settings"`
}

type GmailVacationGetCmd added in v0.4.2

type GmailVacationGetCmd struct{}

func (*GmailVacationGetCmd) Run added in v0.4.2

func (c *GmailVacationGetCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailVacationUpdateCmd added in v0.4.2

type GmailVacationUpdateCmd struct {
	Enable       bool   `name:"enable" help:"Enable vacation responder"`
	Disable      bool   `name:"disable" help:"Disable vacation responder"`
	Subject      string `name:"subject" help:"Subject line for auto-reply"`
	Body         string `name:"body" help:"HTML body of the auto-reply message"`
	Start        string `name:"start" help:"Start time in RFC3339 format (e.g., 2024-12-20T00:00:00Z)"`
	End          string `name:"end" help:"End time in RFC3339 format (e.g., 2024-12-31T23:59:59Z)"`
	ContactsOnly bool   `name:"contacts-only" help:"Only respond to contacts"`
	DomainOnly   bool   `name:"domain-only" help:"Only respond to same domain"`
}

func (*GmailVacationUpdateCmd) Run added in v0.4.2

func (c *GmailVacationUpdateCmd) Run(ctx context.Context, kctx *kong.Context, flags *RootFlags) error

type GmailWatchCmd added in v0.4.2

type GmailWatchCmd struct {
	Start  GmailWatchStartCmd  `cmd:"" name:"start" help:"Start Gmail watch for Pub/Sub"`
	Status GmailWatchStatusCmd `cmd:"" name:"status" help:"Show stored watch state"`
	Renew  GmailWatchRenewCmd  `cmd:"" name:"renew" help:"Renew Gmail watch using stored config"`
	Stop   GmailWatchStopCmd   `cmd:"" name:"stop" help:"Stop Gmail watch and clear stored state"`
	Serve  GmailWatchServeCmd  `cmd:"" name:"serve" help:"Run Pub/Sub push handler"`
}

type GmailWatchRenewCmd added in v0.4.2

type GmailWatchRenewCmd struct {
	TTL string `name:"ttl" help:"Renew after duration (seconds or Go duration)"`
}

func (*GmailWatchRenewCmd) Run added in v0.4.2

func (c *GmailWatchRenewCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailWatchServeCmd added in v0.4.2

type GmailWatchServeCmd struct {
	Bind         string `name:"bind" help:"Bind address" default:"127.0.0.1"`
	Port         int    `name:"port" help:"Listen port" default:"8788"`
	Path         string `name:"path" help:"Push handler path" default:"/gmail-pubsub"`
	VerifyOIDC   bool   `name:"verify-oidc" help:"Verify Pub/Sub OIDC tokens"`
	OIDCEmail    string `name:"oidc-email" help:"Expected service account email"`
	OIDCAudience string `name:"oidc-audience" help:"Expected OIDC audience"`
	SharedToken  string `name:"token" help:"Shared token for x-gog-token or ?token="`
	HookURL      string `name:"hook-url" help:"Webhook URL to forward messages"`
	HookToken    string `name:"hook-token" help:"Webhook bearer token"`
	IncludeBody  bool   `name:"include-body" help:"Include text/plain body in hook payload"`
	MaxBytes     int    `name:"max-bytes" help:"Max bytes of body to include" default:"20000"`
	SaveHook     bool   `name:"save-hook" help:"Persist hook settings to watch state"`
}

func (*GmailWatchServeCmd) Run added in v0.4.2

func (c *GmailWatchServeCmd) Run(ctx context.Context, kctx *kong.Context, flags *RootFlags) error

type GmailWatchStartCmd added in v0.4.2

type GmailWatchStartCmd struct {
	Topic       string   `name:"topic" help:"Pub/Sub topic (projects/.../topics/...)"`
	Labels      []string `name:"label" help:"Label IDs or names (repeatable, comma-separated)"`
	TTL         string   `name:"ttl" help:"Renew after duration (seconds or Go duration)"`
	HookURL     string   `name:"hook-url" help:"Webhook URL to forward messages"`
	HookToken   string   `name:"hook-token" help:"Webhook bearer token"`
	IncludeBody bool     `name:"include-body" help:"Include text/plain body in hook payload"`
	MaxBytes    int      `name:"max-bytes" help:"Max bytes of body to include" default:"20000"`
}

func (*GmailWatchStartCmd) Run added in v0.4.2

func (c *GmailWatchStartCmd) Run(ctx context.Context, kctx *kong.Context, flags *RootFlags) error

type GmailWatchStatusCmd added in v0.4.2

type GmailWatchStatusCmd struct{}

func (*GmailWatchStatusCmd) Run added in v0.4.2

func (c *GmailWatchStatusCmd) Run(ctx context.Context, flags *RootFlags) error

type GmailWatchStopCmd added in v0.4.2

type GmailWatchStopCmd struct{}

func (*GmailWatchStopCmd) Run added in v0.4.2

func (c *GmailWatchStopCmd) Run(ctx context.Context, flags *RootFlags) error

type GroupsCmd added in v0.5.0

type GroupsCmd struct {
	List    GroupsListCmd    `cmd:"" name:"list" help:"List groups you belong to"`
	Members GroupsMembersCmd `cmd:"" name:"members" help:"List members of a group"`
}

type GroupsListCmd added in v0.5.0

type GroupsListCmd struct {
	Max  int64  `name:"max" aliases:"limit" help:"Max results" default:"100"`
	Page string `name:"page" help:"Page token"`
}

func (*GroupsListCmd) Run added in v0.5.0

func (c *GroupsListCmd) Run(ctx context.Context, flags *RootFlags) error

type GroupsMembersCmd added in v0.5.0

type GroupsMembersCmd struct {
	GroupEmail string `arg:"" name:"groupEmail" help:"Group email (e.g., [email protected])"`
	Max        int64  `name:"max" aliases:"limit" help:"Max results" default:"100"`
	Page       string `name:"page" help:"Page token"`
}

func (*GroupsMembersCmd) Run added in v0.5.0

func (c *GroupsMembersCmd) Run(ctx context.Context, flags *RootFlags) error

type KeepAttachmentCmd added in v0.5.0

type KeepAttachmentCmd struct {
	AttachmentName string `arg:"" name:"attachmentName" help:"Attachment name (e.g. notes/abc123/attachments/xyz789)"`
	MimeType       string `name:"mime-type" help:"MIME type of attachment (e.g. image/jpeg)" default:"application/octet-stream"`
	Out            string `name:"out" help:"Output file path (default: attachment filename or ID)"`
}

func (*KeepAttachmentCmd) Run added in v0.5.0

func (c *KeepAttachmentCmd) Run(ctx context.Context, flags *RootFlags, keep *KeepCmd) error

type KeepCmd added in v0.5.0

type KeepCmd struct {
	ServiceAccount string `name:"service-account" help:"Path to service account JSON file"`
	Impersonate    string `name:"impersonate" help:"Email to impersonate (required with service-account)"`

	List       KeepListCmd       `cmd:"" default:"withargs" help:"List notes"`
	Get        KeepGetCmd        `cmd:"" name:"get" help:"Get a note"`
	Search     KeepSearchCmd     `cmd:"" name:"search" help:"Search notes by text (client-side)"`
	Attachment KeepAttachmentCmd `cmd:"" name:"attachment" help:"Download an attachment"`
}

type KeepGetCmd added in v0.5.0

type KeepGetCmd struct {
	NoteID string `arg:"" name:"noteId" help:"Note ID or name (e.g. notes/abc123)"`
}

func (*KeepGetCmd) Run added in v0.5.0

func (c *KeepGetCmd) Run(ctx context.Context, flags *RootFlags, keep *KeepCmd) error

type KeepListCmd added in v0.5.0

type KeepListCmd struct {
	Max    int64  `name:"max" help:"Max results" default:"100"`
	Page   string `name:"page" help:"Page token"`
	Filter string `name:"filter" help:"Filter expression (e.g. 'create_time > \"2024-01-01T00:00:00Z\"')"`
}

func (*KeepListCmd) Run added in v0.5.0

func (c *KeepListCmd) Run(ctx context.Context, flags *RootFlags, keep *KeepCmd) error

type KeepSearchCmd added in v0.5.0

type KeepSearchCmd struct {
	Query string `arg:"" name:"query" help:"Text to search for in title and body"`
	Max   int64  `name:"max" help:"Max results to fetch before filtering" default:"500"`
}

func (*KeepSearchCmd) Run added in v0.5.0

func (c *KeepSearchCmd) Run(ctx context.Context, flags *RootFlags, keep *KeepCmd) error

type OutputDirFlag added in v0.5.0

type OutputDirFlag struct {
	Dir string `name:"out-dir" aliases:"output-dir" help:"Directory to write attachments to (default: current directory)"`
}

type OutputPathFlag added in v0.5.0

type OutputPathFlag struct {
	Path string `name:"out" aliases:"output" help:"Output file path (default: gogcli config dir)"`
}

type OutputPathRequiredFlag added in v0.5.0

type OutputPathRequiredFlag struct {
	Path string `name:"out" aliases:"output" help:"Output file path (required)"`
}

type PeopleCmd added in v0.4.2

type PeopleCmd struct {
	Me PeopleMeCmd `cmd:"" name:"me" help:"Show your profile (people/me)"`
}

type PeopleMeCmd added in v0.4.2

type PeopleMeCmd struct{}

func (*PeopleMeCmd) Run added in v0.4.2

func (c *PeopleMeCmd) Run(ctx context.Context, flags *RootFlags) error

type RootFlags added in v0.4.2

type RootFlags struct {
	Color   string `help:"Color output: auto|always|never" default:"${color}"`
	Account string `help:"Account email for API commands (gmail/calendar/drive/docs/slides/contacts/tasks/people/sheets)"`
	JSON    bool   `help:"Output JSON to stdout (best for scripting)" default:"${json}"`
	Plain   bool   `help:"Output stable, parseable text to stdout (TSV; no colors)" default:"${plain}"`
	Force   bool   `help:"Skip confirmations for destructive commands"`
	NoInput bool   `help:"Never prompt; fail instead (useful for CI)"`
	Verbose bool   `help:"Enable verbose logging"`
}

type SheetsAppendCmd added in v0.4.2

type SheetsAppendCmd struct {
	SpreadsheetID      string   `arg:"" name:"spreadsheetId" help:"Spreadsheet ID"`
	Range              string   `arg:"" name:"range" help:"Range (eg. Sheet1!A:C)"`
	Values             []string `arg:"" optional:"" name:"values" help:"Values (comma-separated rows, pipe-separated cells)"`
	ValueInput         string   `name:"input" help:"Value input option: RAW or USER_ENTERED" default:"USER_ENTERED"`
	Insert             string   `name:"insert" help:"Insert data option: OVERWRITE or INSERT_ROWS"`
	ValuesJSON         string   `name:"values-json" help:"Values as JSON 2D array"`
	CopyValidationFrom string   `name:"copy-validation-from" help:"Copy data validation from an A1 range (eg. 'Sheet1!A2:D2') to the appended cells"`
}

func (*SheetsAppendCmd) Run added in v0.4.2

func (c *SheetsAppendCmd) Run(ctx context.Context, flags *RootFlags) error

type SheetsClearCmd added in v0.4.2

type SheetsClearCmd struct {
	SpreadsheetID string `arg:"" name:"spreadsheetId" help:"Spreadsheet ID"`
	Range         string `arg:"" name:"range" help:"Range (eg. Sheet1!A1:B2)"`
}

func (*SheetsClearCmd) Run added in v0.4.2

func (c *SheetsClearCmd) Run(ctx context.Context, flags *RootFlags) error

type SheetsCmd added in v0.4.2

type SheetsCmd struct {
	Get      SheetsGetCmd      `cmd:"" name:"get" help:"Get values from a range"`
	Update   SheetsUpdateCmd   `cmd:"" name:"update" help:"Update values in a range"`
	Append   SheetsAppendCmd   `cmd:"" name:"append" help:"Append values to a range"`
	Clear    SheetsClearCmd    `cmd:"" name:"clear" help:"Clear values in a range"`
	Metadata SheetsMetadataCmd `cmd:"" name:"metadata" help:"Get spreadsheet metadata"`
	Create   SheetsCreateCmd   `cmd:"" name:"create" help:"Create a new spreadsheet"`
	Copy     SheetsCopyCmd     `cmd:"" name:"copy" help:"Copy a Google Sheet"`
	Export   SheetsExportCmd   `cmd:"" name:"export" help:"Export a Google Sheet (pdf|xlsx|csv) via Drive"`
}

type SheetsCopyCmd added in v0.4.2

type SheetsCopyCmd struct {
	SpreadsheetID string `arg:"" name:"spreadsheetId" help:"Spreadsheet ID"`
	Title         string `arg:"" name:"title" help:"New spreadsheet title"`
	Parent        string `name:"parent" help:"Destination folder ID"`
}

func (*SheetsCopyCmd) Run added in v0.4.2

func (c *SheetsCopyCmd) Run(ctx context.Context, flags *RootFlags) error

type SheetsCreateCmd added in v0.4.2

type SheetsCreateCmd struct {
	Title  string `arg:"" name:"title" help:"Spreadsheet title"`
	Sheets string `name:"sheets" help:"Comma-separated sheet names to create"`
}

func (*SheetsCreateCmd) Run added in v0.4.2

func (c *SheetsCreateCmd) Run(ctx context.Context, flags *RootFlags) error

type SheetsExportCmd added in v0.4.2

type SheetsExportCmd struct {
	SpreadsheetID string         `arg:"" name:"spreadsheetId" help:"Spreadsheet ID"`
	Output        OutputPathFlag `embed:""`
	Format        string         `name:"format" help:"Export format: pdf|xlsx|csv" default:"xlsx"`
}

func (*SheetsExportCmd) Run added in v0.4.2

func (c *SheetsExportCmd) Run(ctx context.Context, flags *RootFlags) error

type SheetsGetCmd added in v0.4.2

type SheetsGetCmd struct {
	SpreadsheetID     string `arg:"" name:"spreadsheetId" help:"Spreadsheet ID"`
	Range             string `arg:"" name:"range" help:"Range (eg. Sheet1!A1:B10)"`
	MajorDimension    string `name:"dimension" help:"Major dimension: ROWS or COLUMNS"`
	ValueRenderOption string `name:"render" help:"Value render option: FORMATTED_VALUE, UNFORMATTED_VALUE, or FORMULA"`
}

func (*SheetsGetCmd) Run added in v0.4.2

func (c *SheetsGetCmd) Run(ctx context.Context, flags *RootFlags) error

type SheetsMetadataCmd added in v0.4.2

type SheetsMetadataCmd struct {
	SpreadsheetID string `arg:"" name:"spreadsheetId" help:"Spreadsheet ID"`
}

func (*SheetsMetadataCmd) Run added in v0.4.2

func (c *SheetsMetadataCmd) Run(ctx context.Context, flags *RootFlags) error

type SheetsUpdateCmd added in v0.4.2

type SheetsUpdateCmd struct {
	SpreadsheetID      string   `arg:"" name:"spreadsheetId" help:"Spreadsheet ID"`
	Range              string   `arg:"" name:"range" help:"Range (eg. Sheet1!A1:B2)"`
	Values             []string `arg:"" optional:"" name:"values" help:"Values (comma-separated rows, pipe-separated cells)"`
	ValueInput         string   `name:"input" help:"Value input option: RAW or USER_ENTERED" default:"USER_ENTERED"`
	ValuesJSON         string   `name:"values-json" help:"Values as JSON 2D array"`
	CopyValidationFrom string   `name:"copy-validation-from" help:"Copy data validation from an A1 range (eg. 'Sheet1!A2:D2') to the updated cells"`
}

func (*SheetsUpdateCmd) Run added in v0.4.2

func (c *SheetsUpdateCmd) Run(ctx context.Context, flags *RootFlags) error

type SlidesCmd added in v0.4.2

type SlidesCmd struct {
	Export SlidesExportCmd `cmd:"" name:"export" help:"Export a Google Slides deck (pdf|pptx)"`
	Info   SlidesInfoCmd   `cmd:"" name:"info" help:"Get Google Slides presentation metadata"`
	Create SlidesCreateCmd `cmd:"" name:"create" help:"Create a Google Slides presentation"`
	Copy   SlidesCopyCmd   `cmd:"" name:"copy" help:"Copy a Google Slides presentation"`
}

type SlidesCopyCmd added in v0.4.2

type SlidesCopyCmd struct {
	PresentationID string `arg:"" name:"presentationId" help:"Presentation ID"`
	Title          string `arg:"" name:"title" help:"New title"`
	Parent         string `name:"parent" help:"Destination folder ID"`
}

func (*SlidesCopyCmd) Run added in v0.4.2

func (c *SlidesCopyCmd) Run(ctx context.Context, flags *RootFlags) error

type SlidesCreateCmd added in v0.4.2

type SlidesCreateCmd struct {
	Title  string `arg:"" name:"title" help:"Presentation title"`
	Parent string `name:"parent" help:"Destination folder ID"`
}

func (*SlidesCreateCmd) Run added in v0.4.2

func (c *SlidesCreateCmd) Run(ctx context.Context, flags *RootFlags) error

type SlidesExportCmd added in v0.4.2

type SlidesExportCmd struct {
	PresentationID string         `arg:"" name:"presentationId" help:"Presentation ID"`
	Output         OutputPathFlag `embed:""`
	Format         string         `name:"format" help:"Export format: pdf|pptx" default:"pptx"`
}

func (*SlidesExportCmd) Run added in v0.4.2

func (c *SlidesExportCmd) Run(ctx context.Context, flags *RootFlags) error

type SlidesInfoCmd added in v0.4.2

type SlidesInfoCmd struct {
	PresentationID string `arg:"" name:"presentationId" help:"Presentation ID"`
}

func (*SlidesInfoCmd) Run added in v0.4.2

func (c *SlidesInfoCmd) Run(ctx context.Context, flags *RootFlags) error

type TasksAddCmd added in v0.4.2

type TasksAddCmd struct {
	TasklistID string `arg:"" name:"tasklistId" help:"Task list ID"`
	Title      string `name:"title" help:"Task title (required)"`
	Notes      string `name:"notes" help:"Task notes/description"`
	Due        string `name:"due" help:"Due date/time (RFC3339)"`
	Parent     string `name:"parent" help:"Parent task ID (create as subtask)"`
	Previous   string `name:"previous" help:"Previous sibling task ID (controls ordering)"`
}

func (*TasksAddCmd) Run added in v0.4.2

func (c *TasksAddCmd) Run(ctx context.Context, flags *RootFlags) error

type TasksClearCmd added in v0.4.2

type TasksClearCmd struct {
	TasklistID string `arg:"" name:"tasklistId" help:"Task list ID"`
}

func (*TasksClearCmd) Run added in v0.4.2

func (c *TasksClearCmd) Run(ctx context.Context, flags *RootFlags) error

type TasksCmd added in v0.4.2

type TasksCmd struct {
	Lists  TasksListsCmd  `cmd:"" name:"lists" help:"List task lists"`
	List   TasksListCmd   `cmd:"" name:"list" help:"List tasks"`
	Add    TasksAddCmd    `cmd:"" name:"add" help:"Add a task" aliases:"create"`
	Update TasksUpdateCmd `cmd:"" name:"update" help:"Update a task"`
	Done   TasksDoneCmd   `cmd:"" name:"done" help:"Mark task completed" aliases:"complete"`
	Undo   TasksUndoCmd   `cmd:"" name:"undo" help:"Mark task needs action" aliases:"uncomplete,undone"`
	Delete TasksDeleteCmd `cmd:"" name:"delete" help:"Delete a task" aliases:"rm,del"`
	Clear  TasksClearCmd  `cmd:"" name:"clear" help:"Clear completed tasks"`
}

type TasksDeleteCmd added in v0.4.2

type TasksDeleteCmd struct {
	TasklistID string `arg:"" name:"tasklistId" help:"Task list ID"`
	TaskID     string `arg:"" name:"taskId" help:"Task ID"`
}

func (*TasksDeleteCmd) Run added in v0.4.2

func (c *TasksDeleteCmd) Run(ctx context.Context, flags *RootFlags) error

type TasksDoneCmd added in v0.4.2

type TasksDoneCmd struct {
	TasklistID string `arg:"" name:"tasklistId" help:"Task list ID"`
	TaskID     string `arg:"" name:"taskId" help:"Task ID"`
}

func (*TasksDoneCmd) Run added in v0.4.2

func (c *TasksDoneCmd) Run(ctx context.Context, flags *RootFlags) error

type TasksListCmd added in v0.4.2

type TasksListCmd struct {
	TasklistID    string `arg:"" name:"tasklistId" help:"Task list ID"`
	Max           int64  `name:"max" aliases:"limit" help:"Max results (max allowed: 100)" default:"20"`
	Page          string `name:"page" help:"Page token"`
	ShowCompleted bool   `name:"show-completed" help:"Include completed tasks (requires --show-hidden for some clients)" default:"true"`
	ShowDeleted   bool   `name:"show-deleted" help:"Include deleted tasks"`
	ShowHidden    bool   `name:"show-hidden" help:"Include hidden tasks"`
	ShowAssigned  bool   `name:"show-assigned" help:"Include tasks assigned to current user"`
	DueMin        string `name:"due-min" help:"Lower bound for due date filter (RFC3339)"`
	DueMax        string `name:"due-max" help:"Upper bound for due date filter (RFC3339)"`
	CompletedMin  string `name:"completed-min" help:"Lower bound for completion date filter (RFC3339)"`
	CompletedMax  string `name:"completed-max" help:"Upper bound for completion date filter (RFC3339)"`
	UpdatedMin    string `name:"updated-min" help:"Lower bound for updated time filter (RFC3339)"`
}

func (*TasksListCmd) Run added in v0.4.2

func (c *TasksListCmd) Run(ctx context.Context, flags *RootFlags) error

type TasksListsCmd added in v0.4.2

type TasksListsCmd struct {
	List   TasksListsListCmd   `cmd:"" default:"withargs" help:"List task lists"`
	Create TasksListsCreateCmd `cmd:"" name:"create" help:"Create a task list" aliases:"add,new"`
}

type TasksListsCreateCmd added in v0.4.2

type TasksListsCreateCmd struct {
	Title []string `arg:"" name:"title" help:"Task list title"`
}

func (*TasksListsCreateCmd) Run added in v0.4.2

func (c *TasksListsCreateCmd) Run(ctx context.Context, flags *RootFlags) error

type TasksListsListCmd added in v0.4.2

type TasksListsListCmd struct {
	Max  int64  `name:"max" aliases:"limit" help:"Max results (max allowed: 1000)" default:"100"`
	Page string `name:"page" help:"Page token"`
}

func (*TasksListsListCmd) Run added in v0.4.2

func (c *TasksListsListCmd) Run(ctx context.Context, flags *RootFlags) error

type TasksUndoCmd added in v0.4.2

type TasksUndoCmd struct {
	TasklistID string `arg:"" name:"tasklistId" help:"Task list ID"`
	TaskID     string `arg:"" name:"taskId" help:"Task ID"`
}

func (*TasksUndoCmd) Run added in v0.4.2

func (c *TasksUndoCmd) Run(ctx context.Context, flags *RootFlags) error

type TasksUpdateCmd added in v0.4.2

type TasksUpdateCmd struct {
	TasklistID string `arg:"" name:"tasklistId" help:"Task list ID"`
	TaskID     string `arg:"" name:"taskId" help:"Task ID"`
	Title      string `name:"title" help:"New title (set empty to clear)"`
	Notes      string `name:"notes" help:"New notes (set empty to clear)"`
	Due        string `name:"due" help:"New due date/time (RFC3339; set empty to clear)"`
	Status     string `name:"status" help:"New status: needsAction|completed (set empty to clear)"`
}

func (*TasksUpdateCmd) Run added in v0.4.2

func (c *TasksUpdateCmd) Run(ctx context.Context, kctx *kong.Context, flags *RootFlags) error

type TimeRange added in v0.5.0

type TimeRange struct {
	From     time.Time
	To       time.Time
	Location *time.Location
}

TimeRange represents a resolved time range with timezone.

func ResolveTimeRange added in v0.5.0

func ResolveTimeRange(ctx context.Context, svc *calendar.Service, flags TimeRangeFlags) (*TimeRange, error)

ResolveTimeRange resolves the time range flags into absolute times. If no flags are provided, defaults to "next 7 days" from now.

func ResolveTimeRangeWithDefaults added in v0.5.0

func ResolveTimeRangeWithDefaults(ctx context.Context, svc *calendar.Service, flags TimeRangeFlags, defaults TimeRangeDefaults) (*TimeRange, error)

ResolveTimeRangeWithDefaults resolves the time range flags into absolute times, using provided defaults when --from/--to are not set.

func (*TimeRange) FormatHuman added in v0.5.0

func (tr *TimeRange) FormatHuman() string

FormatHuman returns a human-readable description of the time range.

func (*TimeRange) FormatRFC3339 added in v0.5.0

func (tr *TimeRange) FormatRFC3339() (from, to string)

FormatRFC3339 formats a time as RFC3339 for API calls.

type TimeRangeDefaults added in v0.5.0

type TimeRangeDefaults struct {
	FromOffset   time.Duration
	ToOffset     time.Duration
	ToFromOffset time.Duration
}

TimeRangeDefaults controls the default window when flags are missing.

type TimeRangeFlags added in v0.5.0

type TimeRangeFlags struct {
	From      string `name:"from" help:"Start time (RFC3339, date, or relative: today, tomorrow, monday)"`
	To        string `name:"to" help:"End time (RFC3339, date, or relative)"`
	Today     bool   `name:"today" help:"Today only"`
	Tomorrow  bool   `name:"tomorrow" help:"Tomorrow only"`
	Week      bool   `name:"week" help:"This week (uses --week-start, default Mon)"`
	Days      int    `name:"days" help:"Next N days" default:"0"`
	WeekStart string `name:"week-start" help:"Week start day for --week (sun, mon, ...)" default:""`
}

TimeRangeFlags provides common time range options for calendar commands. Embed this struct in commands that need time range support.

type VersionCmd added in v0.4.2

type VersionCmd struct{}

func (*VersionCmd) Run added in v0.4.2

func (c *VersionCmd) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL