Skip to main content
net10.0net11.0net8.0net9.0.NETStandard2.0

Hosting integration for Nullean.Argh CLI applications.

Published
Nov 12, 2026
10d ago
Total Downloads
46.5K
46,462

Install

dotnet add package Nullean.Argh.Hosting --version 0.30.0
ProductVersions
.NET
net10.0net11.0net8.0net9.0
.NET Standard
netstandard2.0

README

Nullean.Argh.Hosting

Nullean.Argh

Microsoft.Extensions.Hosting integration for Nullean.Argh: CLI commands resolved from DI, with Ctrl+C linked to host shutdown.

NuGet

Install

dotnet add package Nullean.Argh.Hosting
dotnet add package Microsoft.Extensions.Hosting

Quick start

using Microsoft.Extensions.Hosting;
using Nullean.Argh.Hosting;

var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddArgh(args, b =>
{
	b.Map("hello", Handlers.Hello);
});
await builder.Build().RunAsync();

static class Handlers
{
	/// <summary>Greets someone by name.</summary>
	/// <param name="name">-n,--name, Name to greet.</param>
	public static void Hello(string name) => Console.WriteLine($"Hello, {name}!");
}

AddArgh mirrors the Map, Map<T>, UseGlobalOptions, UseNamespaceOptions, UseMiddleware and MapNamespace surface of ArghApp.

What you get

  • Dependency injection: handler parameters resolved from the DI container with proper lifetimes.
  • CancellationToken linked to the host: graceful shutdown propagates to your commands automatically.
  • Log suppression for intrinsic commands: --help, --version, completions and __schema run silently without host startup noise.

Native AOT size

Microsoft.Extensions.Hosting (DI, logging, options) adds several MB to a Native AOT binary, independent of Argh; this package is a thin adapter over it. If you don't need DI or hosted-service integration, use Nullean.Argh directly and call app.RunAsync(args) from Main for a much smaller AOT footprint. See AOT and binary size for measurements.

Learn more

Changes from Previous Version

No structural changes between v0.29.0 and v0.30.0.

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

Compatibility metadata lists 5 target frameworks; confirm the exact target used by your application.The published metadata declares 27 direct dependency entries across framework groups. Inspect the resolved dependency graph for your target framework.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.