termcolor

package
v0.20260521.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	User      = "\033[96m"
	Red       = "\033[91m"
	Assistant = "\033[92m"
	Tool      = "\033[38;2;255;246;157m"
	Thinking  = "\033[90m"
	White     = "\033[97m"
	Context   = "\033[94m"
	Reset     = "\033[0m"
	Bold      = "\033[1m"
	Gold      = "\033[38;2;255;215;0m"
)
View Source
const NoBold = "\033[22m"

Variables

This section is empty.

Functions

func BackgroundRGB

func BackgroundRGB(r, g, b uint8) string

func ColorizeImgTags

func ColorizeImgTags(s string) string

ColorizeImgTags highlights [img-<n>] placeholders with WrapImgTag.

func ColorizeImgTagsReplInput added in v0.20260520.1

func ColorizeImgTagsReplInput(s string) string

ColorizeImgTagsReplInput highlights img tags for the readline input buffer. Windows readline uses a limited ANSI translator that panics on truecolor (48;2;…).

func ForegroundRGB

func ForegroundRGB(r, g, b uint8) string

func FormatWorkedDuration

func FormatWorkedDuration(secs float64) string

func ThoughtForSuffix

func ThoughtForSuffix(secs float64) string

func ToolHeaderLine

func ToolHeaderLine(toolName, body string) string

func ToolLine

func ToolLine(toolName, body string) string

func UsageTokensLine

func UsageTokensLine(contextPromptTok, lastUserPromptTok, reasoningTokens, responseTokens, totalTokens int64, outputTPS, ttftSecs, promptTPS float64, contextEstimated bool, turnWallSecs float64) string

func WelcomeUsageTotals

func WelcomeUsageTotals(userTok, reasoningTok, responseTok, totalTok int64) string

func WrapAssistant

func WrapAssistant(s string) string

func WrapBoldGold

func WrapBoldGold(s string) string

func WrapContext

func WrapContext(s string) string

func WrapImgTag

func WrapImgTag(tag string) string

func WrapRed

func WrapRed(s string) string

func WrapThinking

func WrapThinking(s string) string

func WrapTool

func WrapTool(s string) string

func WrapUser

func WrapUser(s string) string

func WrapWhite

func WrapWhite(s string) string

Types

type ToolLineWriter

type ToolLineWriter struct {
	W io.Writer
	// contains filtered or unexported fields
}

func NewToolLineWriter

func NewToolLineWriter(w io.Writer) *ToolLineWriter

func (*ToolLineWriter) Flush

func (w *ToolLineWriter) Flush() error

func (*ToolLineWriter) Write

func (w *ToolLineWriter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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