UglyPrompt 0.2.2

dotnet add package UglyPrompt --version 0.2.2
                    
NuGet\Install-Package UglyPrompt -Version 0.2.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="UglyPrompt" Version="0.2.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="UglyPrompt" Version="0.2.2" />
                    
Directory.Packages.props
<PackageReference Include="UglyPrompt" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add UglyPrompt --version 0.2.2
                    
#r "nuget: UglyPrompt, 0.2.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package UglyPrompt@0.2.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=UglyPrompt&version=0.2.2
                    
Install as a Cake Addin
#tool nuget:?package=UglyPrompt&version=0.2.2
                    
Install as a Cake Tool

UglyPrompt

A no-frills readline-style console line editor for .NET. Backslash continuation, command completion hints, bracketed paste, and history — with no external dependencies.

A permissively-licensed alternative to PrettyPrompt.

Installation

dotnet add package UglyPrompt

Usage

var editor = new LineEditor();

while (true)
{
    string? input = editor.ReadLine(">> ");
    if (input == null) break; // EOF or Ctrl+C
    Console.WriteLine(input);
}

ReadLine returns null on whitespace-only input. It handles backslash continuation internally — the returned string is the fully-joined multi-line value.

Completion Hints

Populate Commands or Kits to enable hints for / and + prefixes:

var editor = new LineEditor
{
    Commands =
    [
        new CompletionHint("/help",    "Show help"),
        new CompletionHint("/history", "Show conversation history"),
        new CompletionHint("/clear",   "Clear the screen"),
    ],
    Kits =
    [
        new CompletionHint("+core",  "Core tools"),
        new CompletionHint("+files", "File tools"),
    ],
};

When the current line starts with / or +, a terse comma-separated list of matching names is shown on an ephemeral line below the input and filtered as the user types. The hint is display-only — the user still types the full command and presses Enter to submit. Editing (arrows, history, Ctrl+U/W, etc.) works normally throughout.

Features

  • History — Up/Down arrows or Ctrl+P/N to navigate previous inputs
  • Backslash continuation — Lines ending with \ prompt for more input; the full value is returned joined with newlines
  • Bracketed paste — Handles terminal paste sequences including embedded newlines
  • Standard line editing — Home/End, Ctrl+A/E, Ctrl+U/K/W, Ctrl+T, and more (see below)
  • No dependencies — Only the .NET standard library; targets .NET 8.0

Keyboard Shortcuts

Keys Action
Left / Ctrl+B Move cursor left
Right / Ctrl+F Move cursor right
Home / Ctrl+A Move to start of line
End / Ctrl+E Move to end of line
Backspace / Ctrl+H Delete character before cursor
Delete / Ctrl+D Delete character at cursor
Ctrl+U Delete to start of line
Ctrl+K Delete to end of line
Ctrl+W Delete word before cursor
Ctrl+T Transpose characters
Ctrl+L / Escape Clear line
Up / Ctrl+P Previous history entry
Down / Ctrl+N Next history entry

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.2 123 4/24/2026
0.2.1 103 4/23/2026
0.2.0 113 4/22/2026
0.1.1 102 4/17/2026
0.1.0 105 4/16/2026