Improve aspire config list output formatting#14600
Conversation
- Render local and global configuration in Spectre.Console tables with rounded borders and titled headers for visual distinction - Show each available feature on its own line with description and default value instead of a comma-separated list - Add hint text showing how to enable/disable features via aspire config set Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14600Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14600" |
There was a problem hiding this comment.
Pull request overview
This PR improves the output formatting of the aspire config list command by replacing plain text output with Spectre.Console tables featuring rounded borders and titles, and enhancing the display of available features with descriptions and default values.
Changes:
- Refactored configuration display to use formatted tables with visual separation
- Enhanced feature listing with individual lines showing name, default value, and description
- Added localized hint message to guide users on setting feature flags
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Aspire.Cli/Commands/ConfigCommand.cs | Refactored ListCommand to render config in Spectre.Console tables with rounded borders and titles; improved feature display with metadata |
| src/Aspire.Cli/Resources/ConfigCommandStrings.Designer.cs | Auto-generated designer file for new SetFeatureHint resource string |
| src/Aspire.Cli/Resources/ConfigCommandStrings.resx | Added SetFeatureHint resource string for feature configuration guidance |
| src/Aspire.Cli/Resources/xlf/*.xlf | Added SetFeatureHint translation entries (marked as "new" for localization) in all 12 supported languages |
Files not reviewed (1)
- src/Aspire.Cli/Resources/ConfigCommandStrings.Designer.cs: Language not supported
🎬 CLI E2E Test RecordingsThe following terminal recordings are available for commit
📹 Recordings uploaded automatically from CI run #22243526428 |
| } | ||
|
|
||
| return ExitCodeConstants.Success; | ||
| AnsiConsole.Write(table); |
There was a problem hiding this comment.
Previously we used to Write using the InteractionService, as oposed to bypassing and going directly to AnsiConsole.Write. To be honest, I'm not sure why listing config was done through the interaction service, but might be an important scenario, so just calling it out in case someone else knows why and we should change this.
There was a problem hiding this comment.
There's some centrlaized logic for understanding wht is suspported by the environment. Does it support color? is it inteactive? Are we in a CI environment? etc.
There was a problem hiding this comment.
AnsiConsole.Write it's a static method and makes unit testing output difficult. However, a bunch of other commands are also using it. Should clean up in the future.
joperezr
left a comment
There was a problem hiding this comment.
Minor question, but this looks good otherwise.
| } | ||
|
|
||
| return ExitCodeConstants.Success; | ||
| AnsiConsole.Write(table); |
There was a problem hiding this comment.
AnsiConsole.Write it's a static method and makes unit testing output difficult. However, a bunch of other commands are also using it. Should clean up in the future.
| foreach (var feature in unconfiguredFeatures) | ||
| { | ||
| InteractionService.DisplayMarkupLine($" [cyan]{kvp.Key.EscapeMarkup()}[/] = [yellow]{kvp.Value.EscapeMarkup()}[/]"); | ||
| var defaultText = feature.DefaultValue ? "true" : "false"; |
There was a problem hiding this comment.
Later, we'll need to go do a loc pass because there's a bunch of other stuff that's slipped through the cracks. Same thoughts as the others about the interaction service. I'll clean up in a follow up.
- Render local and global configuration in Spectre.Console tables with rounded borders and titled headers for visual distinction - Show each available feature on its own line with description and default value instead of a comma-separated list - Add hint text showing how to enable/disable features via aspire config set Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Summary
Cleans up the
aspire config listoutput to make configuration values more visually distinct from the available features section.Changes
Configuration tables: Local and global configuration sections now render in Spectre.Console tables with rounded borders and titled headers (matching the pattern used by
aspire describeandaspire docs). This gives them clear visual boundaries so they don't blend into the feature list.Available features: Instead of a comma-separated list of feature names, each feature is now displayed on its own line with:
true/false)A hint line at the bottom shows users how to set a feature:
aspire config set features.<name> true|false.Before
\
Local configuration:
some.key = some-value
Global configuration:
No global configuration found.
Available features:
execCommandEnabled, showDeprecatedPackages, stagingChannelEnabled, ...
\\
After
\
Local configuration
╭──────────┬────────────╮
│ Key │ Value │
├──────────┼────────────┤
│ some.key │ some-value │
╰──────────┴────────────╯
Global configuration
╭───────────────────────────────────╮
│ Key │ │
├───────────────────────────────────┤
│ No global configuration found. │
╰───────────────────────────────────╯
Available features:
execCommandEnabled (default: false)
Enable or disable the 'aspire exec' command...
showDeprecatedPackages (default: false)
Show or hide deprecated packages in 'aspire add' search results
Use 'aspire config set features. true|false' to enable or disable a feature.
\\
Testing
All 1300 Aspire.Cli.Tests pass.