A robust C#/.NET command line parser library with *nix getopt style, supporting F# and verb commands.
CommandLineParser is a comprehensive library for parsing command-line arguments in C# and .NET applications. It provides a standardized, *nix getopt-style interface to define options, switches, and verb commands, automating help generation and error reporting. It solves the problem of manually handling complex command-line inputs by offering a declarative, attribute-based approach.
C# and F# developers building console applications, CLI tools, or utilities that require robust command-line argument parsing, especially those targeting cross-platform environments.
Developers choose CommandLineParser for its extensive feature set, adherence to GNU getopt standards, and long-term stability with continuous updates since 2005. It stands out with native F# support, verb command functionality, and zero external dependencies, making it a reliable, self-contained solution.
The best C# command line parser that brings standardized *nix getopt style, for .NET. Includes F# support
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports .NET Framework 4.0+, Mono, .NET Standard, and .NET Core on Windows, Linux, and macOS, ensuring broad applicability for diverse .NET environments.
Enables git-like subcommands (e.g., 'add', 'commit') for complex CLI applications, allowing structured command hierarchies as demonstrated in the examples.
Automatically parses to sequences, enums, nullable types, and any type with a string constructor (like System.Uri), reducing manual parsing code.
Generates help screens with localization and intuitive error reporting, streamlining user assistance without boilerplate, as shown in the Quick Start examples.
The library has undergone significant API revisions since v1.9.x, requiring migration efforts for existing projects, as noted in the README with separate documentation for older versions.
Relies entirely on attributes for defining options, which can be verbose and less flexible for dynamic or code-first approaches compared to fluent APIs.
F# support requires an additional NuGet package (CommandLineParser.FSharp), adding complexity and an extra dependency for F# developers, as mentioned in the README.