[terminal-stylist] Terminal Stylist Report: Console Output Analysis #35898
Closed
Replies: 1 comment
-
|
This discussion was automatically closed because it expired on 2026-05-31T09:28:34.042Z.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Overview
This report covers a full scan of the 868 non-test Go source files in
pkg/for console output patterns, Lipgloss styling, and Huh form implementations. The codebase has a mature, well-structured approach to terminal output built on the Charmbracelet ecosystem.✅ What's Working Well
Console Formatting Package (
pkg/console)The project has a dedicated
pkg/consolepackage with a comprehensive set of formatters:FormatSuccessMessageFormatInfoMessageFormatWarningMessageFormatErrorMessageFormatCommandMessageFormatProgressMessageFormatPromptMessageFormatCountMessageFormatVerboseMessageFormatErrorFormatErrorWithSuggestionsRenderTableRenderStructRenderTitleBox,RenderErrorBox,RenderInfoSectionUsage is high: 1,533
console.Format*calls across thepkg/clipackage, vs. 2,047 total stderr calls — ~75% adoption rate.Lipgloss Integration (
pkg/styles)The
pkg/stylespackage is excellently architected:compat.AdaptiveColor— all semantic colors (Error, Warning, Success, Info, etc.) have separate Light/Dark hex values automatically selected based on terminal background.lipgloss v2withcolorprofile.Detect— detects terminal capabilities and profile at init time.pkg/ttybefore applying styles inconsole.applyStyle().pkg/cli/compile_schedule_calendar.gouseslipgloss.NewStyle().Foreground(styles.Color*)correctly with TTY guards.streamStyleRendererinterface inpkg/cli/gateway_logs_timeline_render.goallows TTY-conditional styling without importing lipgloss in helper files.Huh Forms (
charm.land/huh/v2)All interactive forms follow a consistent, correct pattern:
All 20+ form instantiations across
add_interactive_workflow.go,add_interactive_schedule.go,add_interactive_git.go,run_interactive.go,add_interactive_orchestrator.go,add_interactive_auth.go,engine_secrets.go,interactive.go,add_interactive_engine.go, andpkg/console/{list,confirm,input}.go.✅ All apply
styles.HuhThemeandconsole.IsAccessibleMode()— the theme maps the Dracula palette to huh field styles (primary, success, error, warning, comment, fg, bg, border) usinglipgloss.LightDark().1. Unformatted Stderr Messages (~25% of CLI stderr output)
~514
fmt.Fprintln/Fprintf(os.Stderr, ...)calls do not useconsole.Format*wrappers. Common patterns:pkg/cli/fix_command.go— codemod detail listing uses raw formatting:These should use
FormatCommandMessage,FormatInfoMessage, orFormatListItem.pkg/cli/add_interactive_workflow.go— workflow status monitoring uses raw debug prints:These should use
logger.New("cli:add_interactive_workflow")so they only appear withDEBUG=cli:*.pkg/cli/update_display.go— update failure display:Should use
FormatErrorMessageorFormatListItem.2. Direct Lipgloss in CLI (Minor)
pkg/cli/compile_schedule_calendar.gocreateslipgloss.NewStyle()instances directly:Functionally correct (TTY-guarded). Minor improvement: define these as pre-built
styles.*style variables to centralize all style definitions inpkg/styles.3. Huh Field Validation (Opportunistic)
Most
huh.NewInput()andhuh.NewSelect()fields lack.Validate()callbacks. Adding validation to critical fields (repo names, schedule expressions, PR titles) would surface errors inline before form submission:📋 Summary
compat.AdaptiveColorwith light/dark variantsapplyStyle()guards,streamStyleRendererpatternstyles.HuhTheme+IsAccessibleMode()FormatVerboseMessageRenderStruct, JSON outputs go to stdout.Validate()callbackslipgloss.NewStyle()calls could move topkg/stylesReferences: §26680271060
Beta Was this translation helpful? Give feedback.
All reactions