[terminal-stylist] Terminal Stylist: Console Output Analysis #40454
Closed
Replies: 1 comment
-
|
This discussion was automatically closed because it expired on 2026-06-21T09:50:52.731Z.
|
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 analysis covers 937 Go source files in
pkg/(non-test) for console output patterns, Lipgloss styling practices, and Huh form implementations.pkg/consolepkg/stylescharm.land/huh)fmt.Print*calls (pkg/)fmt.Print*to stdout inpkg/cli/Lipgloss Usage
✅ Strengths
pkg/styles/theme.go. No hardcoded hex colors found outside that file.compat.AdaptiveColor{Light: ..., Dark: ...}fromcharm.land/lipgloss/v2/compat, automatically switching between Dracula-inspired dark and accessible light variants.console.applyStyle()wraps everylipgloss.Style.Render()call; styles are stripped for pipes and redirects.pkg/logger/logger.gouses a palette of 12 adaptive Lipgloss styles, hash-assigned per namespace.compile_schedule_calendar.gouses dedicatedstyles.ScheduleCalendar{Empty,Low,Medium,High,Critical}styles for intensity bands.terminal.gouses raw ANSI sequences only for cursor movement/clear (\033[H\033[2J,\033[K) where Lipgloss has no API — appropriate and TTY-gated.styles.RoundedBorder,NormalBorder,ThickBorderare declared centrally;ErrorBoxandInfoSectionrenderers use them uniformly.Lipgloss color palette (adaptive)
#D73737#FF5555#E67E22#FFB86C#27AE60#50FA7B#2980B9#8BE9FD#8E44AD#BD93F9#B7950B#F1FA8C#6C7A89#6272A4#2C3E50#F8F8F2#ECF0F1#282A36#BDC3C7#44475AHuh Form Usage
✅ Strengths
pkg/styles/huh_theme.goprovidesstyles.HuhTheme, ahuh.ThemeFuncthat maps the Dracula palette to all Huh field states (focused, blurred, selected, error, navigation). Applied consistently with.WithTheme(styles.HuhTheme)across all 13 files..WithAccessible(console.IsAccessibleMode()).IsAccessibleMode()checksACCESSIBLE,TERM=dumb, andNO_COLORenv vars.tty.IsStderrTerminal()checks, with text-mode fallbacks for pipes/CI (showTextConfirm,showTextList).huh.NewInput()withEchoModePasswordfor secrets (input.go)huh.NewConfirm()for yes/no confirmations (confirm.go)huh.NewSelect[string]()for interactive lists (list.go)add_interactive_*.goCLI commandsValidate()callbacks (e.g., empty-string rejection for secrets).Files using Huh
pkg/console/input.goInput+EchoModePassword, validationpkg/console/confirm.goConfirmwith text fallbackpkg/console/list.goSelect[string]with text fallbackpkg/styles/huh_theme.gopkg/cli/interactive.gopkg/cli/add_interactive_auth.gopkg/cli/add_interactive_git.gopkg/cli/add_interactive_workflow.gopkg/cli/add_interactive_orchestrator.gopkg/cli/add_interactive_engine.gopkg/cli/add_interactive_schedule.gopkg/cli/engine_secrets.gopkg/cli/run_interactive.goConsole Output Patterns
✅ Package design
The
pkg/consolepackage follows a clean two-convention naming scheme documented indoc.go:Format*— pure string transforms (e.g.,FormatSuccessMessage,FormatErrorMessage,FormatCommandMessage)Render*— structured/layout output (e.g.,RenderTable,RenderTitleBox,RenderErrorBox,RenderTree)Output routing is clearly defined: diagnostic output → stderr; structured data → stdout.
1. `trial_confirmation.go` — mixed formatting in execution steps list
Lines 182–183 use unstyled
fmt.Fprintf(os.Stderr, ...)for sub-step labels, while adjacent lines useconsole.FormatInfoMessage():The sub-step lines (a., b.) lack the
console.FormatInfoMessage()wrapping, resulting in unstyled output mixed with styled parent steps.Suggested fix: wrap the sub-step
fmt.Fprintfcalls withconsole.FormatInfoMessage().2. `compile_stats.go` — unformatted error display
Several stderr writes use raw
fmt.Fprintfwith Unicode symbols instead of console formatters:These bypass TTY detection and adaptive styling.
console.FormatErrorMessage()orconsole.FormatInfoMessage()would be more consistent.3. `vscode_config.go:82` — plain info message
This would benefit from
console.FormatInfoMessage()orconsole.FormatWarningMessage()for consistency.✅ Intentional raw
fmt.Fprintfpatterns (not issues)logs_format_compact.go(~100 stdout writes): Explicitly documented as "maximally information-dense output optimized for agentic consumption" — LLM-readable, flat, no decoration. Rawfmt.Fprintf(os.Stdout, ...)is correct here.audit_diff_render.go: Outputs Markdown/JSON to stdout for structured diff display — intentional machine-readable format.strings.Builderuse intrial_confirmation.go:fmt.Fprintf(&buf, ...)into buffers (not os.Stderr/os.Stdout) is correct for composing strings before passing toconsole.RenderInfoSection().Recommendations
trial_confirmation.gowithconsole.FormatInfoMessage()(lines 182–183 and similar) to restore visual consistency with parent steps.fmt.Fprintf(os.Stderr, ...)incompile_stats.goerror display loops withconsole.FormatErrorMessage()/console.FormatInfoMessage()to get TTY-gated adaptive styling on the✗/iindicators.console.FormatWarningMessage()for the existing-settings warning invscode_config.go:82.References:
Beta Was this translation helpful? Give feedback.
All reactions