Packages
All packages target net10.0 and net11.0 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()andUseCliProfile()— an app that runs as its own process; Repl owns Ctrl+C andSIGTERMfor a one-shot run and exits130or143UseEmbeddedConsoleProfile()— a command graph inside a host that owns the process; disables theexitcommand
None of them turns the REPL off; see profiles.
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. Requires the ModelContextProtocol SDK 2.x:
app.UseMcpServer()— one line to activate- Tools, resources, prompts
- MCP Apps UI resources
- Behavioral annotations (
.Destructive(),.ReadOnly(),.Idempotent(),.OpenWorld(),.LongRunning()) - Client roots support
- Serves MCP revisions
2025-11-25and2026-07-28 - Transport factory, and stateless HTTP hosting through
ConfigureMcpServerOptions
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, with the same color and terminal-control rules as Repl’s own output
- Upgrade it together with
Repl.Core: the two share the terminal-control rule
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:
ReplWebSocketSession.RunAsync(app, socket, ct)— runs one session over an accepted WebSocket- 64 KiB limit per incoming message; normal close handshake when the session ends
- 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 — adds Telnet framing and terminal negotiation for clients that speak Telnet, over a WebSocket, a Stream or an IDuplexPipe:
ReplTelnetSession.RunAsync(app, socket, options, ct)— also over aStreamor anIDuplexPipe- NAWS (RFC 1073) window-size negotiation and TERMINAL-TYPE (RFC 1091) detection
dotnet add package Repl.TelnetRepl.Remote
Section titled “Repl.Remote”Remote administration of a running process: wire contracts, a stream server and client, a same-user named-pipe listener, and a native console client.
NamedPipeReplServer— listens on a pipe only the same OS account can openRemoteConsole— attaches a terminal; Ctrl+C interrupts, Ctrl+D detaches- One-shot execution that returns the outcome, the exit code, the JSON result, stdout and stderr
- Nothing listens until the application starts an endpoint
dotnet add package Repl.RemoteRepl.Remote.Defaults
Section titled “Repl.Remote.Defaults”Connects Repl.Remote to a ReplApp through ReplAppRemoteBackend, with a DI scope per invocation and interactive terminals hosted by StreamedReplHost. Brings in Repl.Remote. See Remote Administration.
dotnet add package Repl.Remote.DefaultsRepl.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
ReplProcessSignalHarnessandReplProcessProbe— process-signal tests, in memory or against the real executable
dotnet add package Repl.Testing