dotnetup theme command
Reference
The theme command and config-based theming were implemented at commit 87eff2a on the nagilson-dnup-walkthrough-ux branch. That commit contains an (at least somewhat working) implementation but was removed for now.
What was removed
The dotnet up theme command and the Theme property on DotnetupConfigData were removed from the walkthrough UX PR (#53464) to keep the scope focused. The feature should be reviewed and shipped separately.
Removed files:
dotnetup/Commands/Theme/ThemeCommand.cs — CLI command with show/set/reset/use/list actions
dotnetup/Commands/Theme/ThemeCommandParser.cs — System.CommandLine parser definition
Removed from existing files:
DotnetupConfigData.Theme property (persisted ThemeColors in the user config JSON)
ThemeColors.s_presets — built-in preset themes (default, standard, monokai)
ThemeColors.s_properties — reflection-style get/set dictionary for color properties
DotnetupTheme.IsValidColor() — color string validation (hex, rgb, named)
- Config-based
DotnetupTheme.Load() — loaded theme from config file
- Parser registration and help group entry for the
theme command
- All theme-command and config-related tests in
ThemeTests.cs
What was kept
ThemeColors class with default color values (green, red, yellow, #9780E5, etc.)
DotnetupTheme static class with Current property and all markup helpers (Success(), Error(), Warning(), Accent(), Brand(), Dim(), SuccessAccent())
DotnetupTheme.Reload() (resets to defaults; ready for config-backed reload when re-introduced)
- Tests for default values and markup helpers
Proposal
This proposal should go into an actual design doc and we should review this. We should also make sure we maintain the regular ANSI colors / theme of the users terminal if they have any layer of customization on the colors.
-
dotnet up theme command with subcommands:
dotnet up theme — show current theme colors
dotnet up theme set <name> <value> — set an individual color (e.g. accent #FF0000)
dotnet up theme reset — reset all colors to defaults
dotnet up theme use <preset> — apply a built-in preset
dotnet up theme list — list available presets
-
Config persistence — Store a Theme section in the dotnetup config JSON so colors persist across sessions.
-
Built-in presets — At minimum: default (hex brand colors), standard (ANSI names that respect terminal palettes), and monokai.
-
Color validation — Validate user-supplied colors accept named Spectre.Console colors, #RRGGBB hex, and rgb(r,g,b).
-
Open questions:
- Should we explore
Spectre.Console's Color.Default to use the terminal's native foreground/background for some properties?
- Should preset themes be extensible (user-defined preset files)?
dotnetup theme command
Reference
The theme command and config-based theming were implemented at commit
87eff2aon thenagilson-dnup-walkthrough-uxbranch. That commit contains an (at least somewhat working) implementation but was removed for now.What was removed
The
dotnet up themecommand and theThemeproperty onDotnetupConfigDatawere removed from the walkthrough UX PR (#53464) to keep the scope focused. The feature should be reviewed and shipped separately.Removed files:
dotnetup/Commands/Theme/ThemeCommand.cs— CLI command with show/set/reset/use/list actionsdotnetup/Commands/Theme/ThemeCommandParser.cs— System.CommandLine parser definitionRemoved from existing files:
DotnetupConfigData.Themeproperty (persistedThemeColorsin the user config JSON)ThemeColors.s_presets— built-in preset themes (default, standard, monokai)ThemeColors.s_properties— reflection-style get/set dictionary for color propertiesDotnetupTheme.IsValidColor()— color string validation (hex, rgb, named)DotnetupTheme.Load()— loaded theme from config filethemecommandThemeTests.csWhat was kept
ThemeColorsclass with default color values (green, red, yellow, #9780E5, etc.)DotnetupThemestatic class withCurrentproperty and all markup helpers (Success(),Error(),Warning(),Accent(),Brand(),Dim(),SuccessAccent())DotnetupTheme.Reload()(resets to defaults; ready for config-backed reload when re-introduced)Proposal
This proposal should go into an actual design doc and we should review this. We should also make sure we maintain the regular ANSI colors / theme of the users terminal if they have any layer of customization on the colors.
dotnet up themecommand with subcommands:dotnet up theme— show current theme colorsdotnet up theme set <name> <value>— set an individual color (e.g.accent #FF0000)dotnet up theme reset— reset all colors to defaultsdotnet up theme use <preset>— apply a built-in presetdotnet up theme list— list available presetsConfig persistence — Store a
Themesection in the dotnetup config JSON so colors persist across sessions.Built-in presets — At minimum:
default(hex brand colors),standard(ANSI names that respect terminal palettes), andmonokai.Color validation — Validate user-supplied colors accept named Spectre.Console colors,
#RRGGBBhex, andrgb(r,g,b).Open questions:
Spectre.Console'sColor.Defaultto use the terminal's native foreground/background for some properties?