Optional
argsThe options for parsing command line arguments.
This is passed to the minimist library.
If these options do not include --help
or --version
, clirk will take
care of this and also take over if the flags are present.
Optional
descriptionThe description of the CLI. If not provided, it will be derived from the CLI's package.json. Use an array of strings for multiple lines to support indentation.
Optional
examplesUsage examples for the CLI. Use an array of strings for multiple lines to support indentation. Defaults to the command name.
Optional
iconAn optional icon for the CLI. This will be displayed in the help message.
The import.meta.dirname
from any script within the CLI package.
This is used to resolve the CLI package information.
Optional
nameThe command name to run the CLI.
Optional
optionsOptions for the CLI. This defines the supported options for the CLI for help messages. The keys are the names of the options, and the values are their descriptions. Use an array of strings for multiple lines to support indentation.
Optional
optionsA label for the options section. If not provided, it will default to "OPTIONS". This is used in the help message to indicate the options section.
Optional
parametersParameters for the CLI. (Arguments that are not options.) This defines the supported parameters for the CLI for help messages. The keys are the names of the parameters, and the values are their descriptions. Use an array of strings for multiple lines to support indentation.
Optional
parametersA label for the parameters section. If not provided, it will default to "PARAMETERS". This is used in the help message to indicate the parameters section.
Optional
sigintA function to handle the SIGINT signal (Ctrl+C).
If provided, this function will be called when the user presses Ctrl+C.
If not provided, clirk will handle the SIGINT signal and exit gracefully.
The default message can be customized using the sigintMessage
option.
If set to false
, clirk will not handle the SIGINT signal.
Optional
sigintThe message to display when the SIGINT signal (CTRL+C) is received.
If not provided, a default message will be used.
This option is only used if sigintHandler
is not set to false
.
The printable title of the CLI.
Optional
usageUsage instructions for the CLI. Optional, but recommended. Use an array of strings for multiple lines to support indentation.
Optional
usageA label for the usage section. If not provided, it will default to "USAGE". This is used in the help message to indicate the usage section.
The options for clirk.