Skip to content

Configuration Reference

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");

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();

Activates interactive REPL mode when no arguments are passed. This is the standard starting point for most apps.

Disables the interactive REPL. The app only runs in one-shot CLI mode.

For apps embedded in a larger host — no entry-point management, just command dispatching.

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.
app.Context("admin", admin =>
{
admin.Map("list-users", ...);
});
MethodEffect
.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
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.

[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:*.

Three range types, one per precision level:

TypePrecisionDuration constraint
ReplDateRangeDateOnlyWhole days only
ReplDateTimeRangeDateTimeAny duration
ReplDateTimeOffsetRangeDateTimeOffsetAny duration

Both start..end and start@duration forms are accepted. See Built-in Types & Formats for all format details.

Flag (CLI)Effect
--jsonOutput as JSON
--xmlOutput as XML
--yamlOutput as YAML
--markdownOutput as Markdown table
--helpShow help for this route
--help --jsonMachine-readable help
--answer:N=valuePre-fill the Nth interactive prompt