Luna.DevTools.Core 1.0.4

dotnet add package Luna.DevTools.Core --version 1.0.4
NuGet\Install-Package Luna.DevTools.Core -Version 1.0.4
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="Luna.DevTools.Core" Version="1.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Luna.DevTools.Core --version 1.0.4
#r "nuget: Luna.DevTools.Core, 1.0.4"
#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 Luna.DevTools.Core as a Cake Addin
#addin nuget:?package=Luna.DevTools.Core&version=1.0.4

// Install Luna.DevTools.Core as a Cake Tool
#tool nuget:?package=Luna.DevTools.Core&version=1.0.4

About

DevTools Core is package designed to help create CLI tools that automate repetitive tasks. It offers robust support for command-line parsing, command creation, and more.

How to use

Install Luna.DevTools.Core NuGet package

dotnet add package Luna.DevTools.Core

Create a new class that inherits from CommandBase and override the ExecuteAsync method. This method will be called when the command is executed. Add the Command attribute to the class and provide the command name as the first argument.

[Command("my-command")]
public class MyCommand : CommandBase
{
    public override async Task<bool> ExecuteAsync();
    {
        Console.WriteLine("Hello, World!");

        return true;
    }
}

In the Program.cs file, create a new instance of the CliApplicationBuilder class and add the command to it and build the application instance.

var app = CliApplication.CreateBuilder(args)
    .AddCommand<MyCommand>()
    .Build();

Finally, run the application with the RunAsync method.

await app.RunAsync();

Build the application and run it. As a result, the command my-command will be available in the CLI application.

For the example above, the output for application called CliToolApp will be:

$ CliToolApp my-command

Hello, World!
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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.4 101 5/5/2024
1.0.3 88 5/5/2024