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
Scanned all non-test .go files under pkg/. Overall the codebase is highly consistent: the pkg/console package (Lipgloss-based, 551 LOC) is used broadly, with 1,828 console.Format* calls across 20+ CLI files, and 20 files leverage console.RenderTable/RenderStruct. pkg/styles centralizes a Dracula-inspired adaptive color palette, and pkg/tty centralizes TTY detection (no scattered term.IsTerminal/isatty calls found outside it).
Key metrics
fmt.Print* in non-test/non-testdata code: only 2 occurrences, both intentional pass-throughs of pre-rendered console-formatted strings (status_command.go:288, view_command.go:168).
console.* usage: 248 files.
lipgloss.* direct usage: 6 files (mostly inside pkg/styles/pkg/console, as intended — good encapsulation).
huh (interactive forms) usage: 0 files import charmbracelet/huh for actual forms, despite a fully-built pkg/styles/huh_theme.go theme existing unused.
Manual %-*s padding for column alignment: 3 call sites, none using lipgloss/table or console.RenderTable.
Detailed findings
1. Console package usage — good
pkg/console/console.go provides FormatError, FormatSuccessMessage, FormatInfoMessage, FormatWarningMessage, FormatErrorChain, RenderTable, etc., each with TTY-aware stdout/stderr variants (e.g. FormatInfoMessage vs FormatInfoMessageStderr). This dual-variant pattern is applied consistently.
The two remaining fmt.Print/fmt.Fprintln calls in status_command.go and view_command.go already wrap console.RenderStruct(...)/pre-rendered console output, so they are not violations — just the terminal Print of an already-styled string.
2. Lipgloss usage — well encapsulated but a few manual-formatting gaps
pkg/styles/theme.go defines lipgloss.AdaptiveColor{Light:..., Dark:...} values used everywhere via lipgloss.LightDark(isDark) (see huh_theme.go), which is the correct adaptive-color pattern.
Three call sites hand-roll column alignment with fmt.Sprintf("%-*s", width, ...) instead of lipgloss.Style.Width()/lipgloss/table:
pkg/cli/engine_secrets.go:788 (secret name padding)
pkg/console/render.go:174 (struct field name padding — inside console pkg itself, lower priority since it's the shared formatter)
These aren't bugs, but migrating to lipgloss.Style{}.Width(n) would remove manual rune-width arithmetic and handle wide/unicode names more robustly.
compile_schedule_calendar.go builds a calendar heatmap manually with strings.Builder + per-cell fmt.Fprintf("%02d "); this is a reasonable custom visualization, but lipgloss/table could reduce manual width bookkeeping if revisited.
3. Huh forms — theme exists, unused
pkg/styles/huh_theme.go defines a complete HuhTheme huh.ThemeFunc mapping the CLI's color palette to focused/blurred field styles, select indicators, buttons, and text inputs — clearly intended for future interactive prompts.
No command currently imports charmbracelet/huh to build an actual form. Any interactive Y/N or manual bufio.Scanner prompt in the CLI should be checked against this theme when confirmation/selection UX is added, so the investment in HuhTheme isn't stranded.
4. TTY detection — centralized correctly
All raw term.IsTerminal calls live in pkg/tty/tty.go (IsStdoutTTY, IsStderrTTY); pkg/console builds its isTTY/isStderrTTY helpers on top of it consistently, and format functions take an injectable ttyCheck func() bool for testability — a solid pattern for degrade-to-plain-text behavior in pipes/redirects.
Recommendations
Low priority / cosmetic: Replace the 3 manual %-*s padding call sites (engine_secrets.go:788, compile_schedule_calendar.go:269, console/render.go:174) with lipgloss.Style{}.Width(n) for consistent unicode-width handling.
Opportunity: Wire up the existing unused styles.HuhTheme the next time an interactive prompt/confirmation is added to the CLI (e.g., destructive-action confirmations), rather than hand-rolling a scanner-based prompt.
No action needed for the 2 remaining fmt.Print* sites — they're intentional final emission of already-console-formatted output.
Overall, no widespread inconsistency was found; the console/styles/tty package boundaries are well respected throughout pkg/.
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.
Terminal Stylist Report — Console Output Consistency Analysis
Scanned all non-test
.gofiles underpkg/. Overall the codebase is highly consistent: thepkg/consolepackage (Lipgloss-based, 551 LOC) is used broadly, with 1,828console.Format*calls across 20+ CLI files, and 20 files leverageconsole.RenderTable/RenderStruct.pkg/stylescentralizes a Dracula-inspired adaptive color palette, andpkg/ttycentralizes TTY detection (no scatteredterm.IsTerminal/isattycalls found outside it).Key metrics
fmt.Print*in non-test/non-testdata code: only 2 occurrences, both intentional pass-throughs of pre-renderedconsole-formatted strings (status_command.go:288,view_command.go:168).console.*usage: 248 files.lipgloss.*direct usage: 6 files (mostly insidepkg/styles/pkg/console, as intended — good encapsulation).huh(interactive forms) usage: 0 files importcharmbracelet/huhfor actual forms, despite a fully-builtpkg/styles/huh_theme.gotheme existing unused.%-*spadding for column alignment: 3 call sites, none usinglipgloss/tableorconsole.RenderTable.Detailed findings
1. Console package usage — good
pkg/console/console.goprovidesFormatError,FormatSuccessMessage,FormatInfoMessage,FormatWarningMessage,FormatErrorChain,RenderTable, etc., each with TTY-aware stdout/stderr variants (e.g.FormatInfoMessagevsFormatInfoMessageStderr). This dual-variant pattern is applied consistently.fmt.Print/fmt.Fprintlncalls instatus_command.goandview_command.goalready wrapconsole.RenderStruct(...)/pre-renderedconsoleoutput, so they are not violations — just the terminalPrintof an already-styled string.2. Lipgloss usage — well encapsulated but a few manual-formatting gaps
pkg/styles/theme.godefineslipgloss.AdaptiveColor{Light:..., Dark:...}values used everywhere vialipgloss.LightDark(isDark)(seehuh_theme.go), which is the correct adaptive-color pattern.fmt.Sprintf("%-*s", width, ...)instead oflipgloss.Style.Width()/lipgloss/table:pkg/cli/engine_secrets.go:788(secret name padding)pkg/cli/compile_schedule_calendar.go:269(day-label padding)pkg/console/render.go:174(struct field name padding — inside console pkg itself, lower priority since it's the shared formatter)These aren't bugs, but migrating to
lipgloss.Style{}.Width(n)would remove manual rune-width arithmetic and handle wide/unicode names more robustly.compile_schedule_calendar.gobuilds a calendar heatmap manually withstrings.Builder+ per-cellfmt.Fprintf("%02d "); this is a reasonable custom visualization, butlipgloss/tablecould reduce manual width bookkeeping if revisited.3. Huh forms — theme exists, unused
pkg/styles/huh_theme.godefines a completeHuhTheme huh.ThemeFuncmapping the CLI's color palette to focused/blurred field styles, select indicators, buttons, and text inputs — clearly intended for future interactive prompts.charmbracelet/huhto build an actual form. Any interactiveY/Nor manualbufio.Scannerprompt in the CLI should be checked against this theme when confirmation/selection UX is added, so the investment inHuhThemeisn't stranded.4. TTY detection — centralized correctly
term.IsTerminalcalls live inpkg/tty/tty.go(IsStdoutTTY,IsStderrTTY);pkg/consolebuilds itsisTTY/isStderrTTYhelpers on top of it consistently, and format functions take an injectablettyCheck func() boolfor testability — a solid pattern for degrade-to-plain-text behavior in pipes/redirects.Recommendations
%-*spadding call sites (engine_secrets.go:788,compile_schedule_calendar.go:269,console/render.go:174) withlipgloss.Style{}.Width(n)for consistent unicode-width handling.styles.HuhThemethe next time an interactive prompt/confirmation is added to the CLI (e.g., destructive-action confirmations), rather than hand-rolling a scanner-based prompt.fmt.Print*sites — they're intentional final emission of already-console-formatted output.console/styles/ttypackage boundaries are well respected throughoutpkg/.All reactions