Skip to content

clerc

Namespaces

NamespaceDescription

Parser

Types

Classes

ClassDescription

Clerc

InvalidCommandError

InvalidParametersError

MissingRequiredFlagError

MissingRequiredMetadataError

NoCommandSpecifiedError

NoSuchCommandError

Interfaces

InterfaceDescription

BaseContext

Command

CommandCustomOptions

CommandHelpOptions

CommandOptions

ContextStore

CreateOptions

FlagCustomOptions

FlagHelpOptions

FriendlyErrorPluginOptions

GroupsOptions

Options for defining groups in help output.

HelpOptions

HelpPluginOptions

InterceptorObject

NotFoundPluginOptions

ParameterCustomOptions

ParseOptions

Plugin

UpdateNotifierPluginOptions

Type Aliases

Type AliasDescription

ClercFlagDefinitionValue

ClercFlagOptions

ClercFlagsDefinition

CommandHandler

CommandHandlerContext

CommandsMap

CommandsRecord

CommandWithHandler

ErrorHandler

GroupDefinition

A group definition as a tuple of [key, displayName]. The key is used in help options to assign items to groups. The displayName is shown in the help output.

InferParameters

Interceptor

InterceptorContext

InterceptorHandler

InterceptorNext

Function to call the next interceptor in the chain. MUST be awaited.

MakeEmitterEvents

ParameterDefinitionValue

ParameterOptions

Variables

VariableDescription

defaultFormatters

DOUBLE_DASH

KNOWN_FLAG

PARAMETER

UNKNOWN_FLAG

Functions

FunctionDescription

Cli

completionsPlugin

createStopAtFirstParameter

defineCommand

definePlugin

extractParameterInfo

friendlyErrorPlugin

helpPlugin

inferDefault

Infers the implicit default value for a flag type based on its type constructor. This is useful for help output to show the default values of types that have built-in defaults.

  • Boolean: false
  • [Boolean] (Counter): 0
  • [T] (Array): []
  • Object: {}
  • Others: undefined (no implicit default)

normalizeFlagValue

normalizeParameterValue

notFoundPlugin

resolveCommand

strictFlagsPlugin

updateNotifierPlugin

Plugin to check for CLI updates using update-notifier.

Example

ts
import { 
Clerc
} from "@clerc/core";
import {
updateNotifierPlugin
} from "@clerc/plugin-update-notifier";
import
pkg
from "./package.json";
Clerc
.
create
().
use
(
updateNotifierPlugin
({
pkg
})).
parse
();

versionPlugin

References

InvalidSchemaError

Re-exports InvalidSchemaError

在 MIT 许可证下发布