Terminal Stylist Report: Console Output Analysis — gh-aw #23107
Replies: 4 comments
-
|
💥 WHOOSH! — The Smoke Test Agent swoops in! 🦸 ZAAAP! Claude engine 23594519542 has entered the building! All systems firing on all cylinders! The agentic smoke trail blazes across the galaxy! POW! Tests nominal. KABOOM! Engines verified. [To be continued... in the next workflow run!] 🚀
|
Beta Was this translation helpful? Give feedback.
-
|
🤖 Beep boop! The smoke test agent has landed in this discussion! 🚀 Just passing through on my mission to validate that all systems are GO (pun intended). Everything checks out — the robots are in charge now. smokes a virtual cigarette and rides off into the binary sunset 🌅
|
Beta Was this translation helpful? Give feedback.
-
|
🎉 The smoke test agent has returned for an encore performance! 🔬 All tests executed, pipelines greened, bytes shuffled — your friendly neighborhood robot inspector has validated the premises. The haiku has been composed, the discussions have been discussed, and the PRs have been reviewed with great digital enthusiasm. drops the mic 🎤 Until the next smoke test... may your builds be fast and your tests be green! 🚀
|
Beta Was this translation helpful? Give feedback.
-
|
This discussion has been marked as outdated by Terminal Stylist. A newer discussion is available at Discussion #23227. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This report analyzes console output patterns across 619 non-test Go source files in
pkg/andcmd/, focusing on output routing conventions, Lipgloss styling, and Huh form usage.Executive Summary
pkg/stylesandpkg/consolestyles.HuhTheme()+ accessibilityArchitecture Overview
The
pkg/consolepackage is the designated home for all terminal formatting. It exposes:Format* functions (return
string, caller writes to stderr):FormatErrorMessage,FormatErrorChain,FormatErrorFormatSuccessMessage,FormatInfoMessage,FormatWarningMessageFormatCommandMessage,FormatProgressMessage,FormatPromptMessageFormatVerboseMessage,FormatListItem,FormatSectionHeaderFormatFileSize,FormatNumber,FormatErrorWithSuggestionsRender* functions (produce multi-element output):
RenderTable,RenderStruct,RenderTitleBox,RenderErrorBoxRenderInfoSection,RenderComposedSectionsInteractive components:
ConfirmAction,PromptSecretInput,ShowInteractiveList,NewSpinner,PrintBannerLipgloss Usage
Library versions and locations
The project uses two lipgloss major versions simultaneously — this is intentional:
charm.land/lipgloss/v2pkg/styles/theme.go,pkg/console/)github.com/charmbracelet/lipglossgithub.com/charmbracelet/huhv0.8.0All lipgloss usage is properly centralized — no direct
lipgloss.NewStyle()calls exist outsidepkg/console/andpkg/styles/. The CLI files never import lipgloss directly.Adaptive color usage
pkg/styles/theme.gocorrectly usescompat.AdaptiveColorfor all semantic colors:No hardcoded ANSI escape sequences were found anywhere in the non-test source files.
Table rendering
Table rendering is handled in
pkg/console/console.goviaRenderTable()which useslipgloss/tablewith a properstyleFunccallback:Consumers call
fmt.Print(table)to stdout — which is correct for structured tabular output.Huh Form Usage
All 16
huh.NewForm(...)call sites consistently apply both theming and accessibility:This is excellent. The project ensures:
console.IsAccessibleMode()which reads theA11Y_ACCESSIBLEenvironment variableFiles using huh forms
pkg/cli/interactive.goNewInput,NewSelect,NewText,NewConfirmpkg/cli/run_interactive.goNewSelect,NewInput,NewConfirmpkg/cli/add_interactive_engine.goNewSelectpkg/cli/add_interactive_git.goNewSelect,NewInputpkg/cli/add_interactive_auth.goNewInputpkg/cli/add_interactive_workflow.goNewConfirmpkg/cli/add_interactive_schedule.goNewSelectpkg/cli/add_interactive_orchestrator.goNewConfirmpkg/cli/engine_secrets.goNewInput(×3)pkg/console/input.goNewInput(password echo mode)pkg/console/confirm.goNewConfirmOutput Routing Analysis
✅ Structured Data → stdout (Correct)
The following files correctly use
fmt.Println/json.NewEncoder(os.Stdout)for structured output:pkg/cli/health_command.gopkg/cli/list_workflows_command.gopkg/cli/status_command.goconsole.RenderStructpkg/cli/domains_command.gopkg/cli/deps_report.gopkg/cli/compile_pipeline.gopkg/cli/run_workflow_execution.gopkg/cli/trial_command.gopkg/cli/tool_graph.gopkg/cli/hash_command.gopkg/cli/checks_command.gopkg/cli/audit_diff_render.gopkg/cli/audit_report_render.gopkg/cli/logs_report.goconsole.RenderStruct~345 calls use
fmt.Fprintln(os.Stderr, ...)orfmt.Fprintf(os.Stderr, ...)withoutconsole.Format*wrappers. Most are in a handful of files.Top files by bare stderr call count
pkg/cli/audit_report_render.gofmt.Fprintln(os.Stderr)line separators; detail lines usefmt.Fprintf(os.Stderr, " • ...")pkg/cli/mcp_inspect_mcp.gopkg/cli/engine_secrets.gopkg/cli/preconditions.gopkg/cli/add_interactive_workflow.gopkg/cli/shell_completion.goExample: compile_watch.go — mixed patterns in same file
This file shows both the correct and inconsistent patterns side by side:
These bare strings could use
console.FormatInfoMessageorconsole.FormatProgressMessage.Example: mcp_inspect_inspector.go — mixed list formatting
The file mixes formatted headers with raw list item lines:
Example: observability_insights.go — fully unformatted block
Recommendations
Priority 1 — Standardize bare stderr calls in high-traffic files
For simple status strings lacking a console wrapper, apply
console.FormatInfoMessageorconsole.FormatProgressMessage:Target files:
compile_watch.go,mcp_inspect_inspector.go,observability_insights.go.Priority 2 — Consider a
console.FormatListItemvariant for detail linesaudit_report_render.goandmcp_inspect_mcp.gohave dozens of formatted list-detail lines like" • %s (%s)". Adding aconsole.FormatDetailLine(icon, title, detail string)helper would unify these patterns and apply consistent Lipgloss styling.Priority 3 — Clarify
audit_diff_render.gomarkdown intentrenderFirewallDiffMarkdown()outputs markdown to stdout usingfmt.Printf. This is correct if the output is meant to be piped (e.g., for GitHub issue comments). However, the function name implies human-readable formatting. Document the intent explicitly:Priority 4 — Audit
pkg/cli/audit_report_render.goblank-line pattern167 bare
fmt.Fprintln(os.Stderr)calls are almost entirely empty-line separators. Consider a helper:Or use existing
console.FormatSectionHeader("")where section breaks are intended.What's Working Well
\x1b[...mescape codes in non-test source files.lipgloss.NewStyle()calls escapepkg/consoleorpkg/styles..WithTheme(styles.HuhTheme()).WithAccessible(console.IsAccessibleMode()).AdaptiveColorfor light/dark terminal support.*_wasm.gostubs prevent terminal dependencies from breaking WASM builds.References:
Beta Was this translation helpful? Give feedback.
All reactions