Table of Contents

Namespace Signal.Application.Commands

Classes

CategoryAttribute

Lists commands under a heading in /help. On a module it applies to all of its commands; on a method it overrides the module's category. Command groups get their own heading and ignore categories.

CommandAttribute

Declares a command: on a public method of a CommandModule, or on an ICommand class deriving from CommandBase (which then reads its metadata from this attribute).

CommandBase

Base class for class-based commands. Metadata defaults to the CommandAttribute on the class and every member can be overridden.

CommandBindingFailed

The arguments could not be bound (missing, invalid, too many, unknown option); the command did not run.

CommandCatalog

Registration-time list of command sources, populated by the DI builder (AddCommands, AddCommand, AddCommandModule, MapCommand) and consumed once by ICommandRegistry. Registered in DI as a singleton instance.

CommandContext

Everything a command needs: the message, parsed arguments, the scoped services and reply helpers.

CommandDescriptor

Everything the framework knows about a command: metadata, parameters, preconditions and how to invoke it. Created by the registry from ICommand classes and CommandModule methods, or directly for delegate commands.

CommandFaulted

The command threw an exception.

CommandGroupAttribute

Puts every command of a CommandModule (or an ICommand class) under a group, so it is invoked as /group command. Preconditions on the module apply to all of its commands.

CommandGroupInfo

The group a command belongs to (CommandGroupAttribute).

CommandMiddleware

Last built-in pipeline step: parses prefixed text messages, executes the matching command, marks the message as handled and passes the outcome to ICommandResultHandler. Reactions are never treated as commands.

CommandModule

Groups several commands as [Command] methods. Parameters are bound from the message text by type; CommandContext and CancellationToken parameters are injected. A new module instance is created (with constructor injection from the message scope) for every execution and disposed afterwards.

CommandNotFound

No command matches the typed name or alias.

CommandParameter

A bindable parameter of a command.

CommandPreconditionFailed

A precondition rejected the invocation; the command did not run.

CommandSucceeded

The command ran to completion.

ExampleAttribute

An example invocation shown by /help <command>, written without prefix (e.g. add 2 3). Repeat the attribute for several examples.

FlagAttribute

Binds the parameter to a named option (--name value or --name=value) instead of a position. bool flags are switches: --name sets them to true.

HelpModule

Built-in help command (aliases ?, commands), generated from command metadata:

  • /help lists all visible commands, under headings (command groups and CategoryAttribute) when there is more than one, paged by HelpPageSize;
  • /help 2 shows the second page;
  • /help <command> shows usage, description, aliases, parameter summaries and examples;
  • /help <group> lists a command group.

Disable with Signal:Commands:EnableHelp = false.

RemainderAttribute

Binds all remaining text to this string parameter, verbatim (whitespace preserved). Must be the last positional parameter.

SummaryAttribute

Describes a parameter in the output of help <command>.

Structs

CommandResult

Outcome of a command invocation: exactly one of CommandSucceeded, CommandNotFound, CommandPreconditionFailed, CommandBindingFailed or CommandFaulted. Stored in Items under typeof(CommandResult).

Interfaces

ICommand

A class-based command. Instances are resolved from the message's DI scope, so constructor injection works. Arguments are not bound automatically; read Arguments and Flags.

ICommandExecutor

Resolves, checks, binds and runs a parsed command.

ICommandRegistry

Looks up commands by name or alias.

ICommandResultHandler

Decides how the user is informed about a command's outcome. Replace it to customize error replies (e.g. localisation).