Repository navigation
Description
We are resetting the System.CommandLine project to better align with the current ecosystem, isolate parsing behavior so it can be shares with other parser libraries and clarify long term maintenance. This work is intended to bring System.CommandLine out of preview mode.
System.CommandLine provides command line parsing focused on providing a full featured strongly typed command line parser. It is used by the .NET CLI, many .NET tools, and other console applications. The effort has been primarily volunteer powered and changes are needed to shift maintenance responsibility to the .NET teams and align with changes in the ecosystem.
Going forward, the effort will have three parts:
- A core parser which we plan to locate in the .NET Libraries
- An open source full featured parser relying on the core parser and extensible subsystems for end user behavior such as help
- An open ecosystem to encourage community creation/extension of parsers
We will separate the core parser which offers fast POSIX parsing, while also supporting other parsing styles including most Windows style parsers. This parser will be used by a full featured parser that will provide automatic help, tab completion, error reporting and other end-user features. The core parser itself will not provide any end user features, such as help.
A subsystem layer on top of the core parser will support full featured parsing with individually replaceable components. For example, it will support a help subsystem, and we will release the help system we use in the .NET CLI. CLI authors could select a different help subsystem within this extensibility model. We hope this design will foster creativity in the ecosystem by allowing folks to focus on specific aspects of the CLI experience while reusing the rest of the parser.
Parsers today
System.CommandLine is built on preview .NET CLI parsers and has had thousands of PRs across many years to match Posix guidance and user expectations. System.CommandLine has also been updated for fast parsing. While parsers seem simple, there are many hundreds of nuanced expectations within Posix, and parsing Windows command lines remains important for some tools.
For .NET, in addition to parsing behavior end users have expectations on the format of input and how those values are converted to strongly typed values. These two aspects - parsing behavior and type conversions - are the portion of System.CommandLine that is most stable and fast following performance work last year.
In the last five years, the ecosystem has done interesting things with command line libraries. For example, Spectre.Console has beautiful output and a CLI parser. We have worked with Spectre.Console's primary maintainer, @patriksvensson, who would like Spectre.Console's parser to have a dependency on a .NET-provided core parser, shifting responsibility for consistent POSIX parsing to .NET's core libraries. Working the other way, MSBuild is considering taking a dependency on Spectre.Console for output rendering.
A full featured parse will add a layer that meets end-user expectations for help, tab completion, error reporting and other supporting behavior. It will also provide the API used by CLI authors to supply information.
We believe the best way to build a ecosystem with consistent behavior and vibrant features is to provide a reusable core parser, an extensible model for features, and an open implementation of the features used in the .NET CLI and .NET tools.
The road here and onwards
System.CommandLine began as a side project for some Microsoft folks and has had many successes. Because we were creating a full featured parser, we combined feature behavior with core parser behavior. The long journey to redesign has been challenging and sometimes painful as we worked to balance needs of the community, .NET teams, the API review board, and the System.CommandLine team. We've delayed sharing plans until we had the first iteration of code isolating the parser and confidence in this design.
System.CommandLine will remain largely a community project. We are now aligned in intent and have the support of the API review board and the .NET Libraries team on the core parser, which we expect will be maintained by the .NET Libraries team. We are in the process of designing details of the subsystem layer. Overall, this effort involves very little new code since it mostly involves moving code. We have great tests across the system to make things easier.
There will be changes to the API for existing System.CommandLine CLI authors. The System.CommandLine preview will remain available so you can switch to the new library at your convenience. We intend a separate project to replace Dragonfruit with a simplified API that supports full features and subcommands.
The new project is code named "Powderhouse" and will live in a separate branch to avoid disrupting the existing stable main. The name comes from Powderhouse Square in Somerville, MA, in the Boston area.
We have a team, but we'd always love more help. One of the great aspects of that isolating the elements makes it easy to get involved. If you'd like to contribute, you'll find more in the main-powderhouse branch and with the Powderhouse label.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
shaggygi commentedon Mar 6, 2024
@KathleenDollard this is great news! any chance with the reboot there could be a related .net community standup to reiterate this topic, introduce the team, approximate milestones/dates, etc.? again, glad to hear there will be focus (on this complex project) and eventually a "released" version. 👍
KathleenDollard commentedon Mar 6, 2024
That is a great idea. I will see if we can get on the standup calendar, but we decided to skip next week (March) for the standup because several of us have conference commitments.
KalleOlaviNiemitalo commentedon Mar 7, 2024
Are prerelease packages from the
main-powderhousebranch being published to some NuGet feed? I don't see them in https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries/nuget/v3/index.json.shaggygi commentedon Mar 7, 2024
@KathleenDollard I noticed the above link at "in the main-powerderhouse branch" is pointing back to this issue.
KathleenDollard commentedon Mar 7, 2024
@KalleOlaviNiemitalo We are very early in the process and do not feel ready for a NuGet feed. We do plan to be on that feed when we are a bit further along.
KathleenDollard commentedon Mar 7, 2024
@shaggygi Thanks! I thought I fixed that when I fixed the Wikipedia link, but messed up
WeihanLi commentedon Mar 20, 2024
Great news, is there a roadmap and schedule?
justinmchase commentedon Mar 21, 2024
There has been a ton of commits in the main branch that are not published in a current nuget package. There are major bugs in the last beta4 release, it would be super nice if you could just drop one last release of whats in main before "resetting" and doing a major revamp.
iSazonov commentedon Mar 21, 2024
Are you considering integration with shells? For example, PowerShell 7? The easiest way for it is probably to have metadata that it can read. (As a bonus, this metadata could be created for native applications in some manifest.)
KathleenDollard commentedon Mar 21, 2024
@iSazonov
That's not in our current plans. I'd love to see an issue on the problems that it would solve and maybe some background on what would be needed as I am not familiar with that space.
We want to walk that thin line that avoids both feature creep and blocking good ideas that could be implemented in the future or as extensions. The core parser will be fairly locked down when we are done, and the extensions pretty powerful.
KathleenDollard commentedon Mar 21, 2024
@WeihanLi
Not yet. We are still working out the architecture.
17 remaining items
KalleOlaviNiemitalo commentedon Dec 12, 2024
There's a recent command-line tool from Microsoft. Guess whether it uses System.CommandLine: https://github.com/microsoft/cask/blob/202dcaead0664b90a28d2bf4aa2d3b5f550787e2/src/Cask.Cli/Cask.Cli.csproj#L8
reitowo commentedon Dec 14, 2024
More like "Sunsetting System.CommandLine"
gjaryczewski commentedon Mar 19, 2025
One year passed after resetting was announced. Is there any news about dropping the PREVIEW tag?
Lordfirespeed commentedon Mar 26, 2025
main-powderhouse: last commit 5 months agomain: last commit yesterday🤔 😂
thanks for your ongoing work, maintainers :) the future looks bright!
jamesshenry commentedon Mar 28, 2025
If anyone is interested in a C# CLI parser that is AOT-compatible, supports Microsoft.Extensions.Hosting and the other Extension libraries, and is actually in active development you might be interested in the following:
ConsoleAppFramework: ~200x faster than System.Commandline (when AOT compiled probably)
Cocona: ~2x faster than System.Commandline and supports .NET Standard 2.0
aetos382 commentedon Mar 31, 2025
If Powderhouse has been canceled, please announce that officially.
lloydjatkinson commentedon Apr 8, 2025
What do we need to do to get the .NET team to invest in System.CommandLine?
Lordfirespeed commentedon May 15, 2025
Sacrificing one's firstborn has been known to work in the past /j
GABRIELNGBTUC commentedon May 19, 2025
They are still pushing to their nightly releases and the .NET CLI recently updated their dependency on SCL so they are definitely investing in it. The issue is that it's mainly opaque (Whole classes like the CommandLineBuilder just dissapeared?) and the breaking changes don't seem to have any obvious way to fix with no documentation yet on how to upgrade.
precisionconage commentedon Jun 4, 2025
Adam Sitnik mentioned a month ago on #2500 that he'd ping people who might be able to provide more info, but given that there were no further comments, it seems they're not ready to talk discuss this yet. Hopefully there's an update soon.
justinmchase commentedon Jun 19, 2025
Congrats Microsoft for the new release! Genuine thanks for keeping this moving forward.
Dig in ladies and gentlemen:
https://github.com/dotnet/command-line-api/releases/tag/v2.0.0-beta5.25306.1
dimension-zero commentedon Sep 25, 2025
Just so confused
Not complaining - just genuinely curious and confused. Can anyone clarify?