Skip to content

CoreReplApp

Entry point for configuring and running a REPL application.

public sealed class CoreReplApp : ICoreReplApp, IReplMap
  • Context<CoreReplApp>(CoreReplApp, string, Action<CoreReplApp>, Delegate)
  • UseDocumentationExport(CoreReplApp, Action<DocumentationExportOptions>)

Context(string, Action<ICoreReplApp>, Delegate?)

Section titled “Context(string, Action<ICoreReplApp>, Delegate?)”

Creates a top-level context segment and configures nested routes.

public IContextBuilder Context(string segment, Action<ICoreReplApp> configure, Delegate? validation = null)
  • segment (string): Context segment.
  • configure (Action<ICoreReplApp>): Nested configuration callback.
  • validation (Delegate): Optional scope validation delegate.

IContextBuilder - A context builder for context-level metadata configuration.

Context(string, Action<IReplMap>, Delegate?)

Section titled “Context(string, Action<IReplMap>, Delegate?)”

Creates a top-level context segment and configures nested routes. Compatibility overload for IReplMap callbacks.

public IContextBuilder Context(string segment, Action<IReplMap> configure, Delegate? validation = null)

IContextBuilder

Creates a dependency-free REPL application instance.

public static CoreReplApp Create()

CoreReplApp - A new CoreReplApp instance.

Builds a structured documentation model of the command graph.

public ReplDocumentationModel CreateDocumentationModel(string? targetPath = null)
  • targetPath (string): Optional target path to scope the model. When null, returns the full model. When specified and not found, returns an empty model.

ReplDocumentationModel - A structured documentation model.

Invalidates active routing cache so module presence predicates are re-evaluated on next resolution.

public void InvalidateRouting()

Maps a route and command handler.

public CommandBuilder Map(string route, Delegate handler)
  • route (string): Route template.
  • handler (Delegate): Handler delegate.

CommandBuilder - A command builder for metadata configuration.

Maps a module instance.

public CoreReplApp MapModule(IReplModule module)

CoreReplApp - The same app instance.

MapModule(IReplModule, Func<ModulePresenceContext, bool>)

Section titled “MapModule(IReplModule, Func<ModulePresenceContext, bool>)”

Maps a module instance with a runtime presence predicate.

public CoreReplApp MapModule(IReplModule module, Func<ModulePresenceContext, bool> isPresent)
  • module (IReplModule): Module instance.
  • isPresent (Func<ModulePresenceContext, bool>): Runtime presence predicate.

CoreReplApp - The same app instance.

Maps a module resolved through runtime activation.

public CoreReplApp MapModule<TModule>() where TModule : class, IReplModule
  • TModule: Module type.

CoreReplApp - The same app instance.

MapModule<TModule>(Func<ModulePresenceContext, bool>)

Section titled “MapModule<TModule>(Func<ModulePresenceContext, bool>)”

Maps a module resolved through runtime activation with a runtime presence predicate.

public CoreReplApp MapModule<TModule>(Func<ModulePresenceContext, bool> isPresent) where TModule : class, IReplModule
  • TModule: Module type.
  • isPresent (Func<ModulePresenceContext, bool>): Runtime presence predicate.

CoreReplApp - The same app instance.

Configures application options.

public CoreReplApp Options(Action<ReplOptions> configure)
  • configure (Action<ReplOptions>): Options callback.

CoreReplApp - The same app instance.

Runs the app in synchronous mode.

public int Run(string[] args)
  • args (string[]): Command-line arguments.

int - Process exit code.

Runs the app in asynchronous mode.

public ValueTask<int> RunAsync(string[] args, CancellationToken cancellationToken = default)

ValueTask<int> - Process exit code.

Use(Func<ReplExecutionContext, ReplNext, ValueTask>)

Section titled “Use(Func<ReplExecutionContext, ReplNext, ValueTask>)”

Registers middleware in the execution pipeline.

public CoreReplApp Use(Func<ReplExecutionContext, ReplNext, ValueTask> middleware)
  • middleware (Func<ReplExecutionContext, ReplNext, ValueTask>): Middleware delegate.

CoreReplApp - The same app instance.

Registers a banner delegate displayed at startup after the header line. Unlike WithDescription(string), which is structural metadata visible in help and documentation, banners are display-only messages that appear at runtime.

public CoreReplApp WithBanner(Delegate bannerProvider)
  • bannerProvider (Delegate): Banner delegate with injectable parameters.

CoreReplApp - The same app instance.

Registers a static banner string displayed at startup after the header line. Unlike WithDescription(string), which is structural metadata visible in help and documentation, banners are display-only messages that appear at runtime.

public CoreReplApp WithBanner(string text)

CoreReplApp - The same app instance.

Sets an application description for discovery and banner usage.

public CoreReplApp WithDescription(string text)
  • text (string): Description text.

CoreReplApp - The same app instance.