All Projects → shibayan → Sharprompt

shibayan / Sharprompt

Licence: mit
Interactive command line interface toolkit for C#

Programming Languages

csharp
926 projects

Projects that are alternatives of or similar to Sharprompt

Survey
A golang library for building interactive and accessible prompts with full support for windows and posix terminals.
Stars: ✭ 2,843 (+1343.15%)
Mutual labels:  cli, command-line, prompt, interactive
Go Prompt
Building powerful interactive prompts in Go, inspired by python-prompt-toolkit.
Stars: ✭ 4,255 (+2059.9%)
Mutual labels:  cli, command-line, prompt, interactive
Deno Cliffy
Command line framework for deno 🦕 Including Commandline-Interfaces, Prompts, CLI-Table, Arguments Parser and more...
Stars: ✭ 149 (-24.37%)
Mutual labels:  cli, command-line, prompt
Ink
🌈 React for interactive command-line apps
Stars: ✭ 17,505 (+8785.79%)
Mutual labels:  cli, command-line, interactive
Cocona
Micro-framework for .NET Core console application. Cocona makes it easy and fast to build console applications on .NET Core.
Stars: ✭ 398 (+102.03%)
Mutual labels:  cli, command-line, dotnet-core
Php Console
🖥 PHP CLI application library, provide console argument parse, console controller/command run, color style, user interactive, format information show and more. 功能全面的PHP命令行应用库。提供控制台参数解析, 命令运行,颜色风格输出, 用户信息交互, 特殊格式信息显示
Stars: ✭ 310 (+57.36%)
Mutual labels:  cli, command-line, interactive
Qoa
Minimal interactive command-line prompts
Stars: ✭ 2,007 (+918.78%)
Mutual labels:  cli, command-line, interactive
Terjira
Terjira is a very interactive and easy to use CLI tool for Jira.
Stars: ✭ 713 (+261.93%)
Mutual labels:  cli, command-line, prompt
Bit
Bit is a modern Git CLI
Stars: ✭ 5,723 (+2805.08%)
Mutual labels:  cli, prompt, interactive
Xonsh
🐚 Python-powered, cross-platform, Unix-gazing shell
Stars: ✭ 5,327 (+2604.06%)
Mutual labels:  cli, command-line, prompt
Inquirer Checkbox Plus Prompt
Checkbox with autocomplete and other additions for Inquirer
Stars: ✭ 25 (-87.31%)
Mutual labels:  cli, command-line, prompt
Prompts
❯ Lightweight, beautiful and user-friendly interactive prompts
Stars: ✭ 6,970 (+3438.07%)
Mutual labels:  cli, command-line, prompt
Node Promptly
Simple command line prompting utility for nodejs
Stars: ✭ 140 (-28.93%)
Mutual labels:  cli, command-line, prompt
Handlr
A better xdg-utils
Stars: ✭ 151 (-23.35%)
Mutual labels:  cli, command-line
Smenu
smenu started as a lightweight and flexible terminal menu generator, but quickly evolved into a powerful and versatile CLI selection tool for interactive or scripting use.
Stars: ✭ 1,906 (+867.51%)
Mutual labels:  command-line, interactive
Proji
A powerful cross-platform CLI project templating tool.
Stars: ✭ 156 (-20.81%)
Mutual labels:  cli, command-line
Snapstub
Copy API endpoints to your fs and run a local server using them
Stars: ✭ 193 (-2.03%)
Mutual labels:  cli, command-line
Command Line Api
Command line parsing, invocation, and rendering of terminal output.
Stars: ✭ 2,418 (+1127.41%)
Mutual labels:  command-line, dotnet-core
Craftsman
Craftsman is the workhorse behind the Wrapt framework and provides a suite of CLI commands for quickly scaffolding out new files and projects for your .NET Web APIs with simple CLI commands and configuration files.
Stars: ✭ 165 (-16.24%)
Mutual labels:  cli, dotnet-core
Mandown
man-page inspired Markdown viewer
Stars: ✭ 173 (-12.18%)
Mutual labels:  cli, command-line

Sharprompt

Build License Downloads

Interactive command line interface toolkit for C#

sharprompt

NuGet Package

Package Name Target Framework NuGet
Sharprompt .NET Standard 2.0 NuGet

Install

Install-Package Sharprompt
dotnet add package Sharprompt

Features

  • Multi-platform support
  • Supports the popular Prompts (Input / Password / Select / etc)
  • Validation of input value
  • Automatic generation of data source using Enum value
  • Customize the color scheme
  • Unicode support (East asian width and Emoji)

Usage

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

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

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

APIs

Input

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

input

Confirm

var answer = Prompt.Confirm("Are you ready?");
Console.WriteLine($"Your answer is {answer}");

confirm

Password

var secret = Prompt.Password("Type new password");
Console.WriteLine("Password OK");

password

Select

var city = Prompt.Select("Select your city", new[] { "Seattle", "London", "Tokyo" });
Console.WriteLine($"Hello, {city}!");

select

Enum value support

var value = Prompt.Select<MyEnum>("Select enum value");
Console.WriteLine($"You selected {value}");

MultiSelect

var cities = Prompt.MultiSelect("Which cities would you like to visit?", new[] { "Seattle", "London", "Tokyo", "New York", "Singapore", "Shanghai" }, pageSize: 3);
Console.WriteLine($"You picked {string.Join(", ", options)}");

Configuration

Custom Prompter

Prompt.ColorSchema.Answer = ConsoleColor.DarkRed;
Prompt.ColorSchema.Select = ConsoleColor.DarkCyan;

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

Unicode Support

unicode

// Prefer UTF-8 as the output encoding
Console.OutputEncoding = Encoding.UTF8;

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

Platforms

  • Windows
    • Command Prompt / PowerShell / Windows Terminal
  • Ubuntu
    • Bash
  • macOS
    • Bash

License

This project is licensed under the MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].