Packages
All packages target .NET 10+ and are published to NuGet under the Repl family.
Repl start here
Section titled “Repl ”The meta-package. Bundles Repl.Core + Repl.Defaults + Repl.Protocol.
Install this for most apps — it’s the single reference that covers routing, the interactive REPL, DI, output formats, and machine-readable contracts.
dotnet add package ReplRepl.Core
Section titled “Repl.Core”The dependency-free foundation. No DI, no hosting, just routing, binding, constraints, and the output pipeline.
Use CoreReplApp.Create() to build apps that don’t need DI.
dotnet add package Repl.CoreRepl.Defaults
Section titled “Repl.Defaults”DI-enabled app facade (ReplApp), lifecycle orchestration, and default profiles:
UseDefaultInteractive()— REPL when no args, CLI when args givenUseCliProfile()— CLI-only, no interactive loopUseEmbeddedConsoleProfile()— embedded in a larger host
dotnet add package Repl.DefaultsRepl.Protocol
Section titled “Repl.Protocol”Machine-readable contracts — useful for tooling, agents, and testing pipelines:
- Help contracts (structured
--help --jsonresponses) - Error contracts
- Minimal MCP manifest types
dotnet add package Repl.ProtocolRepl.Mcp
Section titled “Repl.Mcp”Expose your entire command graph as an MCP server:
app.UseMcpServer()— one line to activate- Tools, resources, prompts
- MCP Apps UI resources
- Behavioral annotations (
.Destructive(),.ReadOnly(),.Idempotent(),.OpenWorld(),.LongRunning()) - Client roots support
- Transport factory
dotnet add package Repl.McpRepl.Spectre
Section titled “Repl.Spectre”Spectre.Console integration:
- Rich renderables as command return values (Table, Panel, Tree, BarChart, Calendar, …)
UseSpectreConsole()— enables rich prompts and renderables in one callIAnsiConsoleDI injection (session-safe across hosted sessions)- Automatic capability detection and graceful degradation
dotnet add package Repl.SpectreRepl.WebSocket
Section titled “Repl.WebSocket”WebSocket transport for hosted sessions — serves REPL sessions over WebSocket connections from an ASP.NET Core app:
app.MapReplWebSocket("/repl")— registers the WebSocket endpoint- Per-session scope, shared singletons, terminal metadata, session registry
- Network-transport layer only; combine with
Repl.Telnetto add session-protocol framing
dotnet add package Repl.WebSocketRepl.Telnet
Section titled “Repl.Telnet”Telnet session protocol layered over a WebSocket transport — adds Telnet framing and terminal negotiation for clients that speak Telnet:
app.MapReplTelnet("/telnet")- NAWS (RFC 1073) window-size negotiation and TERMINAL-TYPE (RFC 1091) detection
- WebSocket is the network transport; Telnet is the session protocol above it
dotnet add package Repl.TelnetRepl.Logging
Section titled “Repl.Logging”Session-aware logging context for Repl apps:
AddReplLogging()— registers the logging context services- Injects
ReplLoggingMiddlewareautomatically viaReplAppfor structured log scopes - Adds REPL session metadata (
ReplSessionId,ReplTransport, etc.) to every log scope - No sink included — bring your own provider (
Serilog,OpenTelemetry, etc.)
dotnet add package Repl.LoggingRepl.Testing
Section titled “Repl.Testing”In-memory multi-session test harness:
ReplTestHost— builds your command graph in memoryReplSessionHandle— runs commands, inspects results- Typed result assertions
- Interaction timeline (prompts, answers, output events)
- Multi-session shared-state tests
dotnet add package Repl.Testing