Familiar minimal-API style
app.Map("user {id:int}", handler) — typed routes, constraints, parameter binding, and structured output. If you’ve used ASP.NET Core minimal APIs, you already know the pattern.
Familiar minimal-API style
app.Map("user {id:int}", handler) — typed routes, constraints, parameter binding, and structured output. If you’ve used ASP.NET Core minimal APIs, you already know the pattern.
CLI + REPL from the same graph
Pass arguments: one-shot CLI with --json, --xml, --yaml output and --help at every level. No arguments: an interactive REPL with scoped navigation, history, and autocomplete.
Hosted sessions
The same command surface runs over any text-based session transport. Multiple concurrent sessions, each with its own scope. Repl.WebSocket and Repl.Telnet are built-in implementations; any transport that delivers a stream pair works.
AI-ready in one line
app.UseMcpServer() exposes every command as an MCP tool. Add resources, prompts, and MCP Apps UI surfaces for capable clients like Claude.
Zero-dependency core
Repl.Core has zero NuGet dependencies. Build embedded command surfaces in strict environments. Compose only what you need.
Test every interaction path
Repl.Testing runs your full command graph in memory — multi-session, multi-step, with a typed assertion API. Test prompts, scoped navigation, and MCP tools without a real terminal.
dotnet add package Replusing Repl;
var app = ReplApp.Create().UseDefaultInteractive();
app.Context("client", client =>{ client.Map("list", (IClientStore store) => store.All());
client.Context("{id:int}", scoped => { scoped.Map("show", (int id, IClientStore store) => store.Get(id)); scoped.Map("remove", (int id, IClientStore store) => { store.Remove(id); return Results.Success($"Removed {id}."); }); });});
return app.Run(args);$ myapp client list --json[{ "id": 1, "name": "ACME" }, { "id": 2, "name": "Globex" }]
$ myapp client 42 showId: 42Name: ACME
$ myapp client --helpCommands: client list client {id} show client {id} remove$ myapp> client[client]> listACME (1)Globex (2)
[client]> 42[client/42]> showId: 42Name: ACME
[client/42]> ..[client]>using Repl.Mcp;app.UseMcpServer(); // every Map(...) becomes an MCP tool{ "mcpServers": { "myapp": { "command": "myapp", "args": ["mcp", "serve"] } }}Every command is now discoverable as an MCP tool — the AI agent calls client list, client 42 show, etc. directly.
The most expensive part of autonomous agent development isn’t writing code — it’s the feedback loop. Screenshots consume tokens. HTML parsing is fragile. Visual context is slow to reason about.
A Repl command surface eliminates all of it.
# The agent discovers everything from one command$ myapp --help --json# → full command tree, parameter schemas, descriptions
# The agent calls commands and reads structured results$ myapp contacts add "Alice Dupont" alice@example.com --json# → { "id": 1, "name": "Alice Dupont" }
# The agent verifies behavior with Repl.Testing — in memory, no terminal needed# → full multi-step interaction sequences with typed assertionsWhen the command surface is complete, the application is complete. The business logic is implemented, tested, and working. Adding a web UI, a TUI, or a desktop front-end is the last step — decoration on top of a finished application. By then, the real work is done.
Read more about agent-native development →
Getting Started
Install the package, write your first app, and understand the three execution modes in 10 minutes.
Cookbook
Eight recipes from core routing to MCP servers, each backed by a full runnable sample.
Concepts
Routes, modules, DI, MCP, interactivity, output, pipelines, and terminal integration.
API Reference
Complete generated API reference from the Repl.* assemblies.
Start with dotnet add package Repl. That single package gives you routing, typed parameter binding, an interactive REPL, CLI dispatch, and JSON/XML/YAML/Markdown output — no other dependencies required.
When your users need AI-agent access, add Repl.Mcp and call app.UseMcpServer(). Every command becomes an MCP tool with no handler changes. Add Repl.Spectre to upgrade all output and prompts to Spectre.Console richness — again, zero handler changes.
Test the whole thing with Repl.Testing: an in-memory harness that runs full multi-step interaction sequences, including prompts and scoped navigation, with typed assertions.
If you’re embedding Repl in a constrained environment, Repl.Core is the zero-dependency foundation — pull only what you need.