EasyCommands 1.1.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package EasyCommands --version 1.1.1                
NuGet\Install-Package EasyCommands -Version 1.1.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="EasyCommands" Version="1.1.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EasyCommands --version 1.1.1                
#r "nuget: EasyCommands, 1.1.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.
// Install EasyCommands as a Cake Addin
#addin nuget:?package=EasyCommands&version=1.1.1

// Install EasyCommands as a Cake Tool
#tool nuget:?package=EasyCommands&version=1.1.1                

Easy Commands

Easy Commands is a C# library that lets you easily write a command-line UI. This is particularly useful for use cases such as modded game servers; chat bots on Discord, Twitch, etc.; and any other place where you'd want to convert a text command to an action. This project is also extendable enough to allow custom permission systems, custom command arguments, and anything else you'd want to use.

To install, simply go to Visual Studio's Package Manager Console and type Install-Package EasyCommands.

To specify a command, all you have to do is implement the abstract CommandHandler class and write out your command callbacks with this syntax:

[Command("add")]
// You can call this with `add 1 2`
public void Add(int num1, int num2)
{
    Console.WriteLine($"{num1} + {num2} = {num1 + num2}");
}

// You can parse any object type you want, as long as you define the behavior for it.
// You can call this with `permission-level John`
// Or with quotes, `permission-level "Betty Sue"`
[Command("permission-level")]
public void GetPermissionLevel(User user)
{
    Console.WriteLine($"{user.Name} has the permission level of {user.PermissionLevel}.");
}

Essentially, the arguments of your method specify the arguments of the command. It also supports optional parameters, subcommands, and much more. To read more about usage, visit the documentation. The Example project also demonstrates all of this library's functionality.

Product Compatible and additional computed target framework versions.
.NET Framework net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on EasyCommands:

Package Downloads
EasyCommandsTShock

Simplifies writing commands for TShock plugins

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.5.2 452 7/22/2023
1.2.5.1 566 12/26/2022
1.2.5 437 12/26/2022
1.2.4 895 2/27/2022
1.2.3 615 12/14/2020
1.2.2 505 12/13/2020
1.2.1 643 5/24/2020
1.2.0 516 5/24/2020
1.1.3 749 5/22/2019
1.1.2 559 5/22/2019
1.1.1 688 5/21/2019
1.1.0 571 5/21/2019
1.0.0 692 5/16/2019

Fixed build.