System.CommandLine Namespace

Provides types for defining commands, options, arguments, and their relationships in command-line applications.

Classes

Argument

A symbol defining a value that can be passed on the command line to a command or option.

Argument<T>

A symbol defining a value that can be passed on the command line to a command or option.

ArgumentExtensions

Provides extension methods for Argument.

ArgumentValidation

Provides extension methods for Argument.

Command

Represents a specific action that the application performs.

CommandExtensions

Provides extension methods for Command.

CommandLineConfiguration

Represents the configuration used by the Parser.

CommandLineConfigurationException

Indicates that a command line configuration is invalid.

CompletionSourceExtensions

Provides extension methods for working with completion sources.

CompletionSourceList

A list of completion sources to be used when providing completions for completion.

ConsoleExtensions

Provides extension methods for IConsole.

DiagramDirective

Enables the use of the [diagram] directive, which when specified on the command line will short circuit normal command handling and display a diagram explaining the parse result for the command line input.

Directive

The purpose of directives is to provide cross-cutting functionality that can apply across command-line apps. Because directives are syntactically distinct from the app's own syntax, they can provide functionality that applies across apps.

A directive must conform to the following syntax rules:

  • It's a token on the command line that comes after the app's name but before any subcommands or options.
  • It's enclosed in square brackets.
  • It doesn't contain spaces.
DirectiveCollection

A collection of directives parsed from a command line.

EnvironmentVariablesDirective

Enables the use of the [env:key=value] directive, allowing environment variables to be set from the command line during invocation.

Handler

Provides methods for creating and working with command handlers.

IdentifierSymbol

A symbol, such as an option or command, having one or more fixed names in a command line interface.

InvocationConfiguration
LocalizationResources

Provides localizable strings for help and error messages.

Option

A symbol defining a named parameter and a value for that parameter.

Option<T>

A symbol defining a named parameter and a value for that parameter.

OptionExtensions

Provides extension methods for Option.

OptionValidation

Provides extension methods for Option.

ParserConfiguration

Represents the configuration used by the CommandLineParser.

ParseResult

Describes the results of parsing a command line input based on a specific parser configuration.

RootCommand

Represents the main action that the application performs.

Symbol

Defines a named symbol that resides in a hierarchy with parent and child symbols.

VersionOption

A standard option that indicates that version information should be displayed for the app.

Structs

ArgumentArity

Defines the arity of an option or argument.

Interfaces

IConsole

Represents the standard console input, output, and error streams.