Skip to content

dotnetup theme command #53522

@nagilson

Description

@nagilson

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.

  1. 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
  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)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-CLIdotnetupWork items around the proposed `dotnetup` bootstrapper/toolchain management tool and library

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions