You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This report analyzes console output patterns across the gh-aw codebase (711 Go source files) for consistency, Lipgloss styling, and Huh form usage. The analysis was triggered by workflow run §24665385101.
Summary
The codebase demonstrates strong console output discipline overall, with a well-designed pkg/console/ package providing TTY-aware Lipgloss styling and a custom Huh theme. The primary areas of concern are a few missing format functions in the non-wasm build and a handful of direct styles.* calls that bypass TTY detection.
Metric
Value
Total Go source files
711
CLI files using console.*
139
CLI files with stdout fmt.Print*
13
Lipgloss usage (files)
4 core (styles, console)
Huh usage (files)
10
✅ Strengths
Lipgloss — Excellent Adaptive Color System
pkg/styles/theme.go implements a fully adaptive color palette via charm.land/lipgloss/v2/compat.AdaptiveColor:
Dracula-inspired dark theme paired with properly saturated light-mode variants
All semantic colors (Error, Warning, Success, Info, Purple/Command, Yellow/Progress) defined with both Light and Dark hex values
pkg/console/console.go wraps all styling in an applyStyle() helper that queries tty.IsStdoutTerminal() before applying Lipgloss styles — ensuring ANSI codes are never emitted to non-terminal outputs.
Separate TTY checks also exist for stderr (tty.IsStderrTerminal()), used in RenderTitleBox, RenderErrorBox, RenderInfoSection, and RenderComposedSections.
Comprehensive Format Function Inventory
The console package provides a full set of semantic format helpers:
Function
Icon
Purpose
FormatSuccessMessage
✓
Confirmations
FormatInfoMessage
i
Informational
FormatWarningMessage
⚠
Warnings
FormatErrorMessage
✗
User-facing errors
FormatErrorChain
✗
Wrapped error chains
FormatCommandMessage
⚡
Command execution
FormatProgressMessage
🔨
Progress updates
FormatPromptMessage
❓
User prompts
FormatVerboseMessage
🔍
Debug/verbose output
FormatListItem
•
List items
FormatSectionHeader
—
Section headers
Rust-inspired error rendering with source context, line numbers, column pointers, and hints:
workflow.md:12:5: error: unknown field 'enginee'
12 | enginee: copilot
^^^^^^^^
hint: did you mean 'engine'?
Huh — Well-Themed Interactive Forms
pkg/styles/huh_theme.go implements huh.ThemeFunc (a huh v2 function type) that maps the Dracula palette to all huh form elements (focused/blurred states, selectors, buttons, text input, navigation indicators).
Consistent form creation pattern used across all huh callers:
The wasm stub (pkg/console/console_wasm.go) exposes three functions that have no counterpart in the main pkg/console/console.go:
Function
Wasm Stub
Non-Wasm
FormatLocationMessage(message)
"📁 " + message
❌ Missing
FormatCountMessage(message)
"📊 " + message
❌ Missing
FormatListHeader(header)
header (passthrough)
❌ Missing
Corresponding styles do exist in pkg/styles/theme.go (Location and Count), indicating these were intentionally designed but the non-wasm implementations were never added.
Risk: Any future caller using console.FormatLocationMessage() or console.FormatCountMessage() in a !js && !wasm context will fail to compile.
Recommendation: Add the three missing implementations to console.go:
Direct styles.* calls emit ANSI escape codes unconditionally, potentially corrupting non-terminal output. This is the only instance found in the CLI package.
3. Markdown Render Functions: Raw fmt.Printf Volume
pkg/cli/audit_cross_run_render.go (72 calls) and pkg/cli/audit_diff_render.go (58 calls) contain dense raw fmt.Printf usage for markdown table construction. While this is intentional (these are structured markdown output functions), the pattern is verbose and error-prone.
The codebase already has RenderTable() (Lipgloss tables for TTY) but no equivalent markdown table builder helper. A utility like:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
This report analyzes console output patterns across the gh-aw codebase (711 Go source files) for consistency, Lipgloss styling, and Huh form usage. The analysis was triggered by workflow run §24665385101.
Summary
The codebase demonstrates strong console output discipline overall, with a well-designed
pkg/console/package providing TTY-aware Lipgloss styling and a custom Huh theme. The primary areas of concern are a few missing format functions in the non-wasm build and a handful of directstyles.*calls that bypass TTY detection.console.*fmt.Print*styles,console)✅ Strengths
Lipgloss — Excellent Adaptive Color System
pkg/styles/theme.goimplements a fully adaptive color palette viacharm.land/lipgloss/v2/compat.AdaptiveColor:LightandDarkhex valuesRoundedBorder,NormalBorder,ThickBorder)Error,Warning,Success,Info,Command,Progress,Prompt,Verbose,TableHeader,TableCell,TableTotal, etc.TTY-Aware Rendering
pkg/console/console.gowraps all styling in anapplyStyle()helper that queriestty.IsStdoutTerminal()before applying Lipgloss styles — ensuring ANSI codes are never emitted to non-terminal outputs.Separate TTY checks also exist for stderr (
tty.IsStderrTerminal()), used inRenderTitleBox,RenderErrorBox,RenderInfoSection, andRenderComposedSections.Comprehensive Format Function Inventory
The console package provides a full set of semantic format helpers:
FormatSuccessMessageFormatInfoMessageFormatWarningMessageFormatErrorMessageFormatErrorChainFormatCommandMessageFormatProgressMessageFormatPromptMessageFormatVerboseMessageFormatListItemFormatSectionHeaderRust-inspired error rendering with source context, line numbers, column pointers, and hints:
Huh — Well-Themed Interactive Forms
pkg/styles/huh_theme.goimplementshuh.ThemeFunc(a huh v2 function type) that maps the Dracula palette to all huh form elements (focused/blurred states, selectors, buttons, text input, navigation indicators).Consistent form creation pattern used across all huh callers:
WithAccessible(IsAccessibleMode())— proper accessibility mode supportPromptSecretInputandShowInteractiveListbefore running interactive formsShowInteractiveListOutput Routing Convention
Correct Unix conventions are observed throughout:
os.Stderrwith console formattingos.Stdoutviafmt.Printlnos.Stdout— correct and intentional1. Missing Format Functions in Non-Wasm Build
The wasm stub (
pkg/console/console_wasm.go) exposes three functions that have no counterpart in the mainpkg/console/console.go:FormatLocationMessage(message)"📁 " + messageFormatCountMessage(message)"📊 " + messageFormatListHeader(header)header(passthrough)Corresponding styles do exist in
pkg/styles/theme.go(LocationandCount), indicating these were intentionally designed but the non-wasm implementations were never added.Risk: Any future caller using
console.FormatLocationMessage()orconsole.FormatCountMessage()in a!js && !wasmcontext will fail to compile.Recommendation: Add the three missing implementations to
console.go:2. Direct
styles.*Calls Bypassing TTY Detectionpkg/cli/compile_stats.go:143-144usesstyles.Error.Render()directly instead of going through theconsolepackage:Direct
styles.*calls emit ANSI escape codes unconditionally, potentially corrupting non-terminal output. This is the only instance found in the CLI package.3. Markdown Render Functions: Raw
fmt.PrintfVolumepkg/cli/audit_cross_run_render.go(72 calls) andpkg/cli/audit_diff_render.go(58 calls) contain dense rawfmt.Printfusage for markdown table construction. While this is intentional (these are structured markdown output functions), the pattern is verbose and error-prone.The codebase already has
RenderTable()(Lipgloss tables for TTY) but no equivalent markdown table builder helper. A utility like:// FormatMarkdownTable(headers []string, rows [][]string) string...could consolidate this pattern and reduce the surface area for formatting bugs.
📋 Recommendations
FormatLocationMessage,FormatCountMessage,FormatListHeadertoconsole.gowithstyles.Location,styles.Count,styles.ListHeaderstyles.Error.Render()incompile_stats.gowithconsole.FormatErrorMessage()FormatMarkdownTable(headers, rows)helper to reduce 130+ rawfmt.Printftable-formatting lines in audit render filesWithOutput(os.Stderr)in form creation to be explicit about output target (huh defaults vary by version)Files Analyzed
Files with strong console formatting usage (sample)
pkg/cli/audit_report_render.go— 31console.*calls, proper stderr routingpkg/cli/logs_metrics.go— 49console.*callspkg/cli/trial_repository.go— 48console.*callspkg/cli/pr_command.go— 47console.*callspkg/cli/run_workflow_execution.go— 42console.*callspkg/cli/mcp_inspect_mcp.go— 36console.*callspkg/console/console.go— Core formatting with Lipgloss + TTY detectionpkg/styles/theme.go— Adaptive color palette (53 Lipgloss references)pkg/styles/huh_theme.go— Custom Huh form themeFiles using stdout for structured data (correct pattern)
pkg/cli/hash_command.go—fmt.Println(hash)✅pkg/cli/tool_graph.go—fmt.Println(mermaidGraph)✅pkg/cli/compile_pipeline.go—fmt.Println(jsonStr)✅pkg/cli/status_command.go—fmt.Println(string(jsonBytes))/fmt.Print(console.RenderStruct(...))✅pkg/cli/audit_cross_run_render.go— markdown to stdout ✅pkg/cli/audit_diff_render.go— markdown to stdout ✅References: §24665385101
Beta Was this translation helpful? Give feedback.
All reactions