Terminal Stylist Audit: Console Output Analysis (gh-aw) #22328
Closed
Replies: 1 comment
-
|
This discussion was automatically closed because it expired on 2026-03-23T22:26:26.632Z.
|
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.
-
This report analyzes console output patterns across all non-test Go source files in
pkg/andcmd/, evaluating consistency with theconsoleformatting package and usage of the Charmbracelet ecosystem (Lipgloss, Huh, Bubble Tea).Workflow Run: §23413900373
Summary
huhfor interactive formspkg/console/)fmt.Printlncalls (structured stdout)Overall, the codebase demonstrates strong adoption of the
consoleformatting package. The majority of output is properly routed and styled. There are clear improvement opportunities concentrated in a small number of files.✅ What's Working Well
Console Package Architecture
The
pkg/consolepackage is well-structured and provides a complete formatting toolkit:FormatSuccessMessage/FormatInfoMessage/FormatWarningMessage/FormatErrorMessageFormatProgressMessage/FormatCommandMessage/FormatPromptMessage/FormatVerboseMessageFormatListItem/FormatSectionHeader/FormatErrorWithSuggestionsRenderStruct/RenderTable/RenderErrorBoxLipgloss Integration (
charm.land/lipgloss/v2)lipgloss.AdaptiveColor) used throughout for light/dark terminal compatibilityisTTY()guards all styling (e.g.,FormatSectionHeaderbypasses styles when piped)pkg/styles/shared across componentsHuh Interactive Forms
huhfor interactive CLI prompts (engine selection, schedule config, auth, git setup, etc.)HuhTheme()inpkg/styles/huh_theme.gomaps the Dracula-inspired palette to form fieldsconsole.IsAccessibleMode()passed to.WithAccessible()NewInput,NewSelect,NewConfirm,NewMultiSelectStdout vs Stderr Routing
stdoutstderrwith console formatting1.
audit_report_render.go— 90 unformatted outputs (highest count)This file renders audit reports with manually-crafted bullet points instead of using
console.FormatListItem:Also uses many raw
fmt.Fprintln(os.Stderr)blank lines for spacing — this is acceptable for layout, but aconsole.FormatCountMessageor similar could improve the item-count lines.2.
mcp_inspect_mcp.go— 41 unformatted outputsUses raw markdown-style bold syntax that renders literally in terminals:
This section would benefit significantly from
console.RenderStructor a structuredlipgloss/table.3.
engine_secrets.go— 32 unformatted outputsMixed console-formatted and raw outputs. Instructional multi-line text uses raw stderr:
4.
preconditions.go— 27 unformatted outputsInstructional setup messages without formatting:
5.
copilot_setup.go— 19 unformatted outputsOutputs YAML code blocks directly to stderr without a code formatter:
The verbose flag messages (
"No version upgrade needed...") would benefit fromFormatVerboseMessagerather than rawfmt.Fprintf(os.Stderr, ...).6.
add_interactive_workflow.go/add_interactive_git.go— 19 and 18 outputsThese files print instructional or status messages to stderr without console formatting.
Lipgloss-Specific Recommendations
View Lipgloss Recommendations
Library split is intentional and correct:
pkg/console/usescharm.land/lipgloss/v2whilepkg/styles/huh_theme.gousesgithub.com/charmbracelet/lipgloss(v1) — this is necessary becausehuhv0.8.0 depends on lipgloss v1. The comment inhuh_theme.goalready documents this. No action needed.mcp_inspect_mcp.gotool details output is a prime candidate for alipglosstwo-column key-value layout, similar to howRenderStructworks. Consider refactoring the tool detail output to useconsole.RenderStructwith a typed struct instead of rawfmt.Fprintfwith markdown-style bold.Code block formatter missing:
copilot_setup.gooutputs YAML code snippets to stderr. Aconsole.FormatCodeBlock(code string, language string) stringhelper using a faint/muted Lipgloss border could improve this visually.Consistent border style:
audit_report_render.gouses purely text-based section separation (blank lines). Consider usingconsole.FormatSectionHeaderfor all section titles — it's already available and adds a styled border for TTY output.Huh-Specific Recommendations
View Huh Recommendations
Theme consistency ✅: The
HuhTheme()function correctly maps the color palette to all huh field states (focused, blurred, active, inactive). This is well-implemented.Accessibility ✅:
console.IsAccessibleMode()is correctly used withform.WithAccessible()inrun_interactive.go. Check that all other form call sites (add_interactive_*.go) also apply this pattern.add_interactive_auth.gouseshuh.NewInput()for secret entry — consider addingEchoMode(huh.EchoPassword)if prompting for sensitive credentials.Validation messages: Ensure all
Validate()callbacks return user-friendly error strings. Thehuhlibrary will display these inline, so they should be complete sentences withoutFormatErrorMessagewrapping (huh handles its own styling).engine_secrets.go— the instructional text precedinghuhprompts is output via rawfmt.Fprintln(os.Stderr, ...). Consider usinghuh.NewNote()fields within the form for contextual help text that renders in the form's styled context.Top Files to Prioritize
audit_report_render.goFormatListItemmcp_inspect_mcp.goengine_secrets.gopreconditions.goshell_completion.gocopilot_setup.goFormatCodeBlockhelperadd_interactive_workflow.goadd_interactive_git.goRecommended New Helper
The most impactful addition would be a code block formatter for terminal output:
This would benefit
copilot_setup.goand any future commands that display YAML/shell snippets to users.References:
Beta Was this translation helpful? Give feedback.
All reactions