Configuration Reference
App creation
Section titled “App creation”CoreReplApp.Create()
Section titled “CoreReplApp.Create()”Creates a lightweight app with no DI container. Use when you don’t need dependency injection.
var app = CoreReplApp.Create() .WithDescription("My app description") .WithBanner("Welcome message shown in REPL mode");ReplApp.Create()
Section titled “ReplApp.Create()”Creates an app with a default DI container (Microsoft.Extensions.DependencyInjection).
var app = ReplApp.Create().UseDefaultInteractive();Pass a service configuration delegate to ReplApp.Create() to register services before the app runs:
var app = ReplApp.Create(services =>{ services.AddSingleton<IMyService, MyService>();}).UseDefaultInteractive();Profiles
Section titled “Profiles”UseDefaultInteractive()
Section titled “UseDefaultInteractive()”Activates interactive REPL mode when no arguments are passed. This is the standard starting point for most apps.
UseCliProfile()
Section titled “UseCliProfile()”Disables the interactive REPL. The app only runs in one-shot CLI mode.
UseEmbeddedConsoleProfile()
Section titled “UseEmbeddedConsoleProfile()”For apps embedded in a larger host — no entry-point management, just command dispatching.
Route registration
Section titled “Route registration”Map(route, handler)
Section titled “Map(route, handler)”app.Map("greet {name}", (string name) => $"Hello, {name}!");- Route parameters:
{name},{id:int},{email:email},{token:guid}, etc. - Handler can be a delegate, method group, or lambda.
- Parameters are bound from route segments + DI.
Context(segment, configure)
Section titled “Context(segment, configure)”app.Context("admin", admin =>{ admin.Map("list-users", ...);});Fluent modifiers on routes
Section titled “Fluent modifiers on routes”| Method | Effect |
|---|---|
.WithDescription("...") | Sets the command description shown in help |
.Destructive() / .ReadOnly() / .Idempotent() | MCP behavioral annotations |
.AutomationHidden() | Hides from MCP agents; visible in interactive REPL |
.AsResource() | Registers as an MCP resource (URI derived from route) |
.AsPrompt() | Registers as an MCP prompt template |
.AsMcpAppResource() | Registers as an MCP Apps UI resource |
.WithCompletion(provider) | Registers Tab completion for this route |
Parameters
Section titled “Parameters”Route constraints
Section titled “Route constraints”| Constraint | .NET type |
|---|---|
{x:int} | int |
{x:long} | long |
{x:double} | double |
{x:bool} | bool |
{x:guid} | Guid |
{x:email} | string (validated) |
{x:date} / {x:dateonly} | DateOnly |
{x:datetime} / {x:date-time} | DateTime |
{x:datetimeoffset} / {x:date-time-offset} | DateTimeOffset |
{x:time} / {x:timeonly} | TimeOnly |
{x:timespan} / {x:time-span} | TimeSpan |
Types are also inferred from the handler parameter type, so :int is implicit when the parameter is int id. For all accepted input formats, see Built-in Types & Formats.
Options groups
Section titled “Options groups”[ReplOptionsGroup]public class PagingOptions{ [ReplOption(Aliases = ["--limit"])] public int Limit { get; init; } = 20;
[ReplOption(Aliases = ["--sort"])] public string Sort { get; init; } = "name";}Handlers that accept PagingOptions receive all flags in the group. Avoid names already reserved by Repl: --format, --json, --xml, --yaml, --markdown, --no-logo, --help, --interactive, --no-interactive, --output, and --answer:*.
Temporal ranges
Section titled “Temporal ranges”Three range types, one per precision level:
| Type | Precision | Duration constraint |
|---|---|---|
ReplDateRange | DateOnly | Whole days only |
ReplDateTimeRange | DateTime | Any duration |
ReplDateTimeOffsetRange | DateTimeOffset | Any duration |
Both start..end and start@duration forms are accepted. See Built-in Types & Formats for all format details.
Interactive options
Section titled “Interactive options”| Flag (CLI) | Effect |
|---|---|
--json | Output as JSON |
--xml | Output as XML |
--yaml | Output as YAML |
--markdown | Output as Markdown table |
--help | Show help for this route |
--help --json | Machine-readable help |
--answer:N=value | Pre-fill the Nth interactive prompt |