Skip to content

Move HelpBuilder into a separate package #1930

Closed

Description

@jonsequitur

While help output is required for building a good command line tool, the API surface to provide something flexible enough for people's various needs is large. The HelpBuilder and associated types (e.g. HelpContext) provide this today but the API is still unwieldy. We won't get it right in the System.CommandLine GA timeframe. Improvements in other areas (e.g. VT formatting and templates) will come along and will change the way we might design a better help formatting system.

Still, HelpBuilder is flexible and a lot of understanding and feedback have gone into it, so we don't want to lose its capabilities.

The proposal here is the following:

  • Move these types into a separate package where the API can be improved prior to removing it from preview.
  • Retain default help functionality in System.CommandLine so that the HelpBuilder package isn't required. However, this default help experience will not allow customization beyond what is available via the various CliSymbol properties, e.g. CliOption.HelpName.
  • Provide guidance on how to use this package and others from the community to replace the default help behavior.

Activity

  1. added this to the 2.0 GA milestone on Nov 9, 2022
  2. KalleOlaviNiemitalo commented on Mar 31, 2023

    @KalleOlaviNiemitalo

    What does this mean? Which types are currently part of the "application framework layer"?

  3. jonsequitur commented on Mar 31, 2023

    @jonsequitur
    ContributorAuthor

    Sorry, I'll clarify the issue. A lot of these were quickly captured in API review lightning rounds and I didn't take the time to add more detail.

    In reviews and design discussions, we've been scoping a number of features out of the core System.CommandLine API that aren't appropriate for inclusion in the SDK. These include features like model binding, shell completion registrations, and a fine-grained help customization API.

    We've been referring to the place these kinds of features will move to as the "application framework layer", but the specifics vary from feature to feature and they'll really be independent components. For example, all rich binding support will likely come from source generators, while dotnet suggest registration will be replaced by some sort of end-user installation gesture.

  4. changed the title [-]Move `HelpBuilder` into the application framework layer[/-] [+]Move `HelpBuilder` into a separate package[/+] on Mar 31, 2023
  5. KalleOlaviNiemitalo commented on Sep 18, 2025

    @KalleOlaviNiemitalo

    What is the "separate package" to which HelpBuilder was moved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions