[terminal-stylist] Terminal Stylist: Console Output Analysis for gh-aw #39355
Closed
Replies: 1 comment
-
|
This discussion was automatically closed because it expired on 2026-06-16T10:50:03.875Z.
|
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 summarizes the results of a Terminal Stylist analysis of all non-test Go source files in
pkg/— covering console output patterns, Lipgloss styling, and Huh form implementations.Key Metrics
fmt.Print*console.Format*/Render*huhformsconsole.Format*calls inpkg/cli/NewForm/NewGroupcalls inpkg/cli/.WithTheme(styles.HuhTheme)fmt.Fprintln(os.Stderr, ""))Lipgloss Usage — ✅ Excellent
The Lipgloss integration is well-architected:
pkg/styles/theme.godefines a centralized adaptive color palette (Dracula-inspired dark / readable light) usingcompat.AdaptiveColor{Light: ..., Dark: ...}for every semantic color —ColorError,ColorWarning,ColorSuccess,ColorInfo,ColorPurple,ColorYellow,ColorComment,ColorForeground,ColorBackground,ColorBorder,ColorTableAltRow.pkg/tty(IsStdoutTerminal,IsStderrTerminal) and theapplyStyle()helper inpkg/console/console.gogates all styling.styles.init()) correctly handles Windows startup probing — skips terminal capability queries on non-character-device handles to prevent hangs.console.RenderTable) uselipgloss/tablewith alternating row colors, rounded borders, proper header / total row styles.pkg/styles/theme.go— the palette is single-sourced.Lipgloss direct usage (8 files outside console/styles)
pkg/logger/logger.gopkg/cli/compile_schedule_calendar.gointensityStyle()helper returnslipgloss.Stylefor heatmap (TTY-gated)Both usages correctly reference
styles.Color*constants — no ad-hoc hex values.Huh Form Usage — ✅ Consistent, Minor Gap
The
charm.land/huhintegration is solid across 13 files:.WithTheme(styles.HuhTheme).WithAccessible(console.IsAccessibleMode())— 100% ofpkg/cli/forms follow this pattern.pkg/console/confirm.go,pkg/console/list.go, andpkg/console/input.goprovide TTY-guarded wrappers that fall back to plain-text prompts in non-TTY environments.styles.HuhTheme(pkg/styles/huh_theme.go) maps the full Dracula palette to every huh component: focused/blurred bases, navigation indicators, selection states, button styles, text cursor, and group headers — ensuring visual consistency between forms and the rest of the CLI.Minor gap: Direct
huh.NewFormcalls inpkg/cli/(not going through theconsole/wrappers) do not guard with an explicit TTY check before running. Theconsole/confirm.goandconsole/list.gowrappers do checktty.IsStderrTerminal()first, butadd_interactive_auth.go,add_interactive_engine.go,engine_secrets.go, etc. call.RunWithContext()without a prior TTY guard. Huh handles non-TTY output gracefully, but explicit TTY detection keeps behavior consistent.Files with direct huh forms (all consistently themed)
pkg/cli/add_interactive_auth.gopkg/cli/add_interactive_engine.gopkg/cli/add_interactive_git.gopkg/cli/add_interactive_orchestrator.gopkg/cli/add_interactive_schedule.gopkg/cli/add_interactive_workflow.gopkg/cli/engine_secrets.gopkg/cli/interactive.gopkg/cli/run_interactive.goConsole Output Patterns — ✅ Well-Structured, Areas to Improve
The
pkg/console/package provides a rich set of format helpers that are heavily used:pkg/cli/)console.FormatInfoMessageconsole.FormatWarningMessageconsole.FormatSuccessMessageconsole.FormatVerboseMessageconsole.FormatErrorMessageconsole.FormatCommandMessageconsole.FormatSectionHeaderconsole.RenderTableconsole.RenderStructThis is excellent coverage — user-facing status messages are consistently routed through the console formatting layer.
Anti-patterns found
1. Manual separator strings (2 files)
Two files hard-code box-drawing characters instead of using
console.FormatSectionHeader()orconsole.RenderTitleBox():pkg/cli/actionlint.go(lines 118–168):pkg/cli/add_interactive_orchestrator.go(lines 320–323):2. Plain instructional text without styling (interactive wizard files)
Several messages in the
add_interactive_*wizard files output plain text that could benefit from console formatting:pkg/cli/add_interactive_auth.go:pkg/cli/add_interactive_git.go:pkg/cli/add_interactive_orchestrator.go:3. Markdown report renderers (intentional — NOT an issue)
pkg/cli/audit_cross_run_render.goandpkg/cli/audit_diff_render.goemit raw Markdown viafmt.Fprintf(os.Stdout, ...). This is intentional — these functions (renderCrossRunReportMarkdown,renderMarkdown*) produce structured Markdown output for GitHub issue/PR bodies or file storage, not styled terminal output. This pattern is correct and should not be changed to Lipgloss rendering.4.
FormatErrorMessagedouble-prefix inadd_workflow_compilation.goSome callers pass a message already containing
✗intoFormatErrorMessage, which adds its own✗prefix — resulting in✗ ✗ message. Example:Recommendations
strings.Repeat("━", N)separators withconsole.FormatSectionHeader()orconsole.RenderTitleBox()actionlint.go,add_interactive_orchestrator.goconsole.FormatInfoMessage()/console.FormatWarningMessage()in wizard filesadd_interactive_auth.go,add_interactive_git.go,add_interactive_orchestrator.go,add_interactive_engine.go,add_interactive_workflow.gotty.IsStderrTerminal()guard beforehuhform.RunWithContext()in CLI files not going throughconsole/wrappers✗,✓) in messages passed toconsole.Format*functions that already add their own prefix glyphsactions_build_command.goadd_interactive_orchestrator.gointo a reusableconsole.RenderCompletionBanner()helperadd_interactive_orchestrator.goReferences: §27540682682
Beta Was this translation helpful? Give feedback.
All reactions