consolefx - ConsoleFx.Prompter 2.0.0-build.423

ConsoleFx is a suite of .NET libraries for building command-line (CLI) applications, including support for a sophisticated command line argument parser, interactive prompts, ASCII art, console capture and extensions to the Console class.

The ConsoleFx.Prompter package provides support for creating interactive experiences on the command-line.

PM> Install-Package ConsoleFx.Prompter -Version 2.0.0-build.423 -Source https://www.myget.org/F/consolefx/api/v3/index.json

Copy to clipboard

> nuget.exe install ConsoleFx.Prompter -Version 2.0.0-build.423 -Source https://www.myget.org/F/consolefx/api/v3/index.json

Copy to clipboard

> dotnet add package ConsoleFx.Prompter --version 2.0.0-build.423 --source https://www.myget.org/F/consolefx/api/v3/index.json

Copy to clipboard
<PackageReference Include="ConsoleFx.Prompter" Version="2.0.0-build.423" />
Copy to clipboard
source https://www.myget.org/F/consolefx/api/v3/index.json

nuget ConsoleFx.Prompter  ~> 2.0.0-build.423
Copy to clipboard

> choco install ConsoleFx.Prompter --version 2.0.0-build.423 --source https://www.myget.org/F/consolefx/api/v2

Copy to clipboard
Import-Module PowerShellGet
Register-PSRepository -Name "consolefx" -SourceLocation "https://www.myget.org/F/consolefx/api/v2"
Install-Module -Name "ConsoleFx.Prompter" -RequiredVersion "2.0.0-build.423" -Repository "consolefx" -AllowPreRelease
Copy to clipboard

Browse the sources in this package using Visual Studio or WinDbg by configuring the following legacy symbol server URL: https://www.myget.org/F/consolefx/symbols/


ConsoleFx

ConsoleFx

Build status Test status codecov

ConsoleFx is a suite of .NET libraries for building command-line (CLI) applications.

Build console apps with command line arguments

The following code simulates the following made-up console app:

COPY <source file> [<destination dir>] [--overwrite] [--create-dir]

public class Program : ConsoleProgram
{
    // Declare one property per argument and option.
    
    public string SourceFile { get; set; }
    
    public string DestinationDir { get; set; }
    
    [Option("overwrite")]
    public bool OverwriteExistingFile { get; set; }
    
    [Option("create-dir")]
    public bool CreateDirIfMissing { get; set; }
    
    // Code to execute the console program if all command line args are verified.
    protected int HandleCommand()
    {
        Console.WriteLine($"You want to copy {SourceFile} to {DestinationDir}");
        Console.WriteLine($"Overwrite file if it exists: {OverwriteExistingFile}");
        Console.WriteLine($"Create destination directory if it does not exist: {CreateDirIfMissing}");
        return 0;
    }
    
    // Specify the options and arguments that are accepted by the console app
    protected override IEnumerable<Arg> GetArgs()
    {
        yield return new Argument(nameof(SourceFile))
            .ValidateAsFile(shouldExist: true);
        yield return new Argument(nameof(DestinationDir), optional: true)
            .ValidateAsDirectory();
        yield return new Option("overwrite", "o")
            .UsedAsFlag();
        yield return new Option("create-dir", "c")
            .UsedAsFlag();
    }
    
    public static int Main()
    {
        var program = new Program();
        return program.Run();
    }
}

Packages

ConsoleFx consists of the following NuGet packages. Development packages from continuous integration builds are available on MyGet.

Package Description Dev Build
ConsoleFx.CmdLine.Program Write command line programs with sophisticated argument parsing, including error handling, automatic help generation and rich validation support. Supports both Unix and Windows-style arguments. ConsoleFx.CmdLine.Program
ConsoleFx.CmdLine.Parser Standalone argument parser that is used by ConsoleFx.CmdLine.Program. Can be used in non-console program such as Windows Forms, WPF, REPL, etc. to parse command line arguments in a similar fashion. ConsoleFx.CmdLine.Parser
ConsoleFx.ConsoleExtensions Extended console capabilities like color output, prompts, inputting secrets, outputting indented text, progress bars, etc. ConsoleFx.ConsoleExtensions
ConsoleFx.Prompter Rich interactive framework from getting inputs from users. Inspired by the Inquirer.js framework for JavaScript. ConsoleFx.Prompter

Metapackage

ConsoleFx includes a metapackage that contains all the major packages that would typically needed to build a complex console application.

NuGet Version NuGet Downloads ConsoleFx

Under development

The following packages are under development and expected in a future release.

Package Description Expected Version
ConsoleFx.Art Output ASCII art in different styles. 2.1
ConsoleFx.UI Dynamic creation of Windows Forms and WPF UI to visually input command-line arguments. TBD
  • .NETStandard 2.0
    • Collections.NET (>= 1.7.0)
    • ConsoleFx.ConsoleExtensions (>= 2.0.0-build.423)
    • Microsoft.CSharp (>= 4.7.0)
    • Spectre.Console (>= 0.42.0)
  • .NETStandard 2.0: 2.0.0.0

                        
Assembly Assembly hash Match
/lib/netstandard2.0/consolefx.prompter.dll 5fba4c20a0f649cb8691a84ee2afd797FFFFFFFF

Owners

Jeevan James

Authors

Jeevan James

Project URL

https://github.com/JeevanJames/ConsoleFx/

License

Apache-2.0

Tags

ConsoleFx Console Command Commandline Command-line Cmdline Parser CMD CLI

Info

0 total downloads
0 downloads for version 2.0.0-build.423
Download (35.93 KB)
Download legacy symbols (52.43 KB)
Found on the current feed only

Package history

Version Size Last updated Downloads Mirrored?
2.0.0-build.423 35.93 KB Sat, 21 May 2022 15:08:05 GMT 0
2.0.0-build.422 35.94 KB Wed, 18 May 2022 20:55:37 GMT 0
2.0.0-build.421 35.93 KB Wed, 18 May 2022 20:46:19 GMT 0
2.0.0-build.420 60.4 KB Thu, 14 Oct 2021 16:08:02 GMT 0
2.0.0-build.419 60.41 KB Wed, 06 Oct 2021 19:56:27 GMT 0
2.0.0-build.418 60.41 KB Wed, 06 Oct 2021 15:40:53 GMT 0
2.0.0-build.417 60.41 KB Tue, 05 Oct 2021 22:37:59 GMT 0
2.0.0-build.416 60.41 KB Tue, 05 Oct 2021 14:10:49 GMT 0
2.0.0-build.415 60.38 KB Tue, 05 Oct 2021 13:56:22 GMT 0
2.0.0-build.413 60.36 KB Wed, 29 Sep 2021 20:00:10 GMT 0
2.0.0-build.411 60.38 KB Wed, 29 Sep 2021 19:46:41 GMT 0
2.0.0-build.410 60.36 KB Wed, 29 Sep 2021 13:24:43 GMT 0
2.0.0-build.409 60.34 KB Thu, 23 Sep 2021 08:34:44 GMT 0
2.0.0-build.408 60.35 KB Wed, 22 Sep 2021 21:29:22 GMT 0
2.0.0-build.407 60.37 KB Wed, 22 Sep 2021 16:11:45 GMT 0
2.0.0-build.406 60.38 KB Wed, 22 Sep 2021 15:31:56 GMT 0
2.0.0-build.405 60.37 KB Sat, 18 Sep 2021 10:41:19 GMT 0
2.0.0-build.403 60.36 KB Sat, 18 Sep 2021 10:35:15 GMT 0
2.0.0-build.401 39.63 KB Tue, 14 Sep 2021 23:17:24 GMT 0
2.0.0-build.399 39.63 KB Fri, 03 Sep 2021 23:19:27 GMT 0