## Index

### Classes

- CliTerseError
- CliUsageError

### Interfaces

- ICli
- ICliAnsi
- ICliArgGroup
- ICliBranch
- ICliBranchOptions
- ICliCommand
- ICliCommandOptions
- ICliConsole
- ICliFlagArgGroupOptions
- ICliJsonArgGroupOptions
- ICliLeaf
- ICliNumberArgGroupOptions
- ICliNumberArrayArgGroupOptions
- ICliOptions
- ICliProcess
- ICliStringArgGroupOptions
- ICliStringArrayArgGroupOptions
- ICliStringChoiceArgGroupOptions
- ICliTree
- IDescriptionInput

### Type aliases

- TCliArgGroupArgs
- TCliDescription
- TCliDescriptionFunction
- TCliRoot

### Variables

- CLI_BRANCH
- CLI_COMMAND
- CLI_TERSE_ERROR
- CLI_USAGE_ERROR

### Functions

- Cli
- CliAnsi
- CliBranch
- CliCommand
- CliFlagArgGroup
- CliJsonArgGroup
- CliNumberArgGroup
- CliNumberArrayArgGroup
- CliStringArgGroup
- CliStringArrayArgGroup
- CliStringChoiceArgGroup
- CliWordMark

## Type aliases

### TCliArgGroupArgs

TCliArgGroupArgs<TRequired>: TRequired extends true ? string[] : string[] | undefined

- Defined in src/cli-arg-group.ts:7

Defines the type of the args passed to an `ICliArgGroup`

#### Type parameters

- #### TRequired: boolean

  If `true`, the `args` parameter might be `undefined`

### TCliDescription

TCliDescription: undefined | string | TCliDescriptionFunction

- Defined in src/cli-description.ts:9

### TCliDescriptionFunction

TCliDescriptionFunction: (input: IDescriptionInput) => string

- Defined in src/cli-description.ts:7

#### Type declaration

- - (input: IDescriptionInput): string

  - #### Parameters

    - ##### input: IDescriptionInput

    #### Returns string

### TCliRoot

TCliRoot: ICliBranch | ICliCommand<ICliArgGroup, any, ICliArgGroup>

- Defined in src/cli-tree.ts:8

The root of a command tree

## Variables

### Const CLI_BRANCH

CLI_BRANCH: "CLI_BRANCH" = "CLI_BRANCH"

- Defined in src/cli-branch.ts:5

"kind" of an `ICliBranch`

### Const CLI_COMMAND

CLI_COMMAND: "CLI_COMMAND" = "CLI_COMMAND"

- Defined in src/cli-command.ts:7

"kind" of a `ICliCommand`

### Const CLI_TERSE_ERROR

CLI_TERSE_ERROR: "CLI_TERSE_ERROR" = "CLI_TERSE_ERROR"

- Defined in src/cli-terse-error.ts:2

"code" of a `CliTerseError`

### Const CLI_USAGE_ERROR

CLI_USAGE_ERROR: "CLI_USAGE_ERROR" = "CLI_USAGE_ERROR"

- Defined in src/cli-usage-error.ts:4

"code" of a CliUsageError

## Functions

### Cli

- Cli(root: TCliRoot, options?: ICliOptions): ICli

- - Defined in src/cli.ts:15

  Options for `Cli`

  #### Parameters

  - ##### root: TCliRoot

  - ##### Default value options: ICliOptions = {}

  #### Returns ICli

### CliAnsi

- CliAnsi(enabled?: boolean): ICliAnsi

- - Defined in src/cli-ansi.ts:56

  A factory for `ICliAnsi`s

  #### Parameters

  - ##### Default value enabled: boolean = PROCESS.stdout.isTTY && PROCESS.stderr.isTTY

  #### Returns ICliAnsi

### CliBranch

- CliBranch(options: ICliBranchOptions): ICliBranch

- - Defined in src/cli-branch.ts:40

  A factory for `ICliBranch`s

  example

        const cloudBranch = CliBranch()

  #### Parameters

  - ##### options: ICliBranchOptions

  #### Returns ICliBranch

  An `ICliBranch` object

### CliCommand

- CliCommand<TPositionalArgGroup, TNamedArgGroups, TDoubleDashArgGroup>(options: ICliCommandOptions<TPositionalArgGroup, TNamedArgGroups, TDoubleDashArgGroup>): ICliCommand<TPositionalArgGroup, TNamedArgGroups, TDoubleDashArgGroup>

- - Defined in src/cli-command.ts:69

  A factory for `ICliCommand`s

  #### Type parameters

  - #### TPositionalArgGroup: ICliArgGroup

  - #### TNamedArgGroups: {}

  - #### TDoubleDashArgGroup: ICliArgGroup

  #### Parameters

  - ##### options: ICliCommandOptions<TPositionalArgGroup, TNamedArgGroups, TDoubleDashArgGroup>

  #### Returns ICliCommand<TPositionalArgGroup, TNamedArgGroups, TDoubleDashArgGroup>

### CliFlagArgGroup

- CliFlagArgGroup(options?: ICliFlagArgGroupOptions): ICliArgGroup<boolean, false>

- - Defined in src/arg-group-factories/cli-flag-arg-group.ts:27

  A factory for boolean-valued `ICliArgGroup`'s

  example

        $ cli           // named flag "foo" parses `false`
        $ cli --foo     // named flag "foo" parses `true`
        $ cli --foo bar // usage error

  throws

    `CliUsageError`

  #### Parameters

  - ##### Default value options: ICliFlagArgGroupOptions = {}

  #### Returns ICliArgGroup<boolean, false>

### CliJsonArgGroup

- CliJsonArgGroup(options?: ICliJsonArgGroupOptions): ICliArgGroup<any>

- - Defined in src/arg-group-factories/cli-json-arg-group.ts:34

  A factory for `ICliArgGroup`s that `JSON.parse`

  example

    Suppose our CLI's positionalArgGroup is a CliJsonArgGroup. Here's how that behaves:

        $ cli '{"foo":true}' // named value "json" receives object `{ foo: true }`
        $ cli                // usage error
        $ cli '""' '""'      // usage error
        $ cli foo            // error parsing JSON

  throws

    `CliUsageError`

  #### Parameters

  - ##### Default value options: ICliJsonArgGroupOptions = {}

  #### Returns ICliArgGroup<any>

### CliNumberArgGroup

- CliNumberArgGroup(options: ICliNumberArgGroupOptions & { required: true }): ICliArgGroup<number, true>
- CliNumberArgGroup(options?: ICliNumberArgGroupOptions): ICliArgGroup<number | undefined, boolean>

- - Defined in src/arg-group-factories/cli-number-arg-group.ts:21

  A factory for `number`-valued required `ICliArgGroup`s

  #### Parameters

  - ##### options: ICliNumberArgGroupOptions & { required: true }

  #### Returns ICliArgGroup<number, true>

- - Defined in src/arg-group-factories/cli-number-arg-group.ts:26

  A factory for `number | undefined`-valued optional `ICliArgGroup`s

  #### Parameters

  - ##### Optional options: ICliNumberArgGroupOptions

  #### Returns ICliArgGroup<number | undefined, boolean>

### CliNumberArrayArgGroup

- CliNumberArrayArgGroup(options: ICliNumberArrayArgGroupOptions & { required: true }): ICliArgGroup<number[], true>
- CliNumberArrayArgGroup(options?: ICliNumberArrayArgGroupOptions): ICliArgGroup<number[] | undefined, boolean>

- - Defined in src/arg-group-factories/cli-number-array-arg-group.ts:21

  A factory for required `number[]`-valued `ICliArgGroup`s

  #### Parameters

  - ##### options: ICliNumberArrayArgGroupOptions & { required: true }

  #### Returns ICliArgGroup<number[], true>

- - Defined in src/arg-group-factories/cli-number-array-arg-group.ts:26

  A factory for optional `number[] | undefined`-valued `ICliArgGroup`s

  #### Parameters

  - ##### Optional options: ICliNumberArrayArgGroupOptions

  #### Returns ICliArgGroup<number[] | undefined, boolean>

### CliStringArgGroup

- CliStringArgGroup(options: ICliStringArgGroupOptions & { required: true }): ICliArgGroup<string, true>
- CliStringArgGroup(options?: ICliStringArgGroupOptions): ICliArgGroup<string | undefined, false>

- - Defined in src/arg-group-factories/cli-string-arg-group.ts:20

  A factory for required `string`-valued `ICliArgGroup`s

  #### Parameters

  - ##### options: ICliStringArgGroupOptions & { required: true }

  #### Returns ICliArgGroup<string, true>

- - Defined in src/arg-group-factories/cli-string-arg-group.ts:25

  A factory for optional `string | undefined`-valued `ICliArgGroup`s

  #### Parameters

  - ##### Optional options: ICliStringArgGroupOptions

  #### Returns ICliArgGroup<string | undefined, false>

### CliStringArrayArgGroup

- CliStringArrayArgGroup(options: ICliStringArrayArgGroupOptions & { required: true }): ICliArgGroup<string[], true>
- CliStringArrayArgGroup(options?: ICliStringArrayArgGroupOptions): ICliArgGroup<string[] | undefined, boolean>

- - Defined in src/arg-group-factories/cli-string-array-arg-group.ts:20

  A factory for required `string[]`-valued `ICliArgGroup`s

  #### Parameters

  - ##### options: ICliStringArrayArgGroupOptions & { required: true }

  #### Returns ICliArgGroup<string[], true>

- - Defined in src/arg-group-factories/cli-string-array-arg-group.ts:25

  A factory for optional `string[] | undefined`-valued `ICliArgGroup`s

  #### Parameters

  - ##### Optional options: ICliStringArrayArgGroupOptions

  #### Returns ICliArgGroup<string[] | undefined, boolean>

### CliStringChoiceArgGroup

- CliStringChoiceArgGroup<TChoices>(options: ICliStringChoiceArgGroupOptions<TChoices> & { required: true }): ICliArgGroup<TChoices[number], true>
- CliStringChoiceArgGroup<TChoices>(options: ICliStringChoiceArgGroupOptions<TChoices>): ICliArgGroup<TChoices[number] | undefined, false>

- - Defined in src/arg-group-factories/cli-one-of-arg-group.ts:36

  A factory for required `ICliArgGroup`s whose value is one of the choices provided

  #### Type parameters

  - #### TChoices: string[]

    Type of the provided choices

  #### Parameters

  - ##### options: ICliStringChoiceArgGroupOptions<TChoices> & { required: true }

  #### Returns ICliArgGroup<TChoices[number], true>

- - Defined in src/arg-group-factories/cli-one-of-arg-group.ts:45

  A factory for optional `ICliArgGroup`s whose value is one of the choices provided

  #### Type parameters

  - #### TChoices: string[]

    Type of the provided choices

  #### Parameters

  - ##### options: ICliStringChoiceArgGroupOptions<TChoices>

  #### Returns ICliArgGroup<TChoices[number] | undefined, false>

### Const CliWordMark

- CliWordMark(__namedParameters: { ansi: ICliAnsi }): string

- - Defined in src/cli-word-mark.ts:3

  #### Parameters

  - ##### __namedParameters: { ansi: ICliAnsi }

    - ##### ansi: ICliAnsi

  #### Returns string

Generated using TypeDoc and MonoLisa