[terminal-stylist] Terminal Stylist Audit: Console Output Analysis #28934
Closed
Replies: 1 comment
-
|
This discussion has been marked as outdated by Terminal Stylist. A newer discussion is available at Discussion #29103. |
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 the 728 non-test Go source files in
pkg/, focusing on consistency, Lipgloss v2 usage, Huh v2 integration, and adherence to the project's console formatting guidelines.Executive Summary
console.*formattersfmt.Fprintf(os.Stderr, ...)fmt.Println)pkg/workflow/console compliancepkg/cli/console compliance✅ What's Working Well
Lipgloss v2 Integration (
pkg/console/console.go,pkg/styles/theme.go,pkg/console/banner.go)The console package is a well-engineered Lipgloss v2 integration:
compat.AdaptiveColorwith distinct Light/Dark hex pairs (Dracula palette for dark, muted variants for light), e.g.:applyStyle()checkstty.IsStdoutTerminal()before applying any Lipgloss rendering, ensuring pipes and redirects receive plain text.RenderTable()useslipgloss/tablewith astyleFuncfor header vs. data rows, alternating row highlighting, and full border control.FormatSectionHeader()useslipgloss.DoubleBorder()with centered alignment; verbose sections uselipgloss.NormalBorder()with left-side only (false, false, false, true).RenderTableand the advanced layout APIs.Huh v2 Integration (
pkg/console/confirm.go,pkg/console/list.go)ShowInteractiveListwrapshuh.NewSelect[string]()inside ahuh.NewForm/huh.NewGroup, correctly using typed options (huh.Option[string]).Confirm()useshuh.NewConfirm()with title/description fields and validation.pkg/cli/add_interactive_*.gowizard files (add_interactive_auth.go,add_interactive_engine.go,add_interactive_git.go,add_interactive_orchestrator.go,add_interactive_schedule.go,add_interactive_secrets.go,add_interactive_workflow.go) compose multi-field Huh forms for the workflow creation wizard.pkg/console/spinner.goexplicitly documents compatibility with Huh event handling: "events that should be handled by subsequent interactive forms (e.g. huh.Select)".Structured stdout output (intentional)
The following files correctly send structured data (JSON, hashes, Mermaid graphs, Markdown reports) to stdout, conforming to Unix convention for pipeable output:
audit_cross_run_render.goaudit_diff_render.gochecks_command.gocompile_pipeline.godeps_report.godomains_command.gohash_command.gohealth_command.golist_workflows_command.gorun_workflow_execution.gostatus_command.gotool_graph.gotrial_helpers.go1. Raw
fmt.Fprintf(os.Stderr, ...)without console formatting292 raw stderr calls were found outside the console package itself. The most impactful clusters:
pkg/workflow/ — 57 files using raw stderr (not console-formatted)
The
pkg/workflowpackage does importpkg/console(38 files import it), yet several files bypass the formatting layer:pkg/workflow/cache.go— warning-level messages emitted as raw strings:pkg/workflow/claude_logs.go— 6 raw diagnostic calls (mix of errors, info, and debug):pkg/workflow/mcp_renderer.go:pkg/cli/ — Notable raw stderr clusters
pkg/cli/enable.go— 12 raw stderr calls for status messages:pkg/cli/deps_security.go— raw line-by-line printing instead of table or formatted output:pkg/cli/audit.go— log file paths printed as raw indented list:2. Diagnostic messages in
pkg/workflow/that belong in the loggerSeveral
fmt.Fprintf(os.Stderr, ...)calls inpkg/workflow/emit detailed diagnostic information (token counts, JSON parse attempts, line-skipping notices) that are better suited for thepkg/loggerdebug infrastructure:3. Missing
FormatCountMessageandFormatLocationMessageusageThe console package exposes
FormatCountMessageandFormatLocationMessagebut they are underutilized — only 20 files use the advanced format functions combined. Many places that render counts or file paths use raw strings.Recommendations
pkg/workflow/claude_logs.gofromfmt.Fprintf(os.Stderr, ...)topkg/loggercalls — they're debug-only information that should be gated behindDEBUG=workflow:*.fmt.Fprintf(os.Stderr, "Warning: ...")inpkg/workflow/cache.goandpkg/workflow/mcp_renderer.gowithconsole.FormatWarningMessage/console.FormatErrorMessage.pkg/cli/enable.gostatus messages usingconsole.FormatInfoMessageandconsole.FormatSuccessMessagefor visual consistency with other CLI commands.console.RenderTableinpkg/cli/deps_security.goto display security advisories as a formatted table rather than line-by-line printing.FormatLocationMessageusage for file path output inpkg/cli/audit.goto improve visual hierarchy when listing log file paths.audit_cross_run_render.go,audit_diff_render.go) use rawfmt.Printffor Markdown output — this is intentional and correct since these are structured document outputs for piping/saving.Architecture Observations
The
pkg/consolepackage is a solid foundation:add_interactive_*.go) shows good multi-step form composition patternsThe primary gap is inconsistent adoption in lower-level packages (
pkg/workflow/) where console formatting was not applied during initial implementation. A targeted pass overpkg/workflow/cache.go,pkg/workflow/claude_logs.go, andpkg/workflow/mcp_renderer.gowould resolve the most visible cases.References:
Beta Was this translation helpful? Give feedback.
All reactions