FlowCommandLine 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package FlowCommandLine --version 1.0.1
                    
NuGet\Install-Package FlowCommandLine -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FlowCommandLine" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FlowCommandLine" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="FlowCommandLine" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FlowCommandLine --version 1.0.1
                    
#r "nuget: FlowCommandLine, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=FlowCommandLine&version=1.0.1
                    
Install FlowCommandLine as a Cake Addin
#tool nuget:?package=FlowCommandLine&version=1.0.1
                    
Install FlowCommandLine as a Cake Tool

nugeticon

FlowCommandLine

A fast and simple command line parser that works in two modes: command-based (e.g. git commit ...) or parameters-only. Parsing can be happened to any model class or record with parameterless constructor. It support modern dotnet core runtimes (net8+), compilation in NativeAot. It supported auto documentation for commands and parameters. Model parameters mapped types is supported: int, long, double, float, string, DateOnly, DateTime, TimeSpan. By default, the output will be to the system console, but can be redefined to any of your case - instead CommandLine.Console () you can use new CommandLine (new MyConsoleCommandLineProvider()) where MyConsoleCommandLineProvider it is you class which is implement ICommandLineProvider interface.

Command-based mode

Example command line:
myconapp runapp --param1=stringvalue --param2=120

public class Test {
    public string Param1 { get; set; } = "";
    public int Param2 { get; set; }
}

CommandLine.Console ()
    // setup console application description version and so on
    .Application ( "My Console App", "1.0.0", "full description.", "Copyright My Super Corporation", "myconapp" ) 
    .AddCommand ( // add console command
        "runapp", // command name
        ( Test parameters ) => { // command delegate handler for class Test
            ...
        },
        "Command description", // command description :)
        new List<FlowCommandParameter> { // adjust command parameters
            new FlowCommandParameter {
                FullName = "param1", // for parameter in format --param1
                ShortName = "p1, // for parameter in format -p1
                PropertyName = "Param1" // it 
                Description = "parameter description",
                Required = true, // parameter is required
            },
            new FlowCommandParameter {
                FullName = "param2", // full name is required property, other properties ShortName or PropertyName can be inferred from FullName
                Description = "parameter2 description",
                Required = false,
            }
        }
    )
    .RunCommand ();

Parameters-only mode

Example command line:
myconapp --param1=stringvalue --param2=120

var options = CommandLine.Console ()
    .Application ( "My Console App", "1.0.0", "full description.", "Copyright My Super Corporation", "myconapp" )
    .AddOption ( "p1", "param1", "parameter 1 description", required: true )
    .AddOption ( "p2", "param2", "parameter 2 description", required: false )
    .RunOptions<Test> (); // run options parse and 
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.7 137 4/13/2025
1.0.6 144 4/1/2025
1.0.5 103 3/30/2025
1.0.4 444 3/25/2025
1.0.3 65 3/21/2025
1.0.2 46 3/15/2025
1.0.1 133 3/11/2025
1.0.0 124 3/3/2025