Repl.Spectre 0.9.2-dev.73

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

Repl.Spectre

Spectre.Console integration for Repl Toolkit. Provides rich interactive prompts, injectable IAnsiConsole, and beautiful table rendering.

Features

  • Rich promptsSelectionPrompt, MultiSelectionPrompt, ConfirmationPrompt, TextPrompt, and secret input via Spectre.Console
  • IAnsiConsole injection — use IAnsiConsole as a command parameter to render tables, trees, panels, and other Spectre renderables
  • Table output — the "spectre" output format renders collections as bordered Spectre tables with [Display] attribute support
  • Banner support — inject IAnsiConsole into WithBanner() callbacks for rich startup banners (FigletText, Markup, etc.)
  • Configurable capabilitiesSpectreConsoleOptions to control Unicode rendering for different terminal environments

Setup

var app = ReplApp.Create(services =>
{
    services.AddSpectreConsole(); // DI: IAnsiConsole + SpectreInteractionHandler
})
.UseSpectreConsole(); // Output transformer + banner format + UTF-8 encoding

Two calls, two concerns:

Method Scope What it does
AddSpectreConsole() IServiceCollection Registers IAnsiConsole (transient) and SpectreInteractionHandler in DI
UseSpectreConsole() ReplApp Registers "spectre" output transformer, sets it as default, enables banners, configures UTF-8

Usage

Auto-rendered tables

Return a collection from a command — the output transformer renders it as a bordered Spectre table:

app.Map("list", (IContactStore store) => store.All());

Column headers are derived from [Display] attributes. No rendering code needed.

Direct IAnsiConsole injection

Inject IAnsiConsole to use any Spectre renderable:

app.Map("report", (IAnsiConsole console) =>
{
    var table = new Table().AddColumn("Name").AddColumn("Value");
    table.AddRow("Item", "42");
    console.Write(table);
});

Works with all Spectre renderables: Table, Tree, Panel, BarChart, Calendar, FigletText, Progress, Status, and more.

Transparent prompt upgrade

IReplInteractionChannel calls are automatically rendered as Spectre prompts:

Channel method Spectre prompt
AskTextAsync TextPrompt<string>
AskChoiceAsync SelectionPrompt<string>
AskMultiChoiceAsync MultiSelectionPrompt<string>
AskConfirmationAsync ConfirmationPrompt
AskSecretAsync TextPrompt<string>.Secret()

No Spectre-specific code in handlers — the same handler works with or without the Spectre package.

Use IAnsiConsole in banner callbacks for rich startup output:

app.WithBanner((IAnsiConsole console) =>
{
    console.Write(new FigletText("My App").Color(Color.Blue));
    console.MarkupLine("[grey]Type 'help' to get started[/]");
});

Configuration

UseSpectreConsole() accepts an optional callback to configure capabilities:

// Default: Unicode enabled
.UseSpectreConsole()

// Disable Unicode for limited terminals
.UseSpectreConsole(o => o.Unicode = false)

SpectreConsoleOptions

Property Type Default Description
Unicode bool true Enable Unicode box-drawing characters and symbols. When false, Spectre falls back to ASCII.

When Unicode is enabled, UseSpectreConsole() sets Console.OutputEncoding to UTF-8 to ensure Unicode characters (progress bars, spinners, box-drawing) render correctly on Windows.

Sample

See sample 07-spectre for a comprehensive demo covering 21 Spectre features across 14 commands.

Product Compatible and additional computed target framework versions.
.NET 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. 
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
0.9.2-dev.73 0 3/19/2026
0.9.2-dev.72 0 3/19/2026
0.9.2-dev.35 35 3/17/2026