close
Skip to main content
This release is versions behind 1.0.30 — the latest version of @std/cli.

@std/cli@1.0.6
Built and signed on GitHub Actions

Works with
This package works with DenoIt is unknown whether this package works with Bun
This package works with Deno
It is unknown whether this package works with Bun
JSR Score94%
Downloads23,973/wk
Published2 years ago (1.0.6)

Tools for creating interactive command line tools

Functions

f
parseArgs<
TArgs extends Values<
TBooleans,
TStrings,
TCollectable,
TNegatable,
TDefaults,
TAliases
>
,
TDoubleDash extends boolean | undefined = undefined,
TBooleans extends BooleanType = undefined,
TStrings extends StringType = undefined,
TCollectable extends Collectable = undefined,
TNegatable extends Negatable = undefined,
TDefaults extends Record<string, unknown> | undefined = undefined,
TAliases extends Aliases<TAliasArgNames, TAliasNames> | undefined = undefined,
TAliasArgNames extends string = string,
TAliasNames extends string = string
>
(
args: string[],
options?: ParseOptions<
TBooleans,
TStrings,
TCollectable,
TNegatable,
TDefaults,
TAliases,
TDoubleDash
>
): Args<TArgs, TDoubleDash>

Take a set of command line arguments, optionally with a set of options, and return an object representing the flags found in the passed arguments.

f
promptSecret(
message?: string,
options?: PromptSecretOptions
): string | null

Shows the given message and waits for the user's input. Returns the user's input as string. This is similar to prompt() but it print user's input as * to prevent password from being shown. Use an empty mask if you don't want to show any character.

Interfaces

I

Options for parseArgs.

  • --: TDoubleDash

    When true, populate the result _ with everything before the -- and the result ['--'] with everything after the --.