UI helpers
๐ฆ ui
package
These helpers provide methods to help you to create a better CLI interface for interacting with the LLMs.
Input
func Input(color, prompt string) (string, error)
Input
displays a prompt with the specified color and waits for user input.
Parameters: - color: A string representing the color of the prompt text. - prompt: A string representing the prompt message to display.
Returns: - A string containing the user input, trimmed of any leading or trailing whitespace. - An error if there was an issue running the input program or if the input could not be retrieved.
Println
Println(color string, strs ...interface{})
Println
prints the provided strings with the specified color using the lipgloss styling library.
The color parameter should be a string representing the desired color.
The strs parameter is a variadic argument that accepts multiple values to be printed.
Parameters: - color: A string representing the color to be used for the text. - strs: A variadic parameter that accepts multiple values to be printed.
Imports:
Info
I used these two great libraries to create the helpers: - github.com/charmbracelet/bubbletea - github.com/charmbracelet/lipgloss
Note
๐ you will find complete examples in: