Makes writing command line applications remarkably easy with built-in help facility and consistent user experience across Console, Web, and WinForms apps.
US.FreeWill.CommandLine is the simplest and most straight-forward way for you to implement a command line interface in ANY app, including Console, ASP.Net MVC, WebForms, WinForms, Telnet, Mobile apps or any other type of app you can think of. CommandLine is a NuGet package you can install into your .Net applications and begin processing command lines right away with extraordinarily little effort.
Why I Decided to Make This
I was tired of writing the same command-line parsing code over and over and dealing with coworkers reinventing parsing for every app written.
History
Started in 1998 as a desperately needed C++ helper class library. At the time, I was in a position of writing LOTS of console apps for a fortune 500 financial company that ran queries and generated reports. We had HUNDREDS of these programs and none of them followed any kind of template or standard. Each programmer reinvented the command line parsing every single time, which was crazy. So I created this. They got mad that I made it in C++, so I made another version in C, which was basically just getting rid of the keyword "class". Long story, so I won't get into it. Basically it was management not understanding software development. Then in 2003, when .Net went RTM, I converted it to C# and have been upgrading it over the decades as newer versions of C# came out and the .Net base class library got more sophisticated and I could delete more code from my library (mostly string manipulation).
The last update was in 2019-08-30, updating it to C# 7.0. I might make 1 last update for .Net Core, but a year or two ago (today is 2025-08-30 (coincidence, I know)), Microsoft finally added this command line functionality into the base class library and it's remarkably similar to my nuget package, so it makes me wonder if this might have been the inspiration for their version. If not, then we think an awful lot alike.
Future Plans
I might make 1 last update for .Net Core since the current version is for .Net Framework only.
Installation
Install via NuGet Package Manager:
Install-Package us.FreeWill.CommandLine
Install via .NET CLI:
dotnet add package us.FreeWill.CommandLine
Key Features
Built-in help facility for all commands
Consistent user experience across all app types
Works in Console, ASP.NET MVC, WebForms, WinForms
Mobile app support included
Extraordinarily easy to implement
Automatic parameter parsing and validation
Support for subcommands and nested commands
Customizable command aliases
Quick Example
Create a simple command-line interface in just a few lines:
using FreeWill.CommandLine;
public class Program
{
public static void Main(string[] args)
{
var cli = new CommandLineInterface();
cli.RegisterCommand("hello", (args) =>
{
Console.WriteLine($"Hello, {args.FirstOrDefault() ?? "World"}!");
});
cli.RegisterCommand("help", (args) =>
{
Console.WriteLine("Available commands: hello, help, exit");
});
cli.Start();
}
}