NextGenSoftware.CLI.Engine 2.0.4

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

NextGenSoftware.CLI.Engine

A feature-rich CLI engine for .NET — colour output, animations, spinners, tables, progress bars, ASCII art, interactive prompts, non-interactive / CI mode, and more. The terminal backbone of the OASIS Omniverse ecosystem, used in HoloNET, the OASIS API CLI, STAR ODK, and OurWorld.

NuGet License: MIT .NET

Part of the OASIS Omniverse v2.0 Reboot. Visit oasisomniverse.one.


Installation

dotnet add package NextGenSoftware.CLI.Engine

Global Properties

CLIEngine.SuccessMessageColour   = ConsoleColor.Green;     // default
CLIEngine.ErrorMessageColour     = ConsoleColor.Red;       // default
CLIEngine.WarningMessageColour   = ConsoleColor.DarkYellow;// default
CLIEngine.WorkingMessageColour   = ConsoleColor.Yellow;    // default
CLIEngine.SupressConsoleLogging  = false;                  // set true to silence all output
CLIEngine.NonInteractive         = false;                  // set true for CI / shell mode
CLIEngine.AssumeYes              = false;                  // auto-yes for GetConfirmation in NonInteractive
CLIEngine.JsonOutput             = false;                  // flag for JSON-line host apps
CLIEngine.Quiet                  = false;                  // suppress banners/donation messages
CLIEngine.MaxHolonSearchResults  = 0;                      // 0 = unlimited
CLIEngine.ErrorHandlingBehaviour = ErrorHandlingBehaviour.OnlyThrowExceptionIfNoErrorHandlerSubscribedToOnErrorEvent;

Events

CLIEngine.OnError += (sender, e) => {
    Console.WriteLine($"CLIEngine error: {e.Reason}");
    Console.WriteLine(e.ErrorDetails);
};

Output Methods

ShowMessage

CLIEngine.ShowMessage("Hello world");                            // yellow, with leading blank line
CLIEngine.ShowMessage("Done.", ConsoleColor.Cyan);              // custom colour
CLIEngine.ShowMessage("Inline", lineSpace: false, noLineBreaks: true); // no newline appended
CLIEngine.ShowMessage("Indented", intendBy: 4);                // extra indent spaces
CLIEngine.ShowMessage("After gap", addLineBefore: true);       // blank line before message

ShowSuccessMessage / ShowErrorMessage / ShowWarningMessage

CLIEngine.ShowSuccessMessage("All packages published!");
CLIEngine.ShowErrorMessage("Connection failed.", addLineBefore: true);
CLIEngine.ShowWarningMessage("Proceeding with defaults.");

ShowDivider

CLIEngine.ShowDivider();                         // 119 "*" characters
CLIEngine.ShowDivider("-", 80);                  // 80 dashes
CLIEngine.ShowDivider("=", 60, lineSpace: false);

DisplayProperty

CLIEngine.DisplayProperty("Status", "Connected", displayFieldLength: 20);
// Output:  Status:             Connected
CLIEngine.DisplayProperty("Version", "4.0.0", 20, displayColon: false);

Working Message Spinner

Displays a message then starts an animated spinner on the same line. EndWorkingMessage stops the spinner and prints a result on the same line.

CLIEngine.BeginWorkingMessage("Connecting to Holochain conductor...");
await client.ConnectAsync();
CLIEngine.EndWorkingMessage("DONE");           // prints " DONE" on the same line

// Or with a custom colour:
CLIEngine.BeginWorkingMessage("Loading data...", ConsoleColor.Cyan);
var data = await LoadDataAsync();
CLIEngine.EndWorkingMessage("Loaded.", ConsoleColor.Green);

ShowWorkingMessage (lower level)

CLIEngine.ShowWorkingMessage("Processing...");
// ... do work ...
// spinner continues until next ShowMessage call or Spinner.Stop()

UpdateWorkingMessage / UpdateWorkingMessageWithPercent

CLIEngine.BeginWorkingMessage("Uploading...");
for (int i = 0; i <= 100; i += 10)
{
    await Task.Delay(200);
    CLIEngine.UpdateWorkingMessageWithPercent(i);
}
CLIEngine.EndWorkingMessage("Complete.");

CLIEngine.UpdateWorkingMessage("Still going...", ConsoleColor.Cyan);
Method Description
BeginWorkingMessage(string) Print message + start spinner; cursor stays on same line
BeginWorkingMessage(string, ConsoleColor) Same with custom colour
ShowWorkingMessage(string) Print yellow working message + start spinner
ShowWorkingMessage(string, ConsoleColor) Same with custom colour
UpdateWorkingMessage(string) Replace working message in-place without stopping spinner
UpdateWorkingMessageWithPercent(int) Write NN% inline next to the spinner
EndWorkingMessage(string) Stop spinner, print result on same line
EndWorkingMessage(string, ConsoleColor) Same with custom colour

Progress Bar

for (double i = 0; i <= 1.0; i += 0.1)
{
    CLIEngine.ShowProgressBar(i);       // 0.0 – 1.0
    await Task.Delay(200);
}
CLIEngine.DisposeProgressBar();         // clears bar from console
CLIEngine.DisposeProgressBar(clearText: false); // leaves final bar text visible
Method Description
ShowProgressBar(double) Update ASCII progress bar (0.0–1.0); creates it on first call
DisposeProgressBar(bool) Dispose the bar; clearText: false leaves final state visible

ASCII Art Banner

CLIEngine.WriteAsciMessage("OASIS", System.Drawing.Color.Cyan);
Method Description
WriteAsciMessage(string, Color) Renders large ASCII-art text using Colorful.Console

Colour Helpers

CLIEngine.ShowColoursAvailable();           // lists all valid ConsoleColor names in their own colour
CLIEngine.PrintColour("DarkGreen");         // writes "DarkGreen" in dark green

Interactive Input Methods

All input methods throw CLIEngineNonInteractiveInputRequiredException when CLIEngine.NonInteractive = true.

Text Input

string name  = CLIEngine.GetValidInput("Enter your name:");
string title = CLIEngine.GetValidTitle("Enter title (Mr/Mrs/Ms/Miss/Dr):");
string email = CLIEngine.GetValidInputForEmail("Enter email:");

Numeric Input

int    count  = CLIEngine.GetValidInputForInt("How many?");
int    ranged = CLIEngine.GetValidInputForInt("Pick 1–10:", checkForLowestOrHighestRange: true, lowest: 1, highest: 10);
long   big    = CLIEngine.GetValidInputForLong("Enter a large number:");
double rate   = CLIEngine.GetValidInputForDouble("Enter rate:");
decimal price = CLIEngine.GetValidInputForDecimal("Enter price:");
Guid   id     = CLIEngine.GetValidInputForGuid("Enter GUID:");

Date Input

DateTime date = CLIEngine.GetValidInputForDate("Enter date (yyyy-mm-dd):");
// Type "exit" or "none" to cancel and return DateTime.MinValue

Enum Input

object result = CLIEngine.GetValidInputForEnum("Choose log level:", typeof(LogType));
LogType level = (LogType)result;
// Shows all valid enum values automatically; re-prompts on invalid input

Boolean / Confirmation

bool yes = CLIEngine.GetConfirmation("Are you sure? (Y/N)");
// Returns AssumeYes when NonInteractive = true

Password Input

string password = CLIEngine.GetValidPassword();
// Prompts twice, masks input with *, requires matching entries

string pw = CLIEngine.ReadPassword("Enter master password:");
// Single masked read

File and Folder Input

string folder = CLIEngine.GetValidFolder("Enter folder path:", createIfDoesNotExist: true);
string file   = CLIEngine.GetValidFile("Enter file path:");
byte[] bytes  = CLIEngine.GetValidFileAndUpload("Select file to upload:");

URI Input

Uri uri = await CLIEngine.GetValidURIAsync("Enter URL:", checkFileExists: true);
// Validates format and optionally does an HTTP HEAD to confirm resource exists

Colour Picker

ConsoleColor fav = ConsoleColor.Blue;
ConsoleColor cli = ConsoleColor.Green;
CLIEngine.GetValidColour(ref fav, ref cli);
// Interactive wizard: pick favourite colour + CLI display colour, with confirmation loop

Spinner (standalone)

var spinner = new Spinner();
spinner.Colour   = ConsoleColor.Cyan;
spinner.Sequence = @"/-\|";    // animation frames
spinner.Delay    = 100;        // ms per frame

spinner.Start();               // auto-positions at current cursor
spinner.Start(left: 20, top: 5, delay: 80); // explicit position
spinner.Stop();
spinner.Dispose();

// CLIEngine.Spinner is a shared singleton:
CLIEngine.Spinner.Colour = ConsoleColor.Magenta;
Property Description
Sequence Animation characters (default /-\|)
Delay Frame delay in milliseconds (default 100)
Colour Spinner character colour (default Green)
IsActive Whether the spinner thread is running
Left / Top Console cursor position for spinner character

Animations

var anim = new Animations();

// Rotating spinner character at current position:
anim.Turn("Loading");

// Matrix-style grid animation at a fixed console position:
anim.SequencedMatrix(row: 5, column: 10, width: 8, height: 4);

// ASCII loading bar at a fixed position:
anim.LoadingBar("Loading", row: 3, column: 0);

anim.Ready(); // advance frame counter + sleep 75ms

// Simple inline spinner:
var spin = new ConsoleSpiner();
spin.Turn(); // writes one frame character and backtracks cursor

ConsoleHelper (Windows — Font Control)

var fontInfo = ConsoleHelper.SetCurrentFont("Lucida Console", fontSize: 16);
// Returns FontInfo[] { before, set, after }
Method Description
SetCurrentFont(string, short) Sets console font via Win32 SetCurrentConsoleFontEx; returns before/set/after snapshots

Exceptions

Type Description
CLIEngineException Thrown by internal error handler when no OnError subscriber exists (or AlwaysThrowExceptionOnError is set)
CLIEngineNonInteractiveInputRequiredException Thrown by any input method when CLIEngine.NonInteractive = true

ErrorHandlingBehaviour

Value Description
AlwaysThrowExceptionOnError Always throw CLIEngineException on internal error
OnlyThrowExceptionIfNoErrorHandlerSubscribedToOnErrorEvent Throw only if OnError has no subscribers (default)
NeverThrowExceptions Fire OnError event only, never throw

MIT — Copyright © NextGen Software Ltd 2019 - 2026

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  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 is compatible.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on NextGenSoftware.CLI.Engine:

Package Downloads
NextGenSoftware.Logging

A flexible, pluggable logging library with a clean ILogger/ILogProvider abstraction used across the entire NextGen Software ecosystem (OASIS, HoloNET, STAR). Supports multiple simultaneous log providers -- console, file, NLog, and custom implementations. Configurable log levels, formatting, and async log dispatch. Part of the OASIS Omniverse ecosystem at https://oasisomniverse.one -- Source: https://github.com/NextGenSoftwareUK/NextGenSoftware-Libraries

NextGenSoftware.OASIS.STAR.CLI.Lib

Core library for the STAR ODK command-line interface — exposes all STAR CLI commands as a reusable library so they can be embedded in other tools and UIs.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.4 0 10/16/2026
2.0.3 1,552 7/14/2026
2.0.2 200 7/14/2026
2.0.1 187 7/14/2026
2.0.0 136 7/13/2026
1.3.0 6,046 5/26/2024
1.2.0 1,128 5/22/2023
1.1.2 1,515 12/28/2022
1.1.1 7,168 8/27/2022
1.1.0 905 8/25/2022
1.0.3 1,327 8/24/2022
1.0.2 577 8/23/2022
1.0.1 557 8/23/2022
1.0.0 1,619 8/22/2022

## v2.0.4

- NextGenSoftware.Logging: file logging no longer slows down as log files accumulate (it listed and checked every file in the log folder on every line, so apps that log a lot - like HoloNET, which logs on its WebSocket thread - timed out); writes are serialised in-process; only MaxLogFiles (default 50) log files are kept. Faulty log providers can't break logging (snapshot of providers).
- NextGenSoftware.WebSocket: the receive loop runs on the thread pool (it inherited the caller's SynchronizationContext, so WPF/WinForms apps handled every message on the UI thread and froze on any blocking call); TrySendRawDataAsync reports send failures instead of throwing.
- All NextGenSoftware libraries bumped to 2.0.4 together.

---

## v2.0.1 — OASIS Omniverse Reboot (2026)

Part of the biggest NextGen Software release in years! The full OASIS Omniverse ecosystem — powering Our World, the OASIS API (85+ NuGet packages), HoloNET (Holochain .NET client), STAR ODK, and more — has been fully relaunched and rebranded at https://oasisomniverse.one/

After years of continuous development this is the first major v2 release, representing a complete overhaul and modernisation of the entire NextGen Software foundation.

### What's New in v2.0.1
- Added .NET 10 support: now multi-targeting net8.0, net9.0, and net10.0 for future-proof compatibility
- Copyright updated: NextGen Software Ltd 2019 - 2026
- Part of the unified OASIS Omniverse ecosystem at https://oasisomniverse.one/
- Added BeginWorkingMessage/EndWorkingMessage for animated long-operation feedback with inline DONE confirmation
- Added nextMessageOnSameLine to all ShowMessage overloads
- Added SupressConsoleLogging property to toggle console output at runtime
- Integrated NextGenSoftware.ErrorHandling for structured exception reporting
- Improved cross-platform rendering compatibility (Linux, macOS, Windows)
- Significantly improved error handling, robustness, and API consistency
- Multiple bug fixes and stability improvements
- Open source under MIT licence — https://github.com/NextGenSoftwareUK/NextGenSoftware-Libraries