Skip to content

Usage CLI

usage is the command-line utility around the usage spec. A spec describes a CLI's commands, flags, and arguments once, in KDL. This tool turns that one description into the things a CLI ships with, and runs scripts that carry a spec in their own comments.

To getRunGuide
Tab completion for bash, zsh, fish, PowerShell, and Nushellusage generate completionCompletions
Markdown reference pagesusage generate markdownMarkdown
Man pagesusage generate manpageManpages
Typed TypeScript and Python clientsusage generate sdkSDK generation
Parse tables for a Go CLIusage generate goGo preview
A JSON Schema for the CLI's config fileusage generate json-schemareference
A shell script with parsed arguments and --helpusage bash, usage execScripts
What changed between two versions of an interfaceusage diffComparing specs
What a command line binds to, and whyusage explainreference
Mistakes a spec can have and still parseusage lintreference
A CLI described to an AI agent, with each command's effectusage mcpreference

Most of these read a spec the same way: -f takes a .usage.kdl file, a script whose #USAGE comments declare one, or - for stdin. --spec passes one as a string instead, and generate completion will run a command that prints one, so that a completion script follows whichever version of the CLI is installed. A binary built with the Rust framework prints its own spec, so documenting it needs no file at all:

sh
mycli __usage_spec__ | usage generate markdown --file - --multi --out-dir docs

The reference lists every command and flag. It is generated from usage's own spec by the command it documents.

Installation

mise-en-place

sh
mise use -g usage

Cargo

sh
cargo install usage-cli --locked

cargo-binstall fetches a prebuilt binary instead of compiling one:

sh
cargo binstall usage-cli

Homebrew

sh
brew install usage

Arch Linux

The package is in Extra:

sh
pacman -S usage
MIT LicenseCopyright © 2026jdx.dev