E13.Common.Cli 2025.117.22

dotnet add package E13.Common.Cli --version 2025.117.22
                    
NuGet\Install-Package E13.Common.Cli -Version 2025.117.22
                    
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="E13.Common.Cli" Version="2025.117.22" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="E13.Common.Cli" Version="2025.117.22" />
                    
Directory.Packages.props
<PackageReference Include="E13.Common.Cli" />
                    
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 E13.Common.Cli --version 2025.117.22
                    
#r "nuget: E13.Common.Cli, 2025.117.22"
                    
#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 E13.Common.Cli@2025.117.22
                    
#: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=E13.Common.Cli&version=2025.117.22
                    
Install as a Cake Addin
#tool nuget:?package=E13.Common.Cli&version=2025.117.22
                    
Install as a Cake Tool

E13.Common.Cli

NuGet Version License: MIT

Overview

E13.Common.Cli is a package within the E13.Common collection designed for building command-line interface (CLI) applications. It provides a foundation for creating consistent, user-friendly command-line tools with standardized options, logging, and interactive features.

Features

  • Base CLI Options: Standard command-line options for consistent user experience
  • Interactive Console: Support for both interactive and non-interactive console modes
  • Fancy Console Output: Customizable console headers and styling
  • Spinner Animation: Built-in loading spinner for long-running operations
  • Logging Integration: Standardized logging with verbosity controls
  • CommandLineParser Integration: Pre-configured command-line argument parsing

Installation

dotnet add package E13.Common.Cli

Usage

Creating a CLI Application

using CommandLine;
using E13.Common.Cli;
using E13.Cli;
using Microsoft.Extensions.Logging;

// Define your command options by inheriting from BaseOptions
public class MyOptions : BaseOptions
{
    [Option('n', "name", Required = true, HelpText = "Name to greet")]
    public string Name { get; set; }
}

// Create your CLI program
public class Program
{
    public static void Main(string[] args)
    {
        // Set up logging
        var loggerFactory = LoggerFactory.Create(builder => 
            builder.AddConsole());
        var logger = loggerFactory.CreateLogger<Program>();
        
        // Create a console interface
        using var console = new E13ConsoleSimple(logger);
        
        // Parse command line arguments
        Parser.Default.ParseArguments<MyOptions>(args)
            .WithParsed(options => 
            {
                // Execute your command logic
                console.WriteLine($"Hello, {options.Name}!");
                console.Success("Command completed successfully");
            });
    }
}

Available Console Types

  • E13ConsoleSimple: Basic console with simple ASCII header
  • E13FancyConsole: Enhanced console with colorful ASCII art header
  • E13ConsoleBase: Abstract base class for creating custom console implementations

Dependencies

  • .NET 9.0
  • CommandLineParser
  • Microsoft.Extensions.Logging.Console
  • E13.Common.Core

E13.Common.Cli is part of the E13.Common collection, which includes:

  • E13.Common.Core - Core utilities and base classes
  • E13.Common.Api - Web API layer components
  • E13.Common.AspNet - ASP.NET shared components
  • E13.Common.Blazor - Blazor UI components
  • E13.Common.Domain - Domain layer components

Contributing

Contributions to E13.Common.Cli are welcome. If you have suggestions or improvements, please submit an issue or create a pull request in the GitHub repository.

License

This project is licensed under the MIT License. For more details, see the LICENSE file in the repository.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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.

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
2025.117.22 188 4/27/2025
2025.114.21 230 4/24/2025
2025.114.20 231 4/24/2025
2025.114.19 231 4/24/2025
2025.114.18 236 4/24/2025
2025.112.17 251 4/22/2025
2025.112.16 241 4/22/2025
2025.111.15 242 4/21/2025
2025.106.14 261 4/16/2025
2025.106.12 295 4/16/2025
2025.97.11 239 4/7/2025
2025.97.10 237 4/7/2025
2025.96.9 245 4/6/2025
2025.96.8 237 4/6/2025
2025.91.7 238 4/1/2025
2025.91.6 234 4/1/2025
2025.90.4 236 3/31/2025
2023.30.1 444 1/30/2023
2023.18.1 412 1/18/2023
1.0.0 233 4/1/2025
Loading failed