Skip to content

Packages

All packages target net10.0 and net11.0 and are published to NuGet under the Repl family.

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.

Terminal window
dotnet add package Repl

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.

Terminal window
dotnet add package Repl.Core

DI-enabled app facade (ReplApp), lifecycle orchestration, and default profiles:

  • UseDefaultInteractive() and UseCliProfile() — an app that runs as its own process; Repl owns Ctrl+C and SIGTERM for a one-shot run and exits 130 or 143
  • UseEmbeddedConsoleProfile() — a command graph inside a host that owns the process; disables the exit command

None of them turns the REPL off; see profiles.

Terminal window
dotnet add package Repl.Defaults

Machine-readable contracts — useful for tooling, agents, and testing pipelines:

  • Help contracts (structured --help --json responses)
  • Error contracts
  • Minimal MCP manifest types
Terminal window
dotnet add package Repl.Protocol

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-25 and 2026-07-28
  • Transport factory, and stateless HTTP hosting through ConfigureMcpServerOptions
Terminal window
dotnet add package Repl.Mcp

Spectre.Console integration:

  • Rich renderables as command return values (Table, Panel, Tree, BarChart, Calendar, …)
  • UseSpectreConsole() — enables rich prompts and renderables in one call
  • IAnsiConsole DI 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
Terminal window
dotnet add package Repl.Spectre

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.Telnet to add session-protocol framing
Terminal window
dotnet add package Repl.WebSocket

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 a Stream or an IDuplexPipe
  • NAWS (RFC 1073) window-size negotiation and TERMINAL-TYPE (RFC 1091) detection
Terminal window
dotnet add package Repl.Telnet

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 open
  • RemoteConsole — 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
Terminal window
dotnet add package Repl.Remote

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.

Terminal window
dotnet add package Repl.Remote.Defaults

Session-aware logging context for Repl apps:

  • AddReplLogging() — registers the logging context services
  • Injects ReplLoggingMiddleware automatically via ReplApp for structured log scopes
  • Adds REPL session metadata (ReplSessionId, ReplTransport, etc.) to every log scope
  • No sink included — bring your own provider (Serilog, OpenTelemetry, etc.)
Terminal window
dotnet add package Repl.Logging

In-memory multi-session test harness:

Terminal window
dotnet add package Repl.Testing