Skip to content

usage

  • version: 1.3.4

CLI for working with usage-based CLIs

  • Usage: usage [--usage-spec] [COMPLETIONS] <SUBCOMMAND>

Arguments

[COMPLETIONS]

Outputs completions for the specified shell for completing the usage CLI itself

Flags

--usage-spec

Outputs a usage.kdl spec for this CLI itself

usage bash

Executes a bash script

Typically, this will be called by a script's shebang

Arguments

<SCRIPT>

[ARGS]...

arguments to pass to script

Flags

-h

show help

--help

show help

usage complete-word

Arguments

[WORDS]...

user's input from the command line

Flags

--shell <SHELL>

Choices:

  • bash
  • fish
  • zsh

-f --file <FILE>

usage spec file or script with usage shebang

-s --spec <SPEC>

raw string spec input

--cword <CWORD>

current word index

usage exec

Arguments

<COMMAND>

command to execute after parsing usage spec

<BIN>

path to script to execute

[ARGS]...

arguments to pass to script

usage generate

usage generate completion

Arguments

<SHELL>

Choices:

  • bash
  • fish
  • zsh

<BIN>

The CLI which we're generates completions for

Flags

--cache-key <CACHE_KEY>

A cache key to use for storing the results of calling the CLI with --usage-cmd

-f --file <FILE>

A .usage.kdl spec file to use for generating completions

--usage-cmd <USAGE_CMD>

A command which generates a usage spec e.g.: mycli --usage or mycli completion usage Defaults to "$bin --usage"

usage generate fig

Flags

-f --file <FILE>

A usage spec taken in as a file

--spec <SPEC>

raw string spec input

--out-file <OUT_FILE>

File on where to save the generated Fig spec

usage generate markdown

Flags

-f --file <FILE>

A usage spec taken in as a file

-m --multi

Render each subcommand as a separate markdown file

--url-prefix <URL_PREFIX>

Prefix to add to all URLs

--html-encode

Escape HTML in markdown

--out-dir <OUT_DIR>

Output markdown files to this directory

--out-file <OUT_FILE>

Licensed under the MIT License. Maintained by @jdx and friends.