Versions in this module Expand all Collapse all v1 v1.0.0 Jan 30, 2026 Changes in this version + const DateFormat + const DateTimeFormat + const DisplayDateFormat + const DisplayDateLong + const DisplayDateTime + const DisplayDateTimeWithTZ + const DisplayMonthYear + const DisplayTimeFormat + const DisplayTimeWithTZ + const DisplayWeekdayComma + const DisplayWeekdayCommaAt + const DisplayWeekdayDateTime + const DisplayWeekdayFull + const DisplayWeekdayFullWithTZ + const DisplayWeekdayShort + const DisplayWeekdayShortWithTZ + const ErrCodeAuthFailed + const ErrCodeInvalidInput + const ErrCodeNetworkError + const ErrCodeNotConfigured + const ErrCodeNotFound + const ErrCodePermissionDenied + const ErrCodeRateLimited + const ErrCodeServerError + const ShortDate + const ShortDateTime + const TimeFormat + var Blue = color.New(color.FgBlue) + var Bold = color.New(color.Bold) + var BoldBlue = color.New(color.FgBlue, color.Bold) + var BoldCyan = color.New(color.FgCyan, color.Bold) + var BoldGreen = color.New(color.FgGreen, color.Bold) + var BoldRed = color.New(color.FgRed, color.Bold) + var BoldWhite = color.New(color.FgWhite, color.Bold) + var BoldYellow = color.New(color.FgYellow, color.Bold) + var Cyan = color.New(color.FgCyan) + var Dim = color.New(color.Faint) + var Green = color.New(color.FgGreen) + var HiBlack = color.New(color.FgHiBlack) + var Red = color.New(color.FgRed) + var Reset = color.New(color.Reset) + var SpinnerFrames = struct{ ... } + var Yellow = color.New(color.FgYellow) + func AddForceFlag(cmd *cobra.Command, target *bool) + func AddFormatFlag(cmd *cobra.Command, target *string) + func AddIDFlag(cmd *cobra.Command, target *bool) + func AddJSONFlag(cmd *cobra.Command, target *bool) + func AddLimitFlag(cmd *cobra.Command, target *int, defaultValue int) + func AddOutputFlags(cmd *cobra.Command) + func AddPageTokenFlag(cmd *cobra.Command, target *string) + func AddVerboseFlag(cmd *cobra.Command, target *bool) + func AddYesFlag(cmd *cobra.Command, target *bool) + func Confirm(prompt string, defaultYes bool) bool + func CopyToClipboard(text string) error + func CreateContext() (context.Context, context.CancelFunc) + func CreateContextWithTimeout(timeout time.Duration) (context.Context, context.CancelFunc) + func CreateLongContext() (context.Context, context.CancelFunc) + func Debug(msg string, args ...any) + func DebugAPI(operation string, args ...any) + func DebugHTTP(method, url string, statusCode int, duration string) + func Error(msg string, args ...any) + func FetchAllPages[T any](ctx context.Context, config PaginationConfig, fetcher PageFetcher[T]) ([]T, error) + func FetchAllWithProgress[T any](ctx context.Context, fetcher PageFetcher[T], maxItems int) ([]T, error) + func FindExecutableInPath(name string) (string, error) + func FormatDate(t time.Time) string + func FormatDisplayDate(t time.Time) string + func FormatError(err error) string + func FormatParticipant(p domain.EmailParticipant) string + func FormatParticipants(participants []domain.EmailParticipant) string + func FormatSize(bytes int64) string + func FormatTimeAgo(t time.Time) string + func GetAPIKey() (string, error) + func GetCachedNylasClient() (ports.NylasClient, error) + func GetConfigPath(cmd *cobra.Command) string + func GetConfigStore(cmd *cobra.Command) ports.ConfigStore + func GetGrantID(args []string) (string, error) + func GetLogger() *slog.Logger + func GetNylasClient() (ports.NylasClient, error) + func GetOutputOptions(cmd *cobra.Command, w io.Writer) ports.OutputOptions + func GetOutputWriter(cmd *cobra.Command) ports.OutputWriter + func GetOutputWriterTo(cmd *cobra.Command, w io.Writer) ports.OutputWriter + func Info(msg string, args ...any) + func InitLogger(debug, quiet bool) + func IsDebug() bool + func IsJSON(cmd *cobra.Command) bool + func IsQuiet() bool + func IsRetryable(err error) bool + func IsRetryableStatusCode(statusCode int) bool + func IsWide(cmd *cobra.Command) bool + func NewDeleteCommand(config DeleteCommandConfig) *cobra.Command + func NewInputError(message string) error + func NewMutuallyExclusiveError(flag1, flag2 string) error + func NewShowCommand(config ShowCommandConfig) *cobra.Command + func NewUserError(message, suggestion string) error + func NewUserErrorWithSuggestions(message string, suggestions ...string) error + func ParseDate(s string) (time.Time, error) + func ParseDuration(s string) (time.Duration, error) + func ParseTime(s string) (time.Time, error) + func ParseTimeOfDay(s string) (time.Time, error) + func ParseTimeOfDayInLocation(s string, loc *time.Location) (time.Time, error) + func PrintDoubleSeparator(width int) + func PrintEmptyState(resourceName string) + func PrintEmptyStateWithHint(resourceName, hint string) + func PrintError(format string, args ...any) + func PrintFormattedError(err error) + func PrintInfo(format string, args ...any) + func PrintJSON(data any) error + func PrintListHeader(count int, resourceName string) + func PrintSeparator(width int) + func PrintSuccess(format string, args ...any) + func PrintUpdateSuccess(resourceName string, details ...string) + func PrintWarning(format string, args ...any) + func RemoveTagWithContent(s, tag string) string + func ResetCachedClient() + func ResetLogger() + func RunDelete(config DeleteConfig) error + func RunWithSpinner(message string, fn func() error) error + func RunWithSpinnerResult[T any](message string, fn func() (T, error)) (T, error) + func SafeCommand(name string, args ...string) (*exec.Cmd, error) + func StripHTML(s string) string + func Truncate(s string, maxLen int) string + func ValidateAtLeastOne(name string, values ...string) error + func ValidateEmail(name, value string) error + func ValidateExecutablePath(path string) error + func ValidateOneOf(name, value string, allowed []string) error + func ValidateRequired(name, value string) error + func ValidateRequiredArg(args []string, name string) error + func ValidateRequiredFlag(flagName, value string) error + func ValidateURL(name, value string) error + func Warn(msg string, args ...any) + func WithClientNoGrant[T any](fn func(ctx context.Context, client ports.NylasClient) (T, error)) (T, error) + func WithClient[T any](args []string, ...) (T, error) + func WithRetry(ctx context.Context, config RetryConfig, fn RetryFunc) error + func WrapCancelError(resource string, err error) error + func WrapCreateError(resource string, err error) error + func WrapDateParseError(flagName string, err error) error + func WrapDecodeError(resource string, err error) error + func WrapDeleteError(resource string, err error) error + func WrapDownloadError(resource string, err error) error + func WrapFetchError(resource string, err error) error + func WrapGenerateError(resource string, err error) error + func WrapGetError(resource string, err error) error + func WrapListError(resource string, err error) error + func WrapLoadError(resource string, err error) error + func WrapMarshalError(resource string, err error) error + func WrapRecipientError(recipientType string, err error) error + func WrapSaveError(resource string, err error) error + func WrapSearchError(resource string, err error) error + func WrapSendError(resource string, err error) error + func WrapUpdateError(resource string, err error) error + func WrapWriteError(resource string, err error) error + func WriteListWithColumns(cmd *cobra.Command, data any, columns []ports.Column) error + func WriteListWithWideColumns(cmd *cobra.Command, data any, normalCols, wideCols []ports.Column) error + type CLIError struct + Code string + Err error + Message string + Suggestion string + Suggestions []string + func WrapError(err error) *CLIError + func (e *CLIError) Error() string + func (e *CLIError) Unwrap() error + type Counter struct + func NewCounter(message string) *Counter + func (c *Counter) Count() int + func (c *Counter) Finish() + func (c *Counter) Increment() + type DeleteCommandConfig struct + Aliases []string + DeleteFunc func(ctx context.Context, grantID, resourceID string) error + DeleteFuncNoGrant func(ctx context.Context, resourceID string) error + GetClient func() (ports.NylasClient, error) + GetDetailsFunc func(ctx context.Context, resourceID string) (string, error) + Long string + RequiresGrant bool + ResourceName string + Short string + ShowDetailsFunc func(ctx context.Context, grantID, resourceID string) (string, error) + Use string + type DeleteConfig struct + DeleteFunc func(ctx context.Context, grantID, resourceID string) error + Force bool + GrantID string + ResourceID string + ResourceName string + type Formatter struct + func NewFormatter(format OutputFormat) *Formatter + func (f *Formatter) Format(data any) error + func (f *Formatter) SetWriter(w io.Writer) *Formatter + type ListSetup struct + Cancel context.CancelFunc + Client ports.NylasClient + Ctx context.Context + GrantID string + func SetupListCommand(args []string) (*ListSetup, error) + type LogLevel int + const LogLevelDebug + const LogLevelError + const LogLevelInfo + const LogLevelWarn + type OutputFormat string + const FormatCSV + const FormatJSON + const FormatTable + const FormatYAML + func ParseFormat(s string) (OutputFormat, error) + type PageFetcher func(ctx context.Context, cursor string) (PageResult[T], error) + type PageResult struct + Data []T + NextCursor string + RequestID string + func (p PageResult[T]) HasMore() bool + type PaginatedDisplay struct + CurrentPage int + PageSize int + TotalFetched int + Writer io.Writer + func NewPaginatedDisplay(pageSize int) *PaginatedDisplay + func (p *PaginatedDisplay) DisplayPage(itemsDisplayed int, hasMore bool) + func (p *PaginatedDisplay) DisplaySummary() + func (p *PaginatedDisplay) SetWriter(w io.Writer) *PaginatedDisplay + type PaginationConfig struct + MaxItems int + MaxPages int + PageSize int + ShowProgress bool + Writer io.Writer + func DefaultPaginationConfig() PaginationConfig + type ProgressBar struct + func NewProgressBar(total int, message string) *ProgressBar + func (p *ProgressBar) Add(n int) + func (p *ProgressBar) Finish() + func (p *ProgressBar) Increment() + func (p *ProgressBar) Set(n int) + func (p *ProgressBar) SetWidth(width int) *ProgressBar + func (p *ProgressBar) SetWriter(w io.Writer) *ProgressBar + type ResourceArgs struct + GrantID string + ResourceID string + func ParseResourceArgs(args []string, minArgs int) (*ResourceArgs, error) + type RetryConfig struct + BaseDelay time.Duration + JitterRatio float64 + MaxDelay time.Duration + MaxRetries int + Multiplier float64 + func DefaultRetryConfig() RetryConfig + func NoRetryConfig() RetryConfig + type RetryFunc func() error + type RetryableError struct + Err error + StatusCode int + func (e *RetryableError) Error() string + func (e *RetryableError) Unwrap() error + type ShowCommandConfig struct + Aliases []string + DisplayFunc func(resource interface{}) error + GetClient func() (ports.NylasClient, error) + GetFunc func(ctx context.Context, grantID, resourceID string) (interface{}, error) + Long string + ResourceName string + Short string + Use string + type Spinner struct + func NewSpinner(message string) *Spinner + func (s *Spinner) SetFrames(frames []string) *Spinner + func (s *Spinner) SetWriter(w io.Writer) *Spinner + func (s *Spinner) Start() + func (s *Spinner) Stop() + func (s *Spinner) StopWithError(message string) + func (s *Spinner) StopWithMessage(message string) + func (s *Spinner) StopWithSuccess(message string) + type Table struct + func NewTable(headers ...string) *Table + func (t *Table) AddRow(values ...string) *Table + func (t *Table) AlignRight(col int) *Table + func (t *Table) Render() + func (t *Table) RowCount() int + func (t *Table) SetMaxWidth(col int, maxWidth int) *Table + func (t *Table) SetWriter(w io.Writer) *Table + type UpdateSetup struct + Cancel context.CancelFunc + Client ports.NylasClient + Ctx context.Context + GrantID string + ResourceID string + func SetupUpdateCommand(args []string) (*UpdateSetup, error)