InteractiveReadLine
An extensible, composable readline library written in pure C# for creating interactive text-based
interfaces with System.Console and other console-like UI components.
Targets .NET Standard 2.0 and .NET 10 and has no external runtime dependencies.
var text = ConsoleReadLine.ReadLine();
Documentation
- The API Reference documents the public API directly from the source.
- The History article explains the history feature, from basic setup through custom update behavior.
- The repository README has the full guide, including animated examples of each feature.
- Run the repository's demo program to try each feature interactively.
Starting points in the API
| Type | Purpose |
|---|---|
| ConsoleReadLine | Reads lines from System.Console and provides the usual entry point |
| ReadLineConfig | Configures keys, formatting, lexing, auto-complete, and history |
| ReadLineResult | Distinguishes a finished line from an abandoned line or the end of input |
| CommonKeyBehaviors | The ready-made editing behaviors |
| BehaviorExtensionMethods | The ready-made key bindings |
| CommonFormatters | The ready-made display formatters |
| CommonLexers | Ready-made lexers and components for building custom lexers |
| IReadLineProvider | Defines a backend for input sources other than the console |
Installing
dotnet add package InteractiveReadLine