Cli cli.ts
Declarations #
6 declarations
Cli #
Cli
find_cli #
find_cli
(name: string, cwd?: string | URL, options?: SpawnOptions | undefined): Promise<Cli | null> Searches the filesystem for the CLI name, first local to the cwd and then globally.
name
type
stringcwd
type
string | URL default
process.cwd()options?
type
SpawnOptions | undefinedoptional
returns
Promise<Cli | null> null if not found locally or globally
resolve_cli #
resolve_cli
(name_or_cli: string | Cli, args: string[] | undefined, cwd: string | URL | undefined, log?: Logger | undefined, options?: SpawnOptions | undefined): Promise<...> name_or_cli
type
string | Cliargs
type
string[] default
[]cwd
type
string | URL | undefinedlog?
type
Logger | undefinedoptional
options?
type
SpawnOptions | undefinedoptional
returns
Promise<Cli | undefined> spawn_cli #
spawn_cli
(name_or_cli: string | Cli, args?: string[], log?: Logger | undefined, options?: SpawnOptions | undefined): Promise<SpawnResult | undefined> Spawns a CLI if available using Belt's spawn.
If a string is provided for name_or_cli, it checks first local to the cwd and then globally.
name_or_cli
type
string | Cliargs
type
string[] default
[]log?
type
Logger | undefinedoptional
options?
type
SpawnOptions | undefinedoptional
returns
Promise<SpawnResult | undefined> undefined if no CLI is found, or the spawn result
spawn_cli_process #
spawn_cli_process
(name_or_cli: string | Cli, args?: string[], log?: Logger | undefined, options?: SpawnOptions | undefined): Promise<SpawnedProcess | undefined> Spawns a CLI if available using Belt's spawn_process.
If a string is provided for name_or_cli, it checks first local to the cwd and then globally.
name_or_cli
type
string | Cliargs
type
string[] default
[]log?
type
Logger | undefinedoptional
options?
type
SpawnOptions | undefinedoptional
returns
Promise<SpawnedProcess | undefined> undefined if no CLI is found, or the spawn result
to_cli_name #
to_cli_name
(cli: string | Cli): string cli
type
string | Clireturns
string