Home > @rushstack/ts-command-line

ts-command-line package

An object-oriented command-line parser for TypeScript projects.


Class Description
CommandLineAction Represents a sub-command that is part of the CommandLineParser command line. Applications should create subclasses of CommandLineAction corresponding to each action that they want to expose.The action name should be comprised of lower case words separated by hyphens or colons. The name should include an English verb (e.g. “deploy”). Use a hyphen to separate words (e.g. “upload-docs”). A group of related commands can be prefixed with a colon (e.g. “docs:generate”, “docs:deploy”, “docs:serve”, etc).
CommandLineChoiceParameter The data type returned by CommandLineParameterProvider.defineChoiceParameter().
CommandLineFlagParameter The data type returned by CommandLineParameterProvider.defineFlagParameter().
CommandLineIntegerParameter The data type returned by CommandLineParameterProvider.defineIntegerParameter().
CommandLineParameter The base class for the various command-line parameter types.
CommandLineParameterProvider This is the common base class for CommandLineAction and CommandLineParser that provides functionality for defining command-line parameters.
CommandLineParameterWithArgument The common base class for parameters types that receive an argument.
CommandLineParser The “argparse” library is a relatively advanced command-line parser with features such as word-wrapping and intelligible error messages (that are lacking in other similar libraries such as commander, yargs, and nomnom). Unfortunately, its ruby-inspired API is awkward to use. The abstract base classes CommandLineParser and CommandLineAction provide a wrapper for “argparse” that makes defining and consuming arguments quick and simple, and enforces that appropriate documentation is provided for each parameter.
CommandLineRemainder The data type returned by CommandLineParameterProvider.defineCommandLineRemainder().
CommandLineStringListParameter The data type returned by CommandLineParameterProvider.defineStringListParameter().
CommandLineStringParameter The data type returned by CommandLineParameterProvider.defineStringParameter().


Enumeration Description
CommandLineParameterKind Identifies the kind of a CommandLineParameter.


Interface Description
IBaseCommandLineDefinition For use with CommandLineParser, this interface represents a generic command-line parameter
IBaseCommandLineDefinitionWithArgument The common base interface for parameter types that accept an argument.
ICommandLineActionOptions Options for the CommandLineAction constructor.
ICommandLineChoiceDefinition For use with CommandLineParser, this interface represents a parameter which is constrained to a list of possible options
ICommandLineFlagDefinition For use with CommandLineParameterProvider.defineFlagParameter(), this interface defines a command line parameter that is a boolean flag.
ICommandLineIntegerDefinition For use with CommandLineParameterProvider.defineIntegerParameter(), this interface defines a command line parameter whose argument is an integer value.
ICommandLineParserOptions Options for the CommandLineParser constructor.
ICommandLineRemainderDefinition For use with CommandLineParameterProvider.defineCommandLineRemainder(), this interface defines a rule that captures any remaining command line arguments after the recognized portion.
ICommandLineStringDefinition For use with CommandLineParameterProvider.defineStringParameter(), this interface defines a command line parameter whose argument is a string value.
ICommandLineStringListDefinition For use with CommandLineParameterProvider.defineStringListParameter(), this interface defines a command line parameter whose argument is a single text string. The parameter can be specified multiple times to build a list.