Proposal: optional "Pretty" output using Spectre.Console live tables
- Dominant language
- C#
- Stars
- 11.5k
- Forks
- 960
- PR merge metrics
- No merged PRs in 30d
Description
I am proposing this issue because I'd also be interested in contributing the PR, if it's something the team is interested in. I figured we could discuss the proposal here before I get ahead of myself with a PR.
## Is Your Feature Request Related To A Problem? Please describe.
As a non-machine user, I sometimes have small difficulty navigating the package lists that chocolatey outputs, such as `choco outdated` returning `7zip|22.0|22.1|false`. I know the ability exists to make these things cleaner.
## Describe The Solution. Why is it needed?
To create a better experience for humans interacting with the chocolatey CLI, and to further differentiate chocolatey as a world-class package manager.
## Additional Context.
Was very impressed looking at Spectre.Console's live display: https://spectreconsole.net/live/live-display
It's a very well-maintained package and seems to be a reasonable dependency with a fairly complete feature set. So from a supply chain risk perspective, seems minimal at this point.
## Related Issues
None that I could find.
## Implementation Proposal
I think this could be achieved by:
* Taking a dependency on `Spectre.Console`
* Creating an `ITableOutputter` (or a different name) with two implementations -- the current `Log()` strategy, and the `Spectre.Console` Based live table strategy
* Method to output table header (the existing text vs a header row of the table)
* Method to append rows to the table (`Log()` vs the Spectre live table append)
* Updating `ChocolateyPackageService.cs` to use the `ITableOutputter`
* Choosing the strategy based on config `e.g. --pretty` for human readable, or `--machine` for the current route if you want to make the pretty approach the default. This can be whatever you'd like.
* And maybe an option to set this globally as a user preference, like one can do with `-y`. Not sure if that is OOTB with all config options or not.
* Pass in the appropriate `TableOutputter` strategy to the `ChocolateyPackageService` at runtime.
Contributor guide
Research direction
Start by reading ChocolateyPackageService.cs and tracing how the current Log() strategy formats package-list output. Review the proposed ITableOutputter abstraction, Spectre.Console dependency, and --pretty/--machine configuration choices. Done means the CLI supports a documented human-readable table mode while preserving the current machine-readable output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100