`dotnetup theme` command
- Dominant language
- C#
- Stars
- 3.2k
- Forks
- 1.3k
- PR merge metrics
- PR metrics pending
Description
# dotnetup theme command
## Reference
The theme command and config-based theming were implemented at commit [`87eff2a`](https://github.com/dotnet/sdk/commit/87eff2a43cac6cc7e1dc8d8bcbffce9e556f4955) 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](https://github.com/dotnet/sdk/pull/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.
1. **`dotnet up theme` command** with subcommands:
- `dotnet up theme` — show current theme colors
- `dotnet up theme set ` — set an individual color (e.g. `accent #FF0000`)
- `dotnet up theme reset` — reset all colors to defaults
- `dotnet up theme use ` — apply a built-in preset
- `dotnet up theme list` — list available presets
2. **Config persistence** — Store a `Theme` section in the dotnetup config JSON so colors persist across sessions.
3. **Built-in presets** — At minimum: `default` (hex brand colors), `standard` (ANSI names that respect terminal palettes), and `monokai`.
4. **Color validation** — Validate user-supplied colors accept named Spectre.Console colors, `#RRGGBB` hex, and `rgb(r,g,b)`.
5. **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)?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.