Help us shape the future of Go! Take the 2026 Go Developer Survey

console

package
v0.13.8 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StderrStyles = sync.OnceValue(func() Styles {
	return MakeStyles(StderrRenderer())
})
View Source
var StdoutRenderer = sync.OnceValue(func() *lipgloss.Renderer {
	return lipgloss.DefaultRenderer()
})
View Source
var StdoutStyles = sync.OnceValue(func() Styles {
	return MakeStyles(StdoutRenderer())
})

Functions

func Error deprecated

func Error(args interface{})

Deprecated: uses console.StderrRenderer() Error handles and displays an error message. It formats the error message using the provided arguments.

func Errorf deprecated

func Errorf(format string, args ...interface{})

Deprecated: uses console.StderrRenderer() Errorf formats and displays an error message using the provided format string and arguments.

func Fatal deprecated

func Fatal(args interface{})

Deprecated: uses console.StderrRenderer() Fatal handles and displays a fatal error message. It then exits the program with a status code of 1.

func Fatalf deprecated

func Fatalf(format string, args ...interface{})

Deprecated: uses console.StderrRenderer() Fatalf formats and displays a fatal error message using the provided format string and arguments. It then exits the program with a status code of 1.

func Info

func Info(text string)

Info prints an informational message with the defined style.

func Infof

func Infof(format string, a ...interface{})

Infof formats and prints an informational message with the defined style.

func MakeGradientRamp

func MakeGradientRamp(length int) []lipgloss.Color

func MakeGradientText

func MakeGradientText(baseStyle lipgloss.Style, str string) string

func NewAnim

func NewAnim(cyclingCharsSize uint, label string, r *lipgloss.Renderer, s Styles) anim

func NewPrompt

func NewPrompt(enableColor bool, completer prompt.Completer, exec func(string), prefixCallback func() string, keyBindings ...prompt.KeyBind) *prompt.Prompt

func PrintConfirmation

func PrintConfirmation(action, content string)

func Render

func Render(format string, args ...interface{})

func RenderAppName

func RenderAppName(appName string, suffix string, args ...interface{})

func RenderChatMessages added in v0.13.1

func RenderChatMessages(messages []llms.ChatMessage) error

func RenderComment added in v0.13.3

func RenderComment(format string, args ...interface{})

func RenderError

func RenderError(err error, reason string, args ...interface{})

func RenderStep

func RenderStep(format string, args ...interface{})

RenderStep renders commit process step messages with a prefix

func RenderSuccess

func RenderSuccess(format string, args ...interface{})

RenderSuccess renders successful commit messages

func Success

func Success(text string)

Success prints a bold green success message with top padding. The message is styled with a green foreground color (terminal color 2) and bold text. Example usage: console.Success("Operation completed successfully")

func Successf

func Successf(format string, args ...interface{})

Successf prints a formatted bold green success message with top padding. Uses fmt.Sprintf syntax for formatting and applies the same styling as Success. Example usage: console.Successf("Successfully processed %d items", count)

func WaitForUserConfirm

func WaitForUserConfirm(defaultVal confirmation.Value, format string, args ...interface{}) bool

func Warn

func Warn(text string)

Warn prints the given text with a warning style.

func Warnf

func Warnf(format string, args ...interface{})

Warnf prints the formatted string with a warning style.

Types

type Styles

type Styles struct {
	AppName,
	CliArgs,
	Comment,
	CyclingChars,
	ErrorHeader,
	ErrorDetails,
	ErrPadding,
	Flag,
	FlagComma,
	FlagDesc,
	InlineCode,
	Link,
	Pipe,
	Quote,
	ConversationList,
	SHA1,
	Timeago,
	CommitStep,
	CommitSuccess,
	DiffHeader,
	DiffFileHeader,
	DiffHunkHeader,
	DiffAdded,
	DiffRemoved,
	DiffContext lipgloss.Style
}

func MakeStyles

func MakeStyles(r *lipgloss.Renderer) (s Styles)

Jump to

Keyboard shortcuts

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