Install
| Product | Versions |
|---|---|
| .NET | |
| .NET Standard |
README
Nullean.Argh.Hosting

Microsoft.Extensions.Hosting integration for Nullean.Argh: CLI commands resolved from DI, with Ctrl+C linked to host shutdown.
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__schemarun 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
- Documentation: https://argh.nullean.net
- Source and issues: https://github.com/nullean/argh
Changes from Previous Version
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.