Skip to content

Getting Started

Installation

Install Sharprompt via NuGet:

powershell
Install-Package Sharprompt
sh
dotnet add package Sharprompt

Quick Start

csharp
using Sharprompt;

// Simple input
var name = Prompt.Input<string>("What's your name?");
Console.WriteLine($"Hello, {name}!");

// Password input
var secret = Prompt.Password("Type new password",
    validators: new[] { Validators.Required(), Validators.MinLength(8) });
Console.WriteLine("Password OK");

// Confirmation
var answer = Prompt.Confirm("Are you ready?", defaultValue: true);
Console.WriteLine($"Your answer is {answer}");

Running the Examples

The repository includes a sample project with all prompt types:

sh
dotnet run --project samples/Sharprompt.Example

Supported Platforms

PlatformTerminal
WindowsCommand Prompt, PowerShell, Windows Terminal
LinuxWindows Terminal (WSL 2), various terminal emulators
macOSTerminal.app, iTerm2, etc.

Released under the MIT License.