Define your CLI once.
Usage is a toolkit for building command-line tools. Define your CLI's commands, flags, and args once in a KDL spec — get argument parsing, shell completions, --help, docs, and manpages from that one definition. Reference frameworks for Rust and Go build your CLI from the spec, with Python and JavaScript planned.
Frameworks
Derive your CLI from Rust types — parsing, help, and completions generated from the usage spec.
Build Go CLIs on the usage spec, with parsing behavior verified against the same conformance corpus as the Rust implementation.
Spec & tooling
Tab completions for bash, zsh, fish, PowerShell, and nushell, generated from the spec.
--help output, markdown docs, and manpages, all generated from the same spec.
Declare a script's interface in a USAGE comment and get arg parsing, validation, and completions.
Define your CLI once in KDL. Completions, docs, and parsers are all generated from it.
The standalone tool for generating completions, docs, and parsing from any spec file.
name "mycli"
flag "-v --verbose" help="Enable verbose output"
arg "<file>" help="File to process"
cmd "deploy" { flag "--env <env>" }Benchmarks
Wall time each framework adds to a process that parses nothing, measured on mise use -g node@20 against a shadow of mise's CLI: 211 commands, 711 flags, cold.
Most of clap's 490µs is building and validating its command tree before it can parse. Instructions: 50.9k vs 5.96M. Heap allocations for a bare parse: zero vs 6,560.
A do-nothing Go process costs ~0.95ms of runtime startup no parser can touch; these subtract it. Instructions: ~2.7k vs cobra's 2.0M, urfave/cli's 5.6M, kong's 57.9M.
Methodology and raw numbers: go/README.md · tasks/perf-shadow.sh