Documentation
¶
Index ¶
- Variables
- func AskConfirmation(question string) bool
- func EditCommitMessage(initialMessage string, editorErrorMsg string) (string, error)
- func HandleAppError(err error, translations ...*i18n.Translations)
- func PrintDuration(msg string, duration time.Duration)
- func PrintError(w io.Writer, msg string)
- func PrintErrorWithSuggestion(errMsg, suggestion string)
- func PrintInfo(msg string)
- func PrintKeyValue(key, value string)
- func PrintSectionBanner(title string)
- func PrintSuccess(w io.Writer, msg string)
- func PrintTokenUsage(usage *models.TokenUsage, t *i18n.Translations)
- func PrintWarning(msg string)
- func ResumeSuspendedSpinner()
- func ShowDiff(files []string) error
- func ShowDiffStats(files []string, headerMessage string) error
- func ShowFilesTree(files []string, headerMessage string) error
- func StopActiveSpinner()
- func SuspendActiveSpinner()
- func WithSpinner(message string, fn func() error) error
- func WithSpinnerAndDuration(message string, fn func() error) error
- type FileChange
- type SmartSpinner
- type SpinnerBuilder
- func (b *SpinnerBuilder) Build() *SmartSpinner
- func (b *SpinnerBuilder) WithCharset(charset int) *SpinnerBuilder
- func (b *SpinnerBuilder) WithColor(color string) *SpinnerBuilder
- func (b *SpinnerBuilder) WithMessage(msg string) *SpinnerBuilder
- func (b *SpinnerBuilder) WithSpeed(speed time.Duration) *SpinnerBuilder
Constants ¶
This section is empty.
Variables ¶
var ( // Colors for different message types Success = color.New(color.FgGreen, color.Bold) Error = color.New(color.FgRed, color.Bold) Warning = color.New(color.FgYellow, color.Bold) Info = color.New(color.FgCyan, color.Bold) Accent = color.New(color.FgMagenta, color.Bold) Dim = color.New(color.FgHiBlack) // Emojis with colors MateEmoji = "🧉" SuccessEmoji = Success.Sprint("✅") WarningEmoji = Warning.Sprint("⚠️") InfoEmoji = Info.Sprint("ℹ️") RocketEmoji = Accent.Sprint("🚀") StatsEmoji = Accent.Sprint("📊") )
Functions ¶
func AskConfirmation ¶
func EditCommitMessage ¶
EditCommitMessage opens an editor for the user to edit the message
func HandleAppError ¶
func HandleAppError(err error, translations ...*i18n.Translations)
HandleAppError handles an application error and displays it in a friendly way. If translations is nil, it will use English defaults.
func PrintDuration ¶
func PrintError ¶
func PrintErrorWithSuggestion ¶
func PrintErrorWithSuggestion(errMsg, suggestion string)
func PrintKeyValue ¶
func PrintKeyValue(key, value string)
func PrintSectionBanner ¶
func PrintSectionBanner(title string)
func PrintSuccess ¶
func PrintTokenUsage ¶
func PrintTokenUsage(usage *models.TokenUsage, t *i18n.Translations)
func PrintWarning ¶
func PrintWarning(msg string)
func ResumeSuspendedSpinner ¶
func ResumeSuspendedSpinner()
ResumeSuspendedSpinner resumes the previously suspended spinner.
func ShowDiffStats ¶
ShowDiffStats shows change statistics (like git diff --stat)
func ShowFilesTree ¶
ShowFilesTree shows modified files in tree format
func StopActiveSpinner ¶
func StopActiveSpinner()
StopActiveSpinner stops the currently active spinner in the terminal session.
func SuspendActiveSpinner ¶
func SuspendActiveSpinner()
SuspendActiveSpinner temporarily stops the active spinner without deleting its reference, allowing it to be resumed after user interaction.
func WithSpinner ¶
func WithSpinnerAndDuration ¶
Types ¶
type FileChange ¶
FileChange represents a modified file with its statistics
type SmartSpinner ¶
type SmartSpinner struct {
// contains filtered or unexported fields
}
SmartSpinner is a spinner with enhanced capabilities
func NewSmartSpinner ¶
func NewSmartSpinner(initialMessage string) *SmartSpinner
NewSmartSpinner creates a new spinner with an initial message
func (*SmartSpinner) Error ¶
func (s *SmartSpinner) Error(msg string)
func (*SmartSpinner) Log ¶
func (s *SmartSpinner) Log(msg string)
func (*SmartSpinner) Start ¶
func (s *SmartSpinner) Start()
Start starts the spinner and registers it as the globally active spinner.
func (*SmartSpinner) Stop ¶
func (s *SmartSpinner) Stop()
Stop stops the spinner and clears the active spinner record.
func (*SmartSpinner) Success ¶
func (s *SmartSpinner) Success(msg string)
func (*SmartSpinner) UpdateMessage ¶
func (s *SmartSpinner) UpdateMessage(msg string)
func (*SmartSpinner) Warning ¶
func (s *SmartSpinner) Warning(msg string)
type SpinnerBuilder ¶
type SpinnerBuilder struct {
// contains filtered or unexported fields
}
SpinnerBuilder allows building spinners with flexible configuration
func (*SpinnerBuilder) Build ¶
func (b *SpinnerBuilder) Build() *SmartSpinner
Build constructs the SmartSpinner with the specified configuration
func (*SpinnerBuilder) WithCharset ¶
func (b *SpinnerBuilder) WithCharset(charset int) *SpinnerBuilder
WithCharset sets the spinner charset
func (*SpinnerBuilder) WithColor ¶
func (b *SpinnerBuilder) WithColor(color string) *SpinnerBuilder
WithColor sets the spinner color
func (*SpinnerBuilder) WithMessage ¶
func (b *SpinnerBuilder) WithMessage(msg string) *SpinnerBuilder
WithMessage sets the spinner message
func (*SpinnerBuilder) WithSpeed ¶
func (b *SpinnerBuilder) WithSpeed(speed time.Duration) *SpinnerBuilder
WithSpeed sets the spinner speed