Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/cliffy/command/mod.ts>Command#command

Command line framework for deno 🦕 Including Commandline-Interfaces, Prompts, CLI-Table, Arguments Parser and more...
Extremely Popular
Go to Latest
method Command.prototype.command
Re-export
import { Command } from "https://deno.land/x/cliffy@v0.18.2/command/mod.ts";

Add new sub-command.

Type Parameters

C extends (CO extends number ? Command : Command<Record<string, any> | void, Array<unknown>, Record<string, any> | void, Merge<PG, CG> | void | undefined, OneOf<P, this> | undefined>)

Parameters

name: string

Command definition. E.g: my-command <input-file:string> <output-file:string>

cmd: C

The new child command to register.

optional
override: boolean

Override existing child command.

Returns

C extends Command<infer O, infer A, infer G, any, any> ? Command<O, A, G, Merge<PG, CG>, OneOf<P, this>> : never

Add new sub-command.

Type Parameters

optional
A extends Array<unknown> = Array<any>

Parameters

name: string

Command definition. E.g: my-command <input-file:string> <output-file:string>

optional
desc: string

The description of the new child command.

optional
override: boolean

Override existing child command.

Returns

Command<CO extends number ? any : void, A, CO extends number ? any : void, Merge<PG, CG>, OneOf<P, this>>