System.CommandLine overview


System.CommandLine is currently in PREVIEW, and this documentation is for version 2.0 beta 4. Some information relates to prerelease product that may be substantially modified before it's released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

The System.CommandLine library provides functionality that is commonly needed by command-line apps, such as parsing the command-line input and displaying help text.

Apps that use System.CommandLine include the .NET CLI, additional tools, and many global and local tools.

For app developers, the library:

  • Lets you focus on writing your app code, since you don't have to write code to parse command-line input or produce a help page.
  • Lets you test app code independently of input parsing code.
  • Is trim-friendly, making it a good choice for developing a fast, lightweight, AOT-capable CLI app.

Use of the library also benefits app users:

NuGet package

The library is available in a NuGet package:

Next steps

To get started with System.CommandLine, see the following resources:

To learn more, see the following resources: