cmd

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version = "dev"
	Commit  = "none"
	Date    = "unknown"
)

Functions

func Execute

func Execute() int

Types

type AuthCleanCmd added in v0.2.0

type AuthCleanCmd struct{}

func (*AuthCleanCmd) Run added in v0.2.0

func (c *AuthCleanCmd) Run(ctx *RunContext) error

type AuthCmd

type AuthCmd struct {
	Login  AuthLoginCmd  `cmd:"" help:"Login to a Microsoft account"`
	Logout AuthLogoutCmd `cmd:"" help:"Logout from an account"`
	Clean  AuthCleanCmd  `cmd:"" help:"Remove all stored accounts and tokens"`
	List   AuthListCmd   `cmd:"" help:"List authenticated accounts"`
	Status AuthStatusCmd `cmd:"" help:"Show authentication status"`
}

type AuthListCmd

type AuthListCmd struct{}

func (*AuthListCmd) Run

func (c *AuthListCmd) Run(ctx *RunContext) error

type AuthLoginCmd

type AuthLoginCmd struct {
	ClientID string `help:"OAuth2 client ID" env:"OLK_CLIENT_ID"`
	TenantID string `help:"Azure AD tenant ID" env:"OLK_TENANT_ID" default:"common"`
	ReadOnly bool   `help:"Request read-only permissions"`
}

func (*AuthLoginCmd) Run

func (c *AuthLoginCmd) Run(ctx *RunContext) error

type AuthLogoutCmd

type AuthLogoutCmd struct {
	Email string `arg:"" optional:"" help:"Account email to logout (default: current account)"`
}

func (*AuthLogoutCmd) Run

func (c *AuthLogoutCmd) Run(ctx *RunContext) error

type AuthStatusCmd

type AuthStatusCmd struct{}

func (*AuthStatusCmd) Run

func (c *AuthStatusCmd) Run(ctx *RunContext) error

type CLI

type CLI struct {
	RootFlags

	Auth     AuthCmd     `cmd:"" help:"Authentication commands"`
	Mail     MailCmd     `cmd:"" help:"Mail commands"`
	Calendar CalendarCmd `cmd:"" help:"Calendar commands"`
	Contacts ContactsCmd `cmd:"" help:"Contacts commands"`
	Todo     TodoCmd     `cmd:"" help:"Microsoft To Do tasks"`
	People   PeopleCmd   `cmd:"" help:"People directory search"`
	Version  VersionCmd  `cmd:"" help:"Show version information"`
	Whoami   WhoamiCmd   `cmd:"" help:"Show current user profile"`

	// Desire path shortcuts
	Send   SendCmd   `cmd:"" help:"Send an email (shortcut for mail send)" hidden:""`
	Ls     LsCmd     `cmd:"" help:"List inbox (shortcut for mail list)" hidden:""`
	Inbox  InboxCmd  `cmd:"" help:"List inbox (shortcut for mail list)" hidden:""`
	Search SearchCmd `cmd:"" help:"Search mail (shortcut for mail search)" hidden:""`
	Today  TodayCmd  `cmd:"" help:"Today's events (shortcut for calendar events --days 1)" hidden:""`
	Week   WeekCmd   `cmd:"" help:"This week's events (shortcut for calendar events --days 7)" hidden:""`
}

type CalendarAvailabilityCmd added in v0.2.0

type CalendarAvailabilityCmd struct {
	Emails []string `help:"Email addresses to check" required:"" short:"e"`
	Days   int      `help:"Days to look ahead" default:"1" short:"d"`
	After  string   `help:"Start date (ISO 8601)"`
	Before string   `help:"End date (ISO 8601)"`
}

CalendarAvailabilityCmd checks free/busy availability for one or more users

func (*CalendarAvailabilityCmd) Run added in v0.2.0

type CalendarCalendarsCmd

type CalendarCalendarsCmd struct{}

func (*CalendarCalendarsCmd) Run

func (c *CalendarCalendarsCmd) Run(ctx *RunContext) error

type CalendarCmd

type CalendarCmd struct {
	Events       CalendarEventsCmd       `cmd:"" help:"List calendar events"`
	Get          CalendarGetCmd          `cmd:"" help:"Get event details"`
	Create       CalendarCreateCmd       `cmd:"" help:"Create a calendar event"`
	Update       CalendarUpdateCmd       `cmd:"" help:"Update a calendar event"`
	Delete       CalendarDeleteCmd       `cmd:"" help:"Delete a calendar event"`
	Respond      CalendarRespondCmd      `cmd:"" help:"Respond to an event invitation"`
	Calendars    CalendarCalendarsCmd    `cmd:"" help:"List available calendars"`
	Availability CalendarAvailabilityCmd `cmd:"" help:"Check availability / free-busy"`
	View         CalendarViewCmd         `cmd:"" help:"Calendar view with expanded recurring events"`
	FindTimes    CalendarFindTimesCmd    `cmd:"" help:"Find available meeting times" name:"find-times"`
}

type CalendarCreateCmd

type CalendarCreateCmd struct {
	Subject       string   `help:"Event subject" required:"" short:"s"`
	Start         string   `help:"Start time (ISO 8601)" required:""`
	End           string   `help:"End time (ISO 8601)" required:""`
	Location      string   `help:"Event location" short:"l"`
	Attendees     []string `help:"Attendee email addresses" short:"a"`
	AllDay        bool     `help:"All-day event"`
	OnlineMeeting bool     `help:"Create online meeting"`
}

func (*CalendarCreateCmd) Run

func (c *CalendarCreateCmd) Run(ctx *RunContext) error

type CalendarDeleteCmd

type CalendarDeleteCmd struct {
	ID string `arg:"" help:"Event ID"`
}

func (*CalendarDeleteCmd) Run

func (c *CalendarDeleteCmd) Run(ctx *RunContext) error

type CalendarEventsCmd

type CalendarEventsCmd struct {
	Days     int    `help:"Number of days to look ahead" default:"7" short:"d"`
	After    string `help:"Start date (ISO 8601)"`
	Before   string `help:"End date (ISO 8601)"`
	Calendar string `help:"Calendar ID"`
	Top      int32  `help:"Max events to return" default:"25" short:"n"`
}

func (*CalendarEventsCmd) Run

func (c *CalendarEventsCmd) Run(ctx *RunContext) error

type CalendarFindTimesCmd added in v0.3.0

type CalendarFindTimesCmd struct {
	Attendees []string `help:"Attendee email addresses" required:"" short:"a"`
	Duration  int32    `help:"Meeting duration in minutes" default:"60" short:"d"`
	After     string   `help:"Search after date (ISO 8601)"`
	Before    string   `help:"Search before date (ISO 8601)"`
}

func (*CalendarFindTimesCmd) Run added in v0.3.0

func (c *CalendarFindTimesCmd) Run(ctx *RunContext) error

type CalendarGetCmd

type CalendarGetCmd struct {
	ID string `arg:"" help:"Event ID"`
}

func (*CalendarGetCmd) Run

func (c *CalendarGetCmd) Run(ctx *RunContext) error

type CalendarRespondCmd

type CalendarRespondCmd struct {
	ID       string `arg:"" help:"Event ID"`
	Response string `arg:"" help:"Response: accept|decline|tentative" enum:"accept,decline,tentative"`
}

func (*CalendarRespondCmd) Run

func (c *CalendarRespondCmd) Run(ctx *RunContext) error

type CalendarUpdateCmd

type CalendarUpdateCmd struct {
	ID       string `arg:"" help:"Event ID"`
	Subject  string `help:"New subject" short:"s"`
	Start    string `help:"New start time (ISO 8601)"`
	End      string `help:"New end time (ISO 8601)"`
	Location string `help:"New location" short:"l"`
}

func (*CalendarUpdateCmd) Run

func (c *CalendarUpdateCmd) Run(ctx *RunContext) error

type CalendarViewCmd added in v0.3.0

type CalendarViewCmd struct {
	Days     int    `help:"Number of days to show" default:"7" short:"d"`
	After    string `help:"Start date (ISO 8601)"`
	Before   string `help:"End date (ISO 8601)"`
	Calendar string `help:"Calendar ID"`
	Top      int32  `help:"Max events to return" default:"50" short:"n"`
}

func (*CalendarViewCmd) Run added in v0.3.0

func (c *CalendarViewCmd) Run(ctx *RunContext) error

type ContactsCmd

type ContactsCmd struct {
	List   ContactsListCmd   `cmd:"" help:"List contacts"`
	Get    ContactsGetCmd    `cmd:"" help:"Get contact details"`
	Create ContactsCreateCmd `cmd:"" help:"Create a contact"`
	Update ContactsUpdateCmd `cmd:"" help:"Update a contact"`
	Delete ContactsDeleteCmd `cmd:"" help:"Delete a contact"`
	Search ContactsSearchCmd `cmd:"" help:"Search contacts"`
}

type ContactsCreateCmd

type ContactsCreateCmd struct {
	FirstName     string `help:"First name" required:""`
	LastName      string `help:"Last name" required:""`
	Email         string `help:"Email address" short:"e"`
	MobilePhone   string `help:"Mobile phone number" short:"p" name:"mobile-phone"`
	BusinessPhone string `help:"Business phone number" name:"business-phone"`
	HomePhone     string `help:"Home phone number" name:"home-phone"`
	Company       string `help:"Company name" short:"c"`
	Title         string `help:"Job title"`
}

func (*ContactsCreateCmd) Run

func (c *ContactsCreateCmd) Run(ctx *RunContext) error

type ContactsDeleteCmd

type ContactsDeleteCmd struct {
	ID string `arg:"" help:"Contact ID"`
}

func (*ContactsDeleteCmd) Run

func (c *ContactsDeleteCmd) Run(ctx *RunContext) error

type ContactsGetCmd

type ContactsGetCmd struct {
	ID string `arg:"" help:"Contact ID"`
}

func (*ContactsGetCmd) Run

func (c *ContactsGetCmd) Run(ctx *RunContext) error

type ContactsListCmd

type ContactsListCmd struct {
	Top int32 `help:"Max contacts to return" default:"25" short:"n"`
}

func (*ContactsListCmd) Run

func (c *ContactsListCmd) Run(ctx *RunContext) error

type ContactsSearchCmd

type ContactsSearchCmd struct {
	Query string `arg:"" help:"Search query"`
	Top   int32  `help:"Max results" default:"25" short:"n"`
}

func (*ContactsSearchCmd) Run

func (c *ContactsSearchCmd) Run(ctx *RunContext) error

type ContactsUpdateCmd

type ContactsUpdateCmd struct {
	ID            string `arg:"" help:"Contact ID"`
	FirstName     string `help:"First name"`
	LastName      string `help:"Last name"`
	Email         string `help:"Email address" short:"e"`
	MobilePhone   string `help:"Mobile phone number" short:"p" name:"mobile-phone"`
	BusinessPhone string `help:"Business phone number" name:"business-phone"`
	HomePhone     string `help:"Home phone number" name:"home-phone"`
	Company       string `help:"Company name" short:"c"`
	Title         string `help:"Job title"`
}

func (*ContactsUpdateCmd) Run

func (c *ContactsUpdateCmd) Run(ctx *RunContext) error

type InboxCmd

type InboxCmd struct {
	Top    int32 `help:"Number of messages" default:"25" short:"n"`
	Unread bool  `help:"Unread only" short:"u"`
}

InboxCmd is a shortcut for `olk mail list`

func (*InboxCmd) Run

func (c *InboxCmd) Run(ctx *RunContext) error

type LsCmd

type LsCmd struct {
	Folder string `help:"Mail folder" short:"f"`
	Top    int32  `help:"Number of messages" default:"25" short:"n"`
	Unread bool   `help:"Unread only" short:"u"`
}

LsCmd is a shortcut for `olk mail list`

func (*LsCmd) Run

func (c *LsCmd) Run(ctx *RunContext) error

type MailAttachmentsCmd

type MailAttachmentsCmd struct {
	ID           string `arg:"" help:"Message ID"`
	Save         bool   `help:"Download all attachments" default:"false"`
	Out          string `help:"Output directory for downloads" default:"." type:"path"`
	AttachmentID string `help:"Download a specific attachment by ID" name:"attachment-id"`
}

func (*MailAttachmentsCmd) Run

func (c *MailAttachmentsCmd) Run(ctx *RunContext) error

type MailCategorizeCmd added in v0.2.0

type MailCategorizeCmd struct {
	ID         string   `arg:"" help:"Message ID"`
	Categories []string `help:"Category names" required:"" short:"c"`
}

MailCategorizeCmd sets categories on a message

func (*MailCategorizeCmd) Run added in v0.2.0

func (c *MailCategorizeCmd) Run(ctx *RunContext) error

type MailCmd

type MailCmd struct {
	List        MailListCmd        `cmd:"" help:"List messages in inbox"`
	Get         MailGetCmd         `cmd:"" help:"Get a message"`
	Send        MailSendCmd        `cmd:"" help:"Send a message"`
	Search      MailSearchCmd      `cmd:"" help:"Search messages"`
	Reply       MailReplyCmd       `cmd:"" help:"Reply to a message"`
	Forward     MailForwardCmd     `cmd:"" help:"Forward a message"`
	Move        MailMoveCmd        `cmd:"" help:"Move a message to a folder"`
	Delete      MailDeleteCmd      `cmd:"" help:"Delete a message"`
	Mark        MailMarkCmd        `cmd:"" help:"Mark message as read/unread"`
	Folders     MailFoldersCmd     `cmd:"" help:"List mail folders"`
	Attachments MailAttachmentsCmd `cmd:"" help:"List/download attachments"`
	Drafts      MailDraftsCmd      `cmd:"" help:"Draft message operations"`
	Flag        MailFlagCmd        `cmd:"" help:"Set follow-up flag on a message"`
	Importance  MailImportanceCmd  `cmd:"" help:"Set importance on a message"`
	Categorize  MailCategorizeCmd  `cmd:"" help:"Set categories on a message"`
	OOO         MailOOOCmd         `cmd:"" help:"Out-of-office / auto-reply settings"`
	Rules       MailRulesCmd       `cmd:"" help:"Inbox rules"`
}

type MailDeleteCmd

type MailDeleteCmd struct {
	ID string `arg:"" help:"Message ID"`
}

func (*MailDeleteCmd) Run

func (c *MailDeleteCmd) Run(ctx *RunContext) error

type MailDraftsCmd added in v0.2.0

type MailDraftsCmd struct {
	List   MailDraftsListCmd   `cmd:"" help:"List draft messages"`
	Create MailDraftsCreateCmd `cmd:"" help:"Create a draft message"`
	Send   MailDraftsSendCmd   `cmd:"" help:"Send a draft message"`
	Delete MailDraftsDeleteCmd `cmd:"" help:"Delete a draft message"`
}

MailDraftsCmd groups draft-related subcommands

type MailDraftsCreateCmd added in v0.2.0

type MailDraftsCreateCmd struct {
	To      []string `help:"Recipient email addresses" required:"" short:"t"`
	Subject string   `help:"Email subject" required:"" short:"s"`
	Body    string   `help:"Email body" short:"b"`
	CC      []string `help:"CC recipients"`
	BCC     []string `help:"BCC recipients"`
	HTML    bool     `help:"Body is HTML"`
}

MailDraftsCreateCmd creates a new draft message

func (*MailDraftsCreateCmd) Run added in v0.2.0

func (c *MailDraftsCreateCmd) Run(ctx *RunContext) error

type MailDraftsDeleteCmd added in v0.2.0

type MailDraftsDeleteCmd struct {
	ID string `arg:"" help:"Draft message ID"`
}

MailDraftsDeleteCmd deletes a draft message

func (*MailDraftsDeleteCmd) Run added in v0.2.0

func (c *MailDraftsDeleteCmd) Run(ctx *RunContext) error

type MailDraftsListCmd added in v0.2.0

type MailDraftsListCmd struct {
	Top int32 `help:"Number of drafts to return" default:"25" short:"n"`
}

MailDraftsListCmd lists draft messages

func (*MailDraftsListCmd) Run added in v0.2.0

func (c *MailDraftsListCmd) Run(ctx *RunContext) error

type MailDraftsSendCmd added in v0.2.0

type MailDraftsSendCmd struct {
	ID string `arg:"" help:"Draft message ID"`
}

MailDraftsSendCmd sends an existing draft

func (*MailDraftsSendCmd) Run added in v0.2.0

func (c *MailDraftsSendCmd) Run(ctx *RunContext) error

type MailFlagCmd added in v0.2.0

type MailFlagCmd struct {
	ID     string `arg:"" help:"Message ID"`
	Status string `arg:"" help:"Flag status: flagged|complete|notFlagged" enum:"flagged,complete,notFlagged" default:"flagged"`
}

MailFlagCmd sets the follow-up flag on a message

func (*MailFlagCmd) Run added in v0.2.0

func (c *MailFlagCmd) Run(ctx *RunContext) error

type MailFoldersCmd

type MailFoldersCmd struct{}

func (*MailFoldersCmd) Run

func (c *MailFoldersCmd) Run(ctx *RunContext) error

type MailForwardCmd

type MailForwardCmd struct {
	ID      string   `arg:"" help:"Message ID to forward"`
	To      []string `help:"Recipient email addresses" required:"" short:"t"`
	Comment string   `help:"Comment to include" short:"c"`
}

func (*MailForwardCmd) Run

func (c *MailForwardCmd) Run(ctx *RunContext) error

type MailGetCmd

type MailGetCmd struct {
	ID     string `arg:"" help:"Message ID"`
	Format string `help:"Output format: full|text|html" default:"full" enum:"full,text,html"`
}

func (*MailGetCmd) Run

func (c *MailGetCmd) Run(ctx *RunContext) error

type MailImportanceCmd added in v0.2.0

type MailImportanceCmd struct {
	ID         string `arg:"" help:"Message ID"`
	Importance string `arg:"" help:"Importance: low|normal|high" enum:"low,normal,high"`
}

MailImportanceCmd sets the importance level on a message

func (*MailImportanceCmd) Run added in v0.2.0

func (c *MailImportanceCmd) Run(ctx *RunContext) error

type MailListCmd

type MailListCmd struct {
	Folder  string `help:"Mail folder ID or well-known name" short:"f" env:"OLK_MAIL_FOLDER"`
	Top     int32  `help:"Number of messages to return" default:"25" short:"n"`
	Unread  bool   `help:"Show only unread messages" short:"u"`
	From    string `help:"Filter by sender email"`
	After   string `help:"Filter messages after date (ISO 8601)"`
	Before  string `help:"Filter messages before date (ISO 8601)"`
	Focused bool   `help:"Show only Focused Inbox messages"`
	Other   bool   `help:"Show only Other Inbox messages"`
}

func (*MailListCmd) Run

func (c *MailListCmd) Run(ctx *RunContext) error

type MailMarkCmd

type MailMarkCmd struct {
	ID     string `arg:"" help:"Message ID"`
	Read   bool   `help:"Mark as read" xor:"state"`
	Unread bool   `help:"Mark as unread" xor:"state"`
}

func (*MailMarkCmd) Run

func (c *MailMarkCmd) Run(ctx *RunContext) error

type MailMoveCmd

type MailMoveCmd struct {
	ID     string `arg:"" help:"Message ID"`
	Folder string `arg:"" help:"Destination folder ID or well-known name"`
}

func (*MailMoveCmd) Run

func (c *MailMoveCmd) Run(ctx *RunContext) error

type MailOOOCmd added in v0.2.0

type MailOOOCmd struct {
	Get MailOOOGetCmd `cmd:"" help:"Get auto-reply settings"`
	Set MailOOOSetCmd `cmd:"" help:"Set auto-reply"`
	Off MailOOOOffCmd `cmd:"" help:"Disable auto-reply"`
}

MailOOOCmd is the parent command for out-of-office / auto-reply settings

type MailOOOGetCmd added in v0.2.0

type MailOOOGetCmd struct{}

MailOOOGetCmd retrieves the current auto-reply settings

func (*MailOOOGetCmd) Run added in v0.2.0

func (c *MailOOOGetCmd) Run(ctx *RunContext) error

type MailOOOOffCmd added in v0.2.0

type MailOOOOffCmd struct{}

MailOOOOffCmd disables auto-reply

func (*MailOOOOffCmd) Run added in v0.2.0

func (c *MailOOOOffCmd) Run(ctx *RunContext) error

type MailOOOSetCmd added in v0.2.0

type MailOOOSetCmd struct {
	Message         string `help:"Auto-reply message (internal)" required:"" short:"m"`
	ExternalMessage string `help:"Auto-reply message for external senders (defaults to --message)" short:"x"`
	Start           string `help:"Start date/time (ISO 8601, enables scheduled mode)"`
	End             string `help:"End date/time (ISO 8601, enables scheduled mode)"`
	Audience        string `help:"External audience: none|contactsOnly|all" default:"all" enum:"none,contactsOnly,all"`
}

MailOOOSetCmd enables auto-reply with the given message

func (*MailOOOSetCmd) Run added in v0.2.0

func (c *MailOOOSetCmd) Run(ctx *RunContext) error

type MailReplyCmd

type MailReplyCmd struct {
	ID       string `arg:"" help:"Message ID to reply to"`
	Body     string `help:"Reply body" required:"" short:"b"`
	ReplyAll bool   `help:"Reply to all recipients" short:"a"`
}

func (*MailReplyCmd) Run

func (c *MailReplyCmd) Run(ctx *RunContext) error

type MailRulesCmd added in v0.3.0

type MailRulesCmd struct {
	List   MailRulesListCmd   `cmd:"" help:"List inbox rules"`
	Create MailRulesCreateCmd `cmd:"" help:"Create an inbox rule"`
	Delete MailRulesDeleteCmd `cmd:"" help:"Delete an inbox rule"`
}

type MailRulesCreateCmd added in v0.3.0

type MailRulesCreateCmd struct {
	Name           string `help:"Rule name" required:"" short:"n"`
	From           string `help:"Match sender email"`
	SubjectContain string `help:"Match subject containing text" name:"subject-contains"`
	HasAttachment  bool   `help:"Match messages with attachments"`
	Move           string `help:"Move to folder ID or well-known name"`
	MarkRead       bool   `help:"Mark as read"`
	Delete         bool   `help:"Delete the message"`
	ForwardTo      string `help:"Forward to email address" name:"forward-to"`
	SetImportance  string `help:"Set importance: low|normal|high" name:"set-importance" enum:",low,normal,high" default:""`
}

func (*MailRulesCreateCmd) Run added in v0.3.0

func (c *MailRulesCreateCmd) Run(ctx *RunContext) error

type MailRulesDeleteCmd added in v0.3.0

type MailRulesDeleteCmd struct {
	ID string `arg:"" help:"Rule ID"`
}

func (*MailRulesDeleteCmd) Run added in v0.3.0

func (c *MailRulesDeleteCmd) Run(ctx *RunContext) error

type MailRulesListCmd added in v0.3.0

type MailRulesListCmd struct{}

func (*MailRulesListCmd) Run added in v0.3.0

func (c *MailRulesListCmd) Run(ctx *RunContext) error

type MailSearchCmd

type MailSearchCmd struct {
	Query string `arg:"" help:"Search query (KQL syntax)"`
	Top   int32  `help:"Number of results" default:"25" short:"n"`
}

func (*MailSearchCmd) Run

func (c *MailSearchCmd) Run(ctx *RunContext) error

type MailSendCmd

type MailSendCmd struct {
	To          []string `help:"Recipient email addresses" required:"" short:"t"`
	Subject     string   `help:"Email subject" required:"" short:"s"`
	Body        string   `help:"Email body" short:"b"`
	CC          []string `help:"CC recipients"`
	BCC         []string `help:"BCC recipients"`
	HTML        bool     `help:"Send body as HTML"`
	Attach      []string `help:"File paths to attach" type:"path"`
	Importance  string   `help:"Message importance: low|normal|high" enum:",low,normal,high" default:""`
	ReadReceipt bool     `help:"Request a read receipt"`
}

func (*MailSendCmd) Run

func (c *MailSendCmd) Run(ctx *RunContext) error

type PeopleCmd added in v0.3.0

type PeopleCmd struct {
	Search PeopleSearchCmd `cmd:"" help:"Search people directory"`
}

type PeopleSearchCmd added in v0.3.0

type PeopleSearchCmd struct {
	Query string `arg:"" help:"Search query"`
	Top   int32  `help:"Max results to return" default:"25" short:"n"`
}

func (*PeopleSearchCmd) Run added in v0.3.0

func (c *PeopleSearchCmd) Run(ctx *RunContext) error

type RootFlags

type RootFlags struct {
	JSON        bool   `help:"Output as JSON" env:"OLK_JSON"`
	Plain       bool   `help:"Output as plain TSV" env:"OLK_PLAIN"`
	Account     string `help:"Account email to use" env:"OLK_ACCOUNT"`
	Verbose     bool   `help:"Verbose output" short:"v" env:"OLK_VERBOSE"`
	DryRun      bool   `help:"Dry run mode" env:"OLK_DRY_RUN"`
	Force       bool   `help:"Force operation" env:"OLK_FORCE"`
	Color       string `help:"Color mode: auto|never|always" default:"auto" env:"OLK_COLOR" enum:"auto,never,always"`
	Select      string `help:"Comma-separated fields to output" env:"OLK_SELECT"`
	ResultsOnly bool   `help:"Output only the results array (no envelope)" env:"OLK_RESULTS_ONLY"`
	Timeout     int    `help:"Request timeout in seconds" default:"60" env:"OLK_TIMEOUT"`
}

type RunContext

type RunContext struct {
	Ctx   context.Context
	Flags *RootFlags
	// contains filtered or unexported fields
}

func (*RunContext) Authenticator

func (r *RunContext) Authenticator(clientID, tenantID string) (*msauth.Authenticator, error)

Authenticator returns the auth manager

func (*RunContext) Config

func (r *RunContext) Config() (*config.Config, error)

Config returns the config, loading if needed

func (*RunContext) GraphClient

func (r *RunContext) GraphClient() (*graphapi.Client, error)

GraphClient returns the Graph API client for the active account

func (*RunContext) Printer

func (r *RunContext) Printer() *outfmt.Printer

Printer returns an output printer based on flags

func (*RunContext) Store

func (r *RunContext) Store() (secrets.Store, error)

Store returns the keyring store, initializing if needed

type SearchCmd

type SearchCmd struct {
	Query string `arg:"" help:"Search query"`
	Top   int32  `help:"Max results" default:"25" short:"n"`
}

SearchCmd is a shortcut for `olk mail search`

func (*SearchCmd) Run

func (c *SearchCmd) Run(ctx *RunContext) error

type SendCmd

type SendCmd struct {
	To          []string `help:"Recipient email addresses" required:"" short:"t"`
	Subject     string   `help:"Email subject" required:"" short:"s"`
	Body        string   `help:"Email body" short:"b"`
	CC          []string `help:"CC recipients"`
	BCC         []string `help:"BCC recipients"`
	HTML        bool     `help:"Send body as HTML"`
	Attach      []string `help:"File paths to attach" type:"path"`
	ReadReceipt bool     `help:"Request a read receipt"`
}

SendCmd is a shortcut for `olk mail send`

func (*SendCmd) Run

func (c *SendCmd) Run(ctx *RunContext) error

type TodayCmd

type TodayCmd struct {
	Top int32 `help:"Max events" default:"25" short:"n"`
}

TodayCmd is a shortcut for `olk calendar events --days 1`

func (*TodayCmd) Run

func (c *TodayCmd) Run(ctx *RunContext) error

type TodoCmd added in v0.2.0

type TodoCmd struct {
	Lists    TodoListsCmd    `cmd:"" help:"List task lists"`
	List     TodoListCmd     `cmd:"" help:"List tasks in a list"`
	Get      TodoGetCmd      `cmd:"" help:"Get task details"`
	Create   TodoCreateCmd   `cmd:"" help:"Create a task"`
	Complete TodoCompleteCmd `cmd:"" help:"Mark a task as complete"`
	Delete   TodoDeleteCmd   `cmd:"" help:"Delete a task"`
}

TodoCmd is the top-level command group for Microsoft To Do tasks.

type TodoCompleteCmd added in v0.2.0

type TodoCompleteCmd struct {
	ID   string `arg:"" help:"Task ID"`
	List string `help:"Task list ID" env:"OLK_TODO_LIST"`
}

TodoCompleteCmd marks a task as complete.

func (*TodoCompleteCmd) Run added in v0.2.0

func (c *TodoCompleteCmd) Run(ctx *RunContext) error

type TodoCreateCmd added in v0.2.0

type TodoCreateCmd struct {
	List       string `help:"Task list ID" env:"OLK_TODO_LIST"`
	Title      string `help:"Task title" required:"" short:"t"`
	Due        string `help:"Due date (ISO 8601, e.g. 2024-12-31)" short:"d"`
	Importance string `help:"Importance level" enum:"low,normal,high," default:""`
	Body       string `help:"Task body text" short:"b"`
}

TodoCreateCmd creates a new task.

func (*TodoCreateCmd) Run added in v0.2.0

func (c *TodoCreateCmd) Run(ctx *RunContext) error

type TodoDeleteCmd added in v0.2.0

type TodoDeleteCmd struct {
	ID   string `arg:"" help:"Task ID"`
	List string `help:"Task list ID" env:"OLK_TODO_LIST"`
}

TodoDeleteCmd deletes a task.

func (*TodoDeleteCmd) Run added in v0.2.0

func (c *TodoDeleteCmd) Run(ctx *RunContext) error

type TodoGetCmd added in v0.2.0

type TodoGetCmd struct {
	ID   string `arg:"" help:"Task ID"`
	List string `help:"Task list ID" env:"OLK_TODO_LIST"`
}

TodoGetCmd gets details of a single task.

func (*TodoGetCmd) Run added in v0.2.0

func (c *TodoGetCmd) Run(ctx *RunContext) error

type TodoListCmd added in v0.2.0

type TodoListCmd struct {
	List   string `help:"Task list ID" env:"OLK_TODO_LIST"`
	Top    int32  `help:"Number of tasks to return" default:"25" short:"n"`
	Status string `help:"Filter by status" enum:"notStarted,inProgress,completed,waitingOnOthers,deferred," default:""`
}

TodoListCmd lists tasks in a task list.

func (*TodoListCmd) Run added in v0.2.0

func (c *TodoListCmd) Run(ctx *RunContext) error

type TodoListsCmd added in v0.2.0

type TodoListsCmd struct{}

TodoListsCmd lists all task lists.

func (*TodoListsCmd) Run added in v0.2.0

func (c *TodoListsCmd) Run(ctx *RunContext) error

type VersionCmd

type VersionCmd struct{}

func (*VersionCmd) Run

func (c *VersionCmd) Run(ctx *RunContext) error

type WeekCmd

type WeekCmd struct {
	Top int32 `help:"Max events" default:"25" short:"n"`
}

WeekCmd is a shortcut for `olk calendar events --days 7`

func (*WeekCmd) Run

func (c *WeekCmd) Run(ctx *RunContext) error

type WhoamiCmd added in v0.2.0

type WhoamiCmd struct{}

WhoamiCmd displays the current user's profile information

func (*WhoamiCmd) Run added in v0.2.0

func (c *WhoamiCmd) Run(ctx *RunContext) error

Jump to

Keyboard shortcuts

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