Skip to content

RFC: SharpConsoleUI command center for the interactive shell#735

Draft
nickprotop wants to merge 1 commit into
managedcode:mainfrom
nickprotop:feat/consoleex-command-center
Draft

RFC: SharpConsoleUI command center for the interactive shell#735
nickprotop wants to merge 1 commit into
managedcode:mainfrom
nickprotop:feat/consoleex-command-center

Conversation

@nickprotop
Copy link
Copy Markdown

@nickprotop nickprotop commented May 11, 2026

What this is

A working prototype that replaces the prompt-first interactive shell (bare dotnet skills / agents) with a retained-mode SharpConsoleUI command center — the direction your docs/cli-rewrite-plan.md flagged as a possible later phase.

Opening as a draft for feedback on direction, not as a merge-ready change.

Demo

Screenshot From 2026-05-12 00-53-59

![SharpConsoleUI command center — Bundles page with bundle-detail modal]

How it works

  • InteractiveConsoleApppartial. The original Spectre.Console.SelectionPrompt loop is preserved as RunClassicShellAsync and used automatically when stdin/stdout is redirected (CI, pipes, dumb terminals). The new RunAsync is the SharpConsoleUI shell.
  • InteractiveConsoleApp.Shell.cs adds the ConsoleWindowSystem + NavigationView with pages for every HomeAction surface (Home, Skills, Installed, Collections, Bundles, Packages, Agents, Project, Analysis, Remove-all, Update-all, Settings, About) — driven by the existing NavigationSurfaceManifest.
  • Page content reuses the existing BuildRich* Spectre renderables verbatim, hosted in SpectreRenderableControlno rendering rewrite in this PR.
  • Selection flows: ListControl activation → modal Windows with a ToolbarControl row of ButtonControls. Mutations call the Runtime/* installers (SkillInstaller, AgentInstaller, ProjectSkillRecommender) directly and re-render the page in place.
  • Interactive bottom status bar (StatusBarControl, lazynuget / cxfiles style): dynamic per-page hints, clickable items, shortcut highlighting, ticking clock, live catalog summary, toast slot for action results. Ctrl+R / Ctrl+U / Ctrl+I shortcuts are also wired through the window's key handler so they actually fire.
  • Main window: rounded subtle border, hidden title, Maximized(); Esc and OnClosed both call ws.Shutdown(0). Modals: centered, non-minimizable / non-maximizable, Esc dismisses.
  • List selection theme is pinned so keyboard / mouse hover / mouse click all paint the same solid selection bar (otherwise HighlightBackgroundColor, ListHoverBackgroundColor, and ListUnfocusedHighlightBackgroundColor paint three different colours).
  • SharpConsoleUI 2.4.55 → 2.4.61, and added to ManagedCode.DotnetSkills.csproj — the main tool had no SharpConsoleUI reference yet; the dep was only declared in the agents / dotnet-agents wrappers, which compile the same sources.

Status

  • All four projects build clean (ManagedCode.DotnetSkills, ManagedCode.Agents, ManagedCode.DotnetAgents, ManagedCode.DotnetSkills.Tests).
  • All 613 tests pass.
  • dotnet skills <subcommand> (list / install / recommend / bundle list / agent install / …) is unchanged — only the bare interactive invocation is affected.
  • Action flows are intentionally simpler than the classic shell in places (single-select + confirm vs. multi-select with layout pickers). Catalog refresh and per-page mutations re-render in place via the new live state plumbing.

What's next if you like the direction

This PR keeps the Spectre Panel / Grid / Table renderables behind SpectreRenderableControl so the visual identity is preserved with minimum churn. Phase 2 — only worth doing if you want to commit to this surface — is replacing those with native SharpConsoleUI controls (PanelControl, TableControl, HorizontalGridControl, MarkupControl, …). That buys: per-row mouse interactivity, proper layout reflow, theme integration, no Spectre-renderable-in-a-buffer-cell quirks. Same page contracts, swap the leaf builders.

Questions for the maintainers

  1. Is this a direction you want dotnet-skills to take, given the cli-rewrite-plan.md framing?
  2. Full-screen alt-buffer TUI as the default for bare invocation vs. an opt-in (--ui / --shell)? Today CI and pipes already fall through to the classic shell automatically; the question is what a real-terminal user sees by default.
  3. If yes to direction — would you want Phase 2 (native controls) as a follow-up PR, or is the Spectre-renderable-in-a-control approach in this PR sufficient?

Replace the prompt-first Spectre.Console SelectionPrompt loop (bare
`dotnet skills` / `agents`) with a retained-mode SharpConsoleUI shell
built on ConsoleWindowSystem + NavigationView. The classic prompt
loop is preserved as RunClassicShellAsync and used automatically when
stdin/stdout is redirected (CI, pipes, dumb terminals).

InteractiveConsoleApp.Shell.cs (new) adds the command center:

- NavigationView with pages for every HomeAction surface (Home,
  Skills, Installed, Collections, Bundles, Packages, Agents, Project,
  Analysis, Remove-all, Update-all, Settings, About) driven by the
  existing NavigationSurfaceManifest.
- Page content reuses the existing BuildRich* Spectre renderables
  verbatim via SpectreRenderableControl - no rendering rewrite.
- Selection flows are ListControl activation -> modal Windows with a
  ToolbarControl row of ButtonControls. Mutations call the Runtime
  installers (SkillInstaller / AgentInstaller / ProjectSkillRecommender)
  directly and re-render the affected page in place.
- Interactive bottom status bar (StatusBarControl): per-page dynamic
  hints, clickable items, shortcut highlighting, ticking clock, live
  catalog summary, toast slot for action results. Ctrl+R / Ctrl+U /
  Ctrl+I shortcuts are also wired in the window key handler.
- Main window: rounded subtle border, hidden title, Maximized; Esc and
  OnClosed both call ws.Shutdown(0). Modals: centered, non-minimizable
  / non-maximizable, Esc dismisses.
- List selection theme is pinned so keyboard, mouse hover, and click
  all paint the same solid selection bar (otherwise the three list
  states render in three different colors).

SharpConsoleUI 2.4.55 -> 2.4.61, and added to ManagedCode.DotnetSkills
(the main tool had no SharpConsoleUI reference yet; the dep was only
declared in the agents / dotnet-agents wrappers, which compile the
same sources).

All four projects build clean. All 613 tests pass.
`dotnet skills <subcommand>` (list / install / recommend / ...) is
unchanged - only the bare interactive invocation is affected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant