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
The 2026 "terminal renaissance" rewards small tools that offer an optional TUI (Posting, lazygit, serpl, etc.). scratchpatch is currently pure command + colorized table — great for scripting, but browsing/managing many scratches means eyeballing sp ls and copy-pasting IDs. sp tui adds an optional full-screen Bubble Tea browser over the same store: arrow-key through live + morgue scratches, preview content in a side pane, and act on the selection (open, rm→morgue, resurrect, promote, pin) without ever leaving the terminal.
This is explicitly a v0.2 capability — the v0.1 PLAN.md deliberately deferred a TUI ("no full-screen UI" in M-scope). Now that the command surface is stable, the TUI is a thin interactive shell over existing store/index/render logic, not a rewrite.
Why it fits
Reuses internal/store, internal/index, internal/ttl, and the existing secret-scan + expiry classification. No new source-of-truth.
Charm stack (lipgloss) is already a dependency; bubbletea + bubbles are the natural companions.
Strictly additive: scripting/--json paths untouched; sp tui is opt-in and degrades to a clear error when stdout is not a TTY.
Acceptance criteria
sp tui launches a full-screen browser listing live scratches (id, name, age, expires-in, size, 🔑 secret marker), color-coded by expiry like sp ls.
Toggle to the morgue view (e.g. tab/m) showing purge countdowns.
Right-hand preview pane shows the selected scratch's content (respects/notes secret scratches; does not dump raw credentials by default).
Key-bound actions on the selection: open in $EDITOR (suspend/restore TUI), rm (→ morgue), resurrect, promote, with a confirmation for anything that moves files. All go through existing store operations (still two-step / never hard-delete from the TUI).
Live filter/search box (by name/tag).
Graceful, clear error when not attached to a TTY ("sp tui needs an interactive terminal; use sp ls/sp ls --json for scripting").
Help/keybinding footer; q/esc quits cleanly and restores the terminal.
No changes to any --json or plain command output; TUI code isolated (e.g. internal/tui).
Tests where practical (model update/transition unit tests via Bubble Tea's test helpers); go build/go vet/go test ./.../gofmt clean.
Pitch
The 2026 "terminal renaissance" rewards small tools that offer an optional TUI (Posting, lazygit, serpl, etc.). scratchpatch is currently pure command + colorized table — great for scripting, but browsing/managing many scratches means eyeballing
sp lsand copy-pasting IDs.sp tuiadds an optional full-screen Bubble Tea browser over the same store: arrow-key through live + morgue scratches, preview content in a side pane, and act on the selection (open, rm→morgue, resurrect, promote, pin) without ever leaving the terminal.This is explicitly a v0.2 capability — the v0.1 PLAN.md deliberately deferred a TUI ("no full-screen UI" in M-scope). Now that the command surface is stable, the TUI is a thin interactive shell over existing store/index/render logic, not a rewrite.
Why it fits
internal/store,internal/index,internal/ttl, and the existing secret-scan + expiry classification. No new source-of-truth.lipgloss) is already a dependency;bubbletea+bubblesare the natural companions.--jsonpaths untouched;sp tuiis opt-in and degrades to a clear error when stdout is not a TTY.Acceptance criteria
sp tuilaunches a full-screen browser listing live scratches (id, name, age, expires-in, size, 🔑 secret marker), color-coded by expiry likesp ls.tab/m) showing purge countdowns.sp tuineeds an interactive terminal; usesp ls/sp ls --jsonfor scripting").q/escquits cleanly and restores the terminal.--jsonor plain command output; TUI code isolated (e.g.internal/tui).go build/go vet/go test ./.../gofmtclean.sp tuiand its keybindings.