waf/PrettyPrompt

A cross-platform command line input library that provides syntax highlighting, autocompletion, history and multi-line input.

C#

207

558 commits

updated Aug 16, 2026

See the code

README

PrettyPrompt

Nuget Code Coverage Build Status

A cross-platform command line prompt that provides syntax highlighting, autocompletion, history and more! It's Console.ReadLine() on steroids.

PrettyPrompt screenshot

Features

  • User Experience (UX) features:
    • Syntax highlighting support via ANSI escape sequences. Supports both the terminal color palette and full RGB colors.
    • Autocompletion menu, with extended documentation tooltips and overload menus.
    • Multi-line input with word-wrapping
    • Word-wrapping
    • History navigation, optionally persistent across sessions, with history filtering (similar to PSReadLine's HistorySearchBackward).
    • Unsurprising keybindings: Home, End, Ctrl-L to clear screen, Ctrl-C to cancel current line, Ctrl+Space to open autocomplete menu, and more.
    • Cross platform copy/paste: Ctrl-Shift-C for copy, Ctrl-V or Shift-Insert for pasting.
    • Optionally detects incomplete lines and converts Enter to a "soft newline" (Shift-Enter).
    • Optionally autoformats input text as it's typed.
    • Works "in-line" on the command line; it doesn't take over the entire terminal window.
  • Developer Experience (DX) features:
    • Many customization hooks available for configuring PrettyPrompt for your application (see IPromptCallbacks).
    • Provides a CancellationToken for each prompt result, so the end-user of your application can cancel long running tasks via Ctrl-C.
    • Fast rendering—PrettyPrompt only renders the diff of what changed, so the screen doesn't flicker as text is redrawn.

Installation

PrettyPrompt can be installed from nuget by running the following command:

dotnet add package PrettyPrompt

Usage

A simple read-eval-print-loop looks like this:


var prompt = new Prompt(
    configuration: new PromptConfiguration(prompt: "> "));

while (true)
{
    var response = await prompt.ReadLineAsync();
    if (response.IsSuccess) // false if user cancels, i.e. ctrl-c
    {
        if (response.Text == "exit") break;

        Console.WriteLine("You wrote " + response.Text);
    }
}

The Prompt constructor takes optional configuration options for enabling syntax highlighting, autocompletion, and soft-newline configuration. For a more complete example, see the project in the examples directory. If you have the dotnet example global tool installed, run the following command in the repository root:

dotnet example FruitPrompt

Building from source

This application targets .NET 10, and can be built with either Visual Studio or the normal dotnet build command line tool.

autocompletion
dotnet
readline
repl
syntax-highlighting

waf/PrettyPrompt

A cross-platform command line input library that provides syntax highlighting, autocompletion, history and multi-line input.

C#

207

558 commits

updated Aug 16, 2026

See the code

README

PrettyPrompt

Nuget Code Coverage Build Status

A cross-platform command line prompt that provides syntax highlighting, autocompletion, history and more! It's Console.ReadLine() on steroids.

PrettyPrompt screenshot

Features

  • User Experience (UX) features:
    • Syntax highlighting support via ANSI escape sequences. Supports both the terminal color palette and full RGB colors.
    • Autocompletion menu, with extended documentation tooltips and overload menus.
    • Multi-line input with word-wrapping
    • Word-wrapping
    • History navigation, optionally persistent across sessions, with history filtering (similar to PSReadLine's HistorySearchBackward).
    • Unsurprising keybindings: Home, End, Ctrl-L to clear screen, Ctrl-C to cancel current line, Ctrl+Space to open autocomplete menu, and more.
    • Cross platform copy/paste: Ctrl-Shift-C for copy, Ctrl-V or Shift-Insert for pasting.
    • Optionally detects incomplete lines and converts Enter to a "soft newline" (Shift-Enter).
    • Optionally autoformats input text as it's typed.
    • Works "in-line" on the command line; it doesn't take over the entire terminal window.
  • Developer Experience (DX) features:
    • Many customization hooks available for configuring PrettyPrompt for your application (see IPromptCallbacks).
    • Provides a CancellationToken for each prompt result, so the end-user of your application can cancel long running tasks via Ctrl-C.
    • Fast rendering—PrettyPrompt only renders the diff of what changed, so the screen doesn't flicker as text is redrawn.

Installation

PrettyPrompt can be installed from nuget by running the following command:

dotnet add package PrettyPrompt

Usage

A simple read-eval-print-loop looks like this:


var prompt = new Prompt(
    configuration: new PromptConfiguration(prompt: "> "));

while (true)
{
    var response = await prompt.ReadLineAsync();
    if (response.IsSuccess) // false if user cancels, i.e. ctrl-c
    {
        if (response.Text == "exit") break;

        Console.WriteLine("You wrote " + response.Text);
    }
}

The Prompt constructor takes optional configuration options for enabling syntax highlighting, autocompletion, and soft-newline configuration. For a more complete example, see the project in the examples directory. If you have the dotnet example global tool installed, run the following command in the repository root:

dotnet example FruitPrompt

Building from source

This application targets .NET 10, and can be built with either Visual Studio or the normal dotnet build command line tool.

autocompletion
dotnet
readline
repl
syntax-highlighting

Project health

Latest release

6.0.5 · Aug 16, 2026

Releases this year

9

Significant stargazers

Lucas Trzesniewski

116 followers · starred Jan 2026

Kirill Osenkov

1,319 followers · starred Jul 2025

Jared Hester

113 followers · starred Oct 2025

Charles Chen

161 followers · starred Jan 2023