🎯
Type-Safe Argument Binding
Automatically bind command-line arguments to strongly-typed classes with full IntelliSense support.
A powerful and flexible command-line parser and command executor framework for .NET

using Promty;
[Description("greet", "Greets a person by name")]
public class GreetCommand : Command<GreetCommand.Args>
{
public class Args
{
[Description("name", "The name of the person to greet")]
public string Name { get; set; } = string.Empty;
[FlagAlias("uppercase", 'u')]
[Description("Print the greeting in uppercase")]
public bool Uppercase { get; set; }
}
public override Task<int> ExecuteAsync(Args args)
{
var greeting = $"Hello, {args.Name}!";
if (args.Uppercase) greeting = greeting.ToUpper();
Console.WriteLine(greeting);
return Task.FromResult(0);
}
}# Run your command
dotnet run -- greet Alice --uppercase
# Output: HELLO, ALICE!dotnet add package Promty<PackageReference Include="Promty" Version="1.0.0" />