SavaDev.DemoKit.ConsoleEngine 0.1.0

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

SavaDev.DemoKit.ConsoleEngine

SavaDev.DemoKit.ConsoleEngine is a lightweight console demo engine for running interactive, scenario-based demonstrations.

The engine provides a simple menu-driven console UI that allows users to select and execute demo scenarios without requiring dependency injection or a hosting framework.


Purpose

This library is intended for:

  • interactive console demos
  • educational examples
  • experimentation and prototyping
  • showcasing libraries or concepts via runnable scenarios

The engine focuses on clarity, predictability, and minimal setup rather than flexibility or extensibility through complex infrastructure.


Key characteristics

  • No dependency injection
  • No hosting abstractions
  • No external frameworks
  • Explicit scenario wiring
  • Simple console-based interaction
  • Designed to be embedded into a console application

Basic usage

A typical console application using the engine looks like this:

using SavaDev.DemoKit.ConsoleEngine;

await new ConsoleDemoEngine().RunAsync(
    new IConsoleDemoScenario[]
    {
        new HelloScenario(),
        new CountdownScenario()
    });

The host application is responsible for:

  • defining Main
  • creating scenario instances
  • passing command-line arguments if needed

The engine handles user interaction and scenario execution.


Scenarios

Scenarios are simple classes that implement IConsoleDemoScenario.

Each scenario:

  • has a display name
  • exposes a single asynchronous execution method
  • receives a CancellationToken

Example:

public sealed class HelloScenario : IConsoleDemoScenario
{
    public string Name => "Hello";

    public async Task RunAsync(CancellationToken ct)
    {
        Console.WriteLine("Hello, world!");
        await Task.CompletedTask;
    }
}

Scenarios are executed sequentially and can be cancelled by the engine.


Cancellation behavior

  • The engine supports Ctrl+C handling
  • Cancellation is propagated to the currently running scenario
  • Behavior is configurable via ConsoleDemoOptions
  • When idle, Ctrl+C may optionally terminate the process

Cancellation is treated as an expected execution path, not an error.


Configuration

The engine can be customized using ConsoleDemoOptions, including:

  • demo title
  • menu prompts
  • key bindings
  • pause behavior
  • Ctrl+C handling

All configuration is explicit and optional.


Design goals

  • Keep demos easy to read and reason about
  • Avoid hidden behavior or implicit wiring
  • Minimize required setup code
  • Make demo intent obvious in code

This engine is intentionally not designed for production CLI applications.


Intended audience

This library is suitable for:

  • library authors creating demo applications
  • educators and presenters
  • developers exploring concepts via runnable examples

It is not intended to replace full-featured CLI frameworks.


Summary

SavaDev.DemoKit.ConsoleEngine provides a small, explicit, and dependency-free way to run interactive console demos composed of simple scenarios.

If the engine feels intentionally minimal — that is by design.

Product Compatible and additional computed target framework versions.
.NET 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 was computed.  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.
  • net8.0

    • No dependencies.

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
0.1.0 222 2/6/2026