Command Line
Command Line
HatTrick.CommandLine is a .NET 9 library for building structured, validated CLI applications. It covers argument parsing, type conversion, constraint validation, and handler dispatch.
Where to find Command Line
| Resource | Location |
|---|---|
| GitHub | github.com/HatTrickLabs/cli |
| NuGet | HatTrick.CommandLine |
Documentation
Register commands and dispatch your first handler.
The DefinitionRegistry singleton and how commands are registered.
Dot-separated command names and namespace grouping.
Terse and verbose flags, positional arguments, boolean options, and flag chaining.
Built-in type conversion and custom converters.
Option-level and command-level validation.
Synchronous and asynchronous command handlers.
Manipulate raw arguments before type conversion.
Read passwords and secrets with masked console input.
Built-in help, version, and interactive loop options.
Hydrate POCOs or invoke typed delegates from parsed options.
Exception types and when they are thrown.
How raw input moves through the Scanner, Tokenizer, and Parser stages.