CLI Style Alignment Plan (Missing Commands)
This plan targets CLI commands/subcommands that currently do not use internal/cli/styles renderers and also do not use Charmbracelet TUI packages (lipgloss, bubbles, bubbletea) in their execution path.
Excluded by request: help, completion, gen-docs, browse.
Scope
Commands/subcommands to align:
dumber config opendumber crashes show <report|latest>dumber crashes issue <report|latest>dumber sessions listdumber sessions restore <session-id>dumber sessions delete <session-id>
Non-goals:
- No changes to use cases, repositories, or adapters.
- No changes to output formats for
--jsonflags.
Approach
- Add small, focused renderers under
internal/cli/styles/for these command outputs. - Update the Cobra handlers in
internal/cli/cmd/to use those renderers for:- Success messages
- “not found / nothing to do” messages
- User-facing errors (print styled message and return
nil, consistent with existing commands likeconfig status)
- Keep “raw content” outputs raw where users likely pipe/copy them (crash report markdown), and only style surrounding framing text.
Proposed Renderer Additions
-
internal/cli/styles/sessions_cli.gotype SessionsCLIRenderer struct { theme *Theme }RenderListHeader(limit int) stringRenderListEmpty() stringRenderListRow(info entity.SessionInfo) string(status icon + counts + relative time styling)RenderRestoreStarted(sessionID string) stringRenderDeleteOK(sessionID string) stringRenderError(err error) string
-
internal/cli/styles/crashes_cli.gotype CrashesCLIRenderer struct { theme *Theme }RenderShowHeader(id string, generatedAt string) string(optional)RenderIssueHeader(id string) string(optional, default off if it would break copy/paste)RenderError(err error) string
-
internal/cli/styles/config_cli.go(or extend existingconfig.go)- Add
RenderOpening(path, editor string) string - Add
RenderOpenHint(path string) string(e.g., when file missing) - Reuse
RenderError(err)fromConfigRenderer
- Add
Command Changes
-
internal/cli/cmd/config.go- In
runConfigOpen:- Use
styles.NewConfigRenderer(app.Theme)(requiresGetApp()/theme). - Print styled “opening …” message (optional).
- For user-facing failures (missing config, missing editor), print renderer error/hint and return
nilso Cobra doesn’t print a second unstyled error.
- Use
- In
-
internal/cli/cmd/crashes.go- In
runCrashesShow/runCrashesIssue:- Use a new
CrashesCLIRendererfor framing/errors. - Keep the markdown body as-is on stdout.
- Use a new
- In
-
internal/cli/cmd/sessions.go- In
runSessionsList:- Keep
--jsonidentical. - Replace plain tabwriter output with themed lines (or a boxed, fixed-width table) produced by
SessionsCLIRenderer.
- Keep
- In
runSessionsRestore/runSessionsDelete:- Replace plain
fmt.Printfsuccess lines with themed status lines using icons frominternal/cli/styles/icons.go. - Style user-facing errors similarly (print and return
nil).
- Replace plain
- In
Tests
Add renderer unit tests (no bubbletea runtime needed):
internal/cli/styles/sessions_cli_test.gointernal/cli/styles/crashes_cli_test.gointernal/cli/styles/config_cli_test.go(if adding new config-open rendering)
Test strategy:
- Use
styles.NewTheme(config.DefaultConfig())to build a theme. - Assert key substrings are present (icons, command nouns, session IDs), avoiding strict ANSI comparisons.
Verification
go test ./...make lint- Manual smoke:
go run ./cmd/dumber sessions listgo run ./cmd/dumber sessions delete <id>go run ./cmd/dumber crashes show latest