﻿---
title: Getting started
description: Nullean.Argh provides two entry points depending on your application model. Both share the same registration surface (Map, Map<T>, MapRoot, MapNamespace,...
url: https://docs-v3-preview.elastic.dev/argh/getting-started
---

# Getting started
Nullean.Argh provides two entry points depending on your application model. Both share the same registration surface (`Map`, `Map<T>`, `MapRoot`, `MapNamespace`, etc.) and the same source generator. The difference is how the runtime is bootstrapped and whether DI is available.
Use `Nullean.Argh` directly with `ArghApp` for lightweight CLIs with no external dependencies.
```xml
<ItemGroup>
  <PackageReference Include="Nullean.Argh" />
</ItemGroup>
```

```csharp
var app = new ArghApp();
app.Map("hello", MyHandlers.SayHello);
return await app.RunAsync(args);
```

**[Console app quick start →](https://docs-v3-preview.elastic.dev/argh/getting-started/console-app)**
Use `Nullean.Argh.Hosting` when your app is built on `Microsoft.Extensions.Hosting` and you want DI, lifetimes, and host integration.
```xml
<ItemGroup>
  <PackageReference Include="Nullean.Argh.Hosting" />
</ItemGroup>
```

```csharp
var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddArgh(args, b =>
{
    b.Map("hello", MyHandlers.SayHello);
});
await builder.Build().RunAsync();
```

**[Hosted app quick start →](https://docs-v3-preview.elastic.dev/argh/getting-started/hosted-app)**

## Which package do I need?


| Scenario                                    | Package                   |
|---------------------------------------------|---------------------------|
| Simple CLI tool, no DI needed               | `Nullean.Argh`            |
| App uses `IHost`, needs DI, logging, config | `Nullean.Argh.Hosting`    |
| Building a shared middleware/parser library | `Nullean.Argh.Interfaces` |