A .NET framework for building composable command surfaces.
- Define your commands once — run them as a CLI, explore them in an interactive REPL,
- host them in session-based terminals, expose them as MCP servers for AI agents,
- or drive them from automation scripts.
New here? The DeepWiki has full architecture docs, diagrams, and an AI assistant you can ask questions about the toolkit.
dotnet add package Replusing Repl;
var app = ReplApp.Create().UseDefaultInteractive();
app.Map("hello", () => "world");
return app.Run(args);- Unified command graph — one route map shared by CLI, REPL, and hosted sessions
- POSIX-like semantics — familiar flag syntax,
--separator, predictable parsing - Hierarchical scopes — stateful navigation with
.., contexts, route constraints ({id:int},{when:date}) - Multiple output formats —
--json,--xml,--yaml,--markdown, or--human - MCP server — expose your commands as tools for AI agents with
app.UseMcpServer()— zero boilerplate - AI/agent-friendly — machine-readable contracts, deterministic outputs, pre-answered prompts (
--answer:*) - Typed results —
Ok,Error,NotFound,Cancelledwith payloads — not raw strings - Typed interactions — prompts, progress, status, timeouts, cancellation
- Session-aware DI — per-session services and metadata (transport, terminal, window size)
- Hosting primitives — run sessions over WebSocket, Telnet, or custom carriers
- Shell completion — Bash, PowerShell, Zsh, Fish, Nushell with auto-install
- Testing toolkit — in-memory multi-session harness with typed assertions
- Cross-platform — same behavior on Windows, Linux, macOS, containers, and CI
using Repl;
var app = ReplApp.Create().UseDefaultInteractive();
app.Context("client", client =>
{
client.Map("list", () => new { Clients = new[] { "ACME", "Globex" } });
client.Context("{id:int}", scoped =>
{
scoped.Map("show", (int id) => new { Id = id, Name = "ACME" });
scoped.Map("remove", (int id) => Results.Cancelled($"Remove {id} cancelled."));
});
});
return app.Run(args);CLI mode:
$ myapp client list --json
{
"clients": ["ACME", "Globex"]
}
REPL mode (same command graph):
$ myapp
> client 42 show --json
{ "id": 42, "name": "ACME" }
> client
[client]> list
ACME
Globex
MCP mode (same command graph, exposed to AI agents):
app.UseMcpServer(); // add one line{ "command": "myapp", "args": ["mcp", "serve"] }One command graph. CLI, REPL, remote sessions, and AI agents — all from the same code.
| Package | Description |
|---|---|
Repl |
Meta-package — bundles Core + Defaults + Protocol (start here) |
Repl.Core |
Runtime: routing, parsing, binding, results, help, middleware |
Repl.Defaults |
DI, host composition, interactive mode, terminal UX |
Repl.Protocol |
Machine-readable contracts (help, errors, tool schemas) |
Repl.WebSocket |
Session hosting over WebSocket |
Repl.Telnet |
Telnet framing, negotiation, session adapters |
Repl.Mcp |
MCP server: expose commands as AI agent tools, resources, and prompts |
Repl.Spectre |
Spectre.Console integration: rich prompts, IAnsiConsole, table rendering |
Repl.Testing |
In-memory multi-session test harness |
Progressive learning path — start with 01:
- Core Basics — routing, constraints, help, output modes
- Scoped Contacts — dynamic scoping,
..navigation - Modular Ops — composable modules, generic CRUD
- Interactive Ops — prompts, progress, timeouts, cancellation
- Hosting Remote — WebSocket / Telnet session hosting
- Testing — multi-session typed assertions
- Spectre — Spectre.Console renderables, visualizations, rich prompts
- MCP Server — expose commands as MCP tools for AI agents
| Topic | Link |
|---|---|
| Architecture blueprint | docs/architecture.md |
| Command reference | docs/commands.md |
| Parameter system | docs/parameter-system.md |
| Terminal & session metadata | docs/terminal-metadata.md |
| Testing toolkit | docs/testing-toolkit.md |
| Shell completion | docs/shell-completion.md |
| Comparison & migration | docs/comparison.md |
| Interaction channel | docs/interaction.md |
| MCP server (AI agents) | docs/mcp-server.md |
| Conditional module presence | docs/module-presence.md |
| Publishing & deployment | docs/publishing.md |
| Interactive docs & AI Q&A | deepwiki.com/yllibed/repl |
Contributions welcome — please discuss new features first to keep the toolkit aligned with its goals.
See CONTRIBUTING.md, CODE_OF_CONDUCT.md, and SECURITY.md.
MIT — Copyright (c) 2026 Yllibed project / Carl de Billy