v0.27.0 dcb4c51

2026-02-10-cli-style-alignment-missing-commands.md RawHistoryFolder

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 open
  • dumber crashes show <report|latest>
  • dumber crashes issue <report|latest>
  • dumber sessions list
  • dumber 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 --json flags.

Approach

  1. Add small, focused renderers under internal/cli/styles/ for these command outputs.
  2. 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 like config status)
  3. 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.go

    • type SessionsCLIRenderer struct { theme *Theme }
    • RenderListHeader(limit int) string
    • RenderListEmpty() string
    • RenderListRow(info entity.SessionInfo) string (status icon + counts + relative time styling)
    • RenderRestoreStarted(sessionID string) string
    • RenderDeleteOK(sessionID string) string
    • RenderError(err error) string
  • internal/cli/styles/crashes_cli.go

    • type 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 existing config.go)

    • Add RenderOpening(path, editor string) string
    • Add RenderOpenHint(path string) string (e.g., when file missing)
    • Reuse RenderError(err) from ConfigRenderer

Command Changes

  • internal/cli/cmd/config.go

    • In runConfigOpen:
      • Use styles.NewConfigRenderer(app.Theme) (requires GetApp()/theme).
      • Print styled “opening …” message (optional).
      • For user-facing failures (missing config, missing editor), print renderer error/hint and return nil so Cobra doesn’t print a second unstyled error.
  • internal/cli/cmd/crashes.go

    • In runCrashesShow / runCrashesIssue:
      • Use a new CrashesCLIRenderer for framing/errors.
      • Keep the markdown body as-is on stdout.
  • internal/cli/cmd/sessions.go

    • In runSessionsList:
      • Keep --json identical.
      • Replace plain tabwriter output with themed lines (or a boxed, fixed-width table) produced by SessionsCLIRenderer.
    • In runSessionsRestore / runSessionsDelete:
      • Replace plain fmt.Printf success lines with themed status lines using icons from internal/cli/styles/icons.go.
      • Style user-facing errors similarly (print and return nil).

Tests

Add renderer unit tests (no bubbletea runtime needed):

  • internal/cli/styles/sessions_cli_test.go
  • internal/cli/styles/crashes_cli_test.go
  • internal/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 list
    • go run ./cmd/dumber sessions delete <id>
    • go run ./cmd/dumber crashes show latest
source
1# CLI Style Alignment Plan (Missing Commands)
2
3This 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.
4
5Excluded by request: `help`, `completion`, `gen-docs`, `browse`.
6
7## Scope
8
9Commands/subcommands to align:
10
11- `dumber config open`
12- `dumber crashes show <report|latest>`
13- `dumber crashes issue <report|latest>`
14- `dumber sessions list`
15- `dumber sessions restore <session-id>`
16- `dumber sessions delete <session-id>`
17
18Non-goals:
19
20- No changes to use cases, repositories, or adapters.
21- No changes to output formats for `--json` flags.
22
23## Approach
24
251. Add small, focused renderers under `internal/cli/styles/` for these command outputs.
262. Update the Cobra handlers in `internal/cli/cmd/` to use those renderers for:
27   - Success messages
28   - “not found / nothing to do” messages
29   - User-facing errors (print styled message and return `nil`, consistent with existing commands like `config status`)
303. Keep “raw content” outputs raw where users likely pipe/copy them (crash report markdown), and only style surrounding framing text.
31
32## Proposed Renderer Additions
33
34- `internal/cli/styles/sessions_cli.go`
35  - `type SessionsCLIRenderer struct { theme *Theme }`
36  - `RenderListHeader(limit int) string`
37  - `RenderListEmpty() string`
38  - `RenderListRow(info entity.SessionInfo) string` (status icon + counts + relative time styling)
39  - `RenderRestoreStarted(sessionID string) string`
40  - `RenderDeleteOK(sessionID string) string`
41  - `RenderError(err error) string`
42
43- `internal/cli/styles/crashes_cli.go`
44  - `type CrashesCLIRenderer struct { theme *Theme }`
45  - `RenderShowHeader(id string, generatedAt string) string` (optional)
46  - `RenderIssueHeader(id string) string` (optional, default off if it would break copy/paste)
47  - `RenderError(err error) string`
48
49- `internal/cli/styles/config_cli.go` (or extend existing `config.go`)
50  - Add `RenderOpening(path, editor string) string`
51  - Add `RenderOpenHint(path string) string` (e.g., when file missing)
52  - Reuse `RenderError(err)` from `ConfigRenderer`
53
54## Command Changes
55
56- `internal/cli/cmd/config.go`
57  - In `runConfigOpen`:
58    - Use `styles.NewConfigRenderer(app.Theme)` (requires `GetApp()`/theme).
59    - Print styled “opening …” message (optional).
60    - For user-facing failures (missing config, missing editor), print renderer error/hint and return `nil` so Cobra doesn’t print a second unstyled error.
61
62- `internal/cli/cmd/crashes.go`
63  - In `runCrashesShow` / `runCrashesIssue`:
64    - Use a new `CrashesCLIRenderer` for framing/errors.
65    - Keep the markdown body as-is on stdout.
66
67- `internal/cli/cmd/sessions.go`
68  - In `runSessionsList`:
69    - Keep `--json` identical.
70    - Replace plain tabwriter output with themed lines (or a boxed, fixed-width table) produced by `SessionsCLIRenderer`.
71  - In `runSessionsRestore` / `runSessionsDelete`:
72    - Replace plain `fmt.Printf` success lines with themed status lines using icons from `internal/cli/styles/icons.go`.
73    - Style user-facing errors similarly (print and return `nil`).
74
75## Tests
76
77Add renderer unit tests (no bubbletea runtime needed):
78
79- `internal/cli/styles/sessions_cli_test.go`
80- `internal/cli/styles/crashes_cli_test.go`
81- `internal/cli/styles/config_cli_test.go` (if adding new config-open rendering)
82
83Test strategy:
84
85- Use `styles.NewTheme(config.DefaultConfig())` to build a theme.
86- Assert key substrings are present (icons, command nouns, session IDs), avoiding strict ANSI comparisons.
87
88## Verification
89
90- `go test ./...`
91- `make lint`
92- Manual smoke:
93  - `go run ./cmd/dumber sessions list`
94  - `go run ./cmd/dumber sessions delete <id>`
95  - `go run ./cmd/dumber crashes show latest`
96

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close