cints.CmdStarter 1.0.0

Prefix Reserved
dotnet add package cints.CmdStarter --version 1.0.0
                    
NuGet\Install-Package cints.CmdStarter -Version 1.0.0
                    
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="cints.CmdStarter" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="cints.CmdStarter" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="cints.CmdStarter" />
                    
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 cints.CmdStarter --version 1.0.0
                    
#r "nuget: cints.CmdStarter, 1.0.0"
                    
#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 cints.CmdStarter@1.0.0
                    
#: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=cints.CmdStarter&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=cints.CmdStarter&version=1.0.0
                    
Install as a Cake Tool

CmdStarter

CmdStarter turns plain C# code into a command-line interface built on System.CommandLine 2.0.14, the stable release of that library. Classes become commands and their public properties become options, or methods marked [Command] become commands. The library targets .NET 10 only, and supports Microsoft dependency injection in both models.

Features

  • Two command models: classes (inheriting StarterCommand, implementing IStarterCommand, or plain classes with no base class and no interface that carry [Command]) and [Command] methods.
  • Discovery by namespaces and class filters, or a command tree described in code with Starter.UseTree.
  • Options and arguments deduced from the code.
  • A Roslyn analyzer that reports definition errors at compile time.
  • Global options.
  • Validation attributes.
  • Command filters.
  • Microsoft dependency injection, with one scope per execution.
  • A REPL with history and completion.
  • Command sequences and text pipes.
  • A remote REPL over a named pipe.
  • Command states.
  • Generic Host integration.
  • Trimming and Native AOT, for an application that has the command catalog that the package generates.
  • Readable error messages and consistent exit codes.
public sealed class Hello : StarterCommand
{
    public string To { get; set; } = "World";

    public override Delegate HandlingMethod => (Action)(() => Console.Out.WriteLine($"Hello, {To}!"));
}

Documentation

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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 (1)

Showing the top 1 NuGet packages that depend on cints.CmdStarter:

Package Downloads
cints.CmdStarter.Hosting

Generic Host (Microsoft.Extensions.Hosting) integration for CmdStarter.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 119 11/6/2026
0.9.0.3-beta4.22272.1 478 6/1/2023
0.9.0.2-beta4.22272.1 399 5/31/2023
0.9.0.1-beta4.22272.1 244 5/31/2023
0.9.0-beta4.22272.1 233 5/31/2023

1.0.0: rewrite on System.CommandLine 2.0 stable and .NET 10, with breaking changes. Migration guide: https://github.com/CyberInternauts/CmdStarter/blob/master/docs/migration/0.9-to-1.0.md