interface Options {
    alias?: string | readonly string[];
    array?: boolean;
    boolean?: boolean;
    choices?: Choices;
    coerce?: ((arg: any) => any);
    config?: boolean;
    configParser?: ((configPath: string) => object);
    conflicts?: string | readonly string[] | {
        [key: string]: string | readonly string[];
    };
    count?: boolean;
    default?: any;
    defaultDescription?: string;
    demand?: string | boolean;
    demandOption?: string | boolean;
    deprecate?: string | boolean;
    deprecated?: string | boolean;
    desc?: string;
    describe?: string;
    description?: string;
    global?: boolean;
    group?: string;
    hidden?: boolean;
    implies?: string | readonly string[] | {
        [key: string]: string | readonly string[];
    };
    nargs?: number;
    normalize?: boolean;
    number?: boolean;
    require?: string | boolean;
    required?: string | boolean;
    requiresArg?: boolean;
    skipValidation?: boolean;
    string?: boolean;
    type?: "array" | "count" | PositionalOptionsType;
}

Properties

alias?: string | readonly string[]

string or array of strings, alias(es) for the canonical option key, see alias()

array?: boolean

boolean, interpret option as an array, see array()

boolean?: boolean

boolean, interpret option as a boolean flag, see boolean()

choices?: Choices

value or array of values, limit valid option arguments to a predefined set, see choices()

coerce?: ((arg: any) => any)

function, coerce or transform parsed command line values into another value, see coerce()

config?: boolean

boolean, interpret option as a path to a JSON config file, see config()

configParser?: ((configPath: string) => object)

function, provide a custom config parsing function, see config()

conflicts?: string | readonly string[] | {
    [key: string]: string | readonly string[];
}

string or object, require certain keys not to be set, see conflicts()

count?: boolean

boolean, interpret option as a count of boolean flags, see count()

default?: any

value, set a default value for the option, see default()

defaultDescription?: string

string, use this description for the default value in help content, see default()

demand?: string | boolean

since version 6.6.0 Use 'demandOption' instead

demandOption?: string | boolean

boolean or string, demand the option be given, with optional error message, see demandOption()

deprecate?: string | boolean

boolean or string, mark the argument as deprecated, see deprecateOption()

deprecated?: string | boolean

boolean or string, mark the argument as deprecated, see deprecateOption()

desc?: string

string, the option description for help content, see describe()

describe?: string

string, the option description for help content, see describe()

description?: string

string, the option description for help content, see describe()

global?: boolean

boolean, indicate that this key should not be reset when a command is invoked, see global()

group?: string

string, when displaying usage instructions place the option under an alternative group heading, see group()

hidden?: boolean

don't display option in help output.

implies?: string | readonly string[] | {
    [key: string]: string | readonly string[];
}

string or object, require certain keys to be set, see implies()

nargs?: number

number, specify how many arguments should be consumed for the option, see nargs()

normalize?: boolean

boolean, apply path.normalize() to the option, see normalize()

number?: boolean

boolean, interpret option as a number, number()

require?: string | boolean

since version 6.6.0 Use 'demandOption' instead

required?: string | boolean

since version 6.6.0 Use 'demandOption' instead

requiresArg?: boolean

boolean, require the option be specified with a value, see requiresArg()

skipValidation?: boolean

boolean, skips validation if the option is present, see skipValidation()

string?: boolean

boolean, interpret option as a string, see string()

type?: "array" | "count" | PositionalOptionsType