This documentation is also published as Markdown for efficient machine reading: the whole site is indexed at /llms.txt, and every page has a clean Markdown copy under /_llms/. These are generated from the same source and cost far fewer tokens to read than this rendered HTML.

Skip to main content Skip to navigation

IDiagCommand Pennington.Cli

A diag subcommand. Implementations register in DI as IDiagCommand; the CLI discovers them and adds one System.CommandLine Command per implementation under the diag group. Each command inspects the started app's services and writes a human-readable text report. Optional packages (and hosts) add their own inspection verbs by registering an implementation.

Properties

Description string
One-line description shown in diag --help.
Name string
Subcommand verb shown under diag (e.g. toc, warnings).

Methods

Build

#
public Command Build(IServiceProvider services, TextWriter output)

Builds the System.CommandLine Command for this subcommand, wiring its options and an action that inspects services (a fully started host's service provider) and writes to output. The action returns the process exit code.

Parameters

services IServiceProvider
output TextWriter

Returns

Command

Pennington.Cli.IDiagCommand

namespace Pennington.Cli;

/// A diag subcommand. Implementations register in DI as IDiagCommand; the CLI discovers them and adds one System.CommandLine Command per implementation under the diag group. Each command inspects the started app's services and writes a human-readable text report. Optional packages (and hosts) add their own inspection verbs by registering an implementation.
public interface IDiagCommand
{
    /// Builds the System.CommandLine Command for this subcommand, wiring its options and an action that inspects services (a fully started host's service provider) and writes to output. The action returns the process exit code.
    
public Command Build(IServiceProvider services, TextWriter output)
; /// One-line description shown in diag --help.
public string Description { get; }
/// Subcommand verb shown under diag (e.g. toc, warnings).
public string Name { get; }
}