jdx/usage
jdx/usage has 1,075 GitHub stars and 63 forks. GitHot measured +1 stars in 24 hours. Last checked 2026-11-09 10:44 UTC. Last push 2026-11-03.
A specification for CLIs
Measured star growth
- in 24h
- +1
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalUsage
Define your CLI once. Generate the tools around it.
Usage is a portable KDL specification, a command-line utility, and a Rust framework. Describe commands, flags, arguments, and settings in one place, then use that definition for parsing, help, shell completions, Markdown docs, man pages, and typed clients.
Get started · Rust framework · Spec reference · CLI reference
| Your starting point | How Usage fits |
|---|---|
| A new Rust CLI | Derive a typed parser and exportable spec from structs and enums. |
| An existing CLI | Export a spec from your framework, or write KDL. |
| A script | Declare arguments in comments and let Usage parse them. |
| Code that calls a CLI | Generate a TypeScript or Python SDK. |
Rust framework
Applications can use usage-rs to derive a typed parser and a portable Usage
spec from the same Rust declaration:
[dependencies]
usage-rs = { version = "6" }
use usage_rs::Cli;
#[derive(Cli)]
#[usage(bin = "example", version)]
struct App {
/// Print more detail.
#[usage(short = 'v', long, count)]
verbose: u8,
/// Files to process.
files: Vec<String>,
}
fn main() {
let app = App::parse();
// app.verbose and app.files are ready to use
}
Usage has its own derive vocabulary: use #[usage(...)] on commands, fields,
and value variants. See the Rust framework guide
and clap migration guide for
the supported mappings and intentional differences.
Standalone CLI
Choose one installation method:
# mise
mise use -g usage
# Homebrew
brew install usage
# Cargo
cargo install usage-cli --locked
The package is usage-cli; the executable is usage.
Other installation options.
With a spec saved as mycli.usage.kdl:
usage lint mycli.usage.kdl
usage generate completion zsh mycli --file mycli.usage.kdl --install
usage generate markdown --file mycli.usage.kdl --out-file reference.md
usage generate manpage --file mycli.usage.kdl --out-file mycli.1
The generated shell scripts need usage at completion time. The Rust framework
can also provide completions directly
from your binary.
Follow the spec walkthrough for a complete example. The Go framework is a development preview and is not ready for adoption or testing.
Contributing
See CONTRIBUTING.md for development setup, checks, and generated files.
Sponsors
Sponsored by
View all sponsors
Acknowledgements
Usage's design owes a great deal to clap. Its help output and diagnostic conventions make clap migrations familiar, while Usage's native derive attributes reflect its portable spec model. clap's license is reproduced in NOTICE.md.
License
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
561,294 starspublic-apis/public-apis
A collective list of free APIs
497,547 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
446,266 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,241 stars