Skip to content

cli ​

Generated reference page for the cli function export.

Signatures ​

Overload 1 ​

ts
function cli(name: string, options?: Omit<CLIOptions, "name">): CLIBuilder;

Overload 2 ​

ts
function cli(options: CLIOptions): CLIBuilder;

Members ​

Members ​

cli ​

Create a new CLI program builder.

The CLI name is used in help text, usage lines, and generated completion scripts.

ts
(name: string, options?: Omit<CLIOptions, "name">): CLIBuilder;

cli ​

Create a new CLI program builder from an options object.

ts
(options: CLIOptions): CLIBuilder;

Examples ​

ts
cli('mycli')
  .version('1.0.0')
  .description('My awesome tool')
  .command(deploy)
  .command(login)
  .run();

cli({ inherit: true })
  .command(deploy)
  .run();

See Also ​

Released under the MIT License.