Jiro.Commands 3.0.4

dotnet add package Jiro.Commands --version 3.0.4
                    
NuGet\Install-Package Jiro.Commands -Version 3.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="Jiro.Commands" Version="3.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Jiro.Commands" Version="3.0.4" />
                    
Directory.Packages.props
<PackageReference Include="Jiro.Commands" />
                    
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 Jiro.Commands --version 3.0.4
                    
#r "nuget: Jiro.Commands, 3.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.
#:package Jiro.Commands@3.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Jiro.Commands&version=3.0.4
                    
Install as a Cake Addin
#tool nuget:?package=Jiro.Commands&version=3.0.4
                    
Install as a Cake Tool

Jiro.Commands

A flexible command and plugin framework for Jiro

Jiro.Commands provides a robust, extensible system for building plugins and runtime commands for the Jiro platform. It enables modular development, dynamic feature loading, and a clean separation of concerns for your application.


Features

  • Plugin Management: Standardized loading/unloading of plugins at runtime.
  • Runtime Command Creation: Add new commands without rebuilding or redeploying your app.
  • Dependency Injection: Full support for DI in commands and plugins.
  • Custom Controllers: Easily extend your API surface with plugin controllers.
  • Strong Typing & Parsing: Type-safe command parameters and extensible parsing.
  • XML Documentation: All public APIs are fully documented for IntelliSense and doc generation.

Getting Started

Installation

Add the Jiro.Commands project or NuGet package to your solution.

# Coming soon: NuGet package

Plugin Development

Create a plugin by implementing the IPlugin interface:

public class PluginMain : IPlugin
{
    public string PluginName { get; } = "PluginMain";

    // Optional: Register configuration files
    public void RegisterAppConfigs(ConfigurationManager builder)
        => builder.AddJsonFile("example.config.json", optional: true, reloadOnChange: true);

    // Optional: Register middleware
    public void RegisterAppExtensions(IApplicationBuilder app)
        => app.UsePluginMiddleware();

    // Required: Register services
    public void RegisterServices(IServiceCollection services)
        => services.AddScoped<IPluginService, PluginService>();
}

Plugin requirements:

  • Implement IPlugin.
  • Provide a unique PluginName.
  • Register any services, configs, or middleware as needed.

Custom Controllers

Extend the API by inheriting from BaseController:

public class PluginController : BaseController
{
    [HttpGet("PluginTest")]
    public IActionResult PluginTest() => Ok("Plugin Controller Executed");
}

Custom Commands

Define commands by using attributes and implementing ICommandBase:

[CommandModule("PluginCommand")]
public class PluginCommand : ICommandBase
{
    private readonly IPluginService _pluginService;
    public PluginCommand(IPluginService pluginService) => _pluginService = pluginService;

    [Command("PluginTest", commandSyntax: "PluginTest", commandDescription: "Tests plugin command")]
    public async Task<ICommandResult> PluginTest()
    {
        _pluginService.ServiceTest();
        await Task.Delay(1000);
        return TextResult.Create("Plugin Command Executed");
    }
}

Command requirements:

  • Class must have [CommandModule] attribute.
  • Class must implement ICommandBase.
  • Command methods must have [Command] attribute (with at least a name).
  • Command methods must return Task<ICommandResult>.
  • Use TextResult.Create, ImageResult.Create, JsonResult.Create, or GraphResult.Create for results.

API Reference

  • All public APIs are documented with XML comments.
  • See the source code for detailed usage and extension points.

Contributing

Contributions, issues, and feature requests are welcome! Please open an issue or pull request on GitHub.

Development Setup

This project uses EditorConfig to maintain consistent coding styles. Make sure your editor supports EditorConfig or install the appropriate extension:

Code Formatting

  • Run dotnet format before committing to ensure code follows the project's style guidelines
  • The CI pipeline will verify that code formatting is consistent
  • See docs/EDITORCONFIG.md for detailed information about coding standards

License

This project is licensed under the MIT License. See the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET 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.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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
3.0.4 129 7/13/2025
3.0.3 108 7/13/2025
3.0.2 91 7/13/2025
3.0.1 96 7/12/2025
1.0.6 420 6/26/2023
1.0.5 308 3/27/2023
1.0.4 285 3/10/2023
1.0.3 280 3/10/2023
1.0.1 277 3/9/2023
1.0.0 266 3/9/2023