Skip to content

PromtyBuild Beautiful CLI Tools

A powerful and flexible command-line parser and command executor framework for .NET

Promty

Quick Example

csharp
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);
    }
}
bash
# Run your command
dotnet run -- greet Alice --uppercase
# Output: HELLO, ALICE!

Installation

bash
dotnet add package Promty
xml
<PackageReference Include="Promty" Version="1.0.0" />

Released under the MIT License.