usage

jdx·jdx.usage

A specification for CLIs

Usage is a spec and CLI for defining CLI tools. Arguments, flags, environment variables, and config files can all be defined in a Usage spec. It can be thought of like OpenAPI (swagger) for CLIs. Here are some potential reasons for defining your CLI with a Usage spec: - Generate autocompletion scripts - Generate markdown documentation - Generate man pages - Generate type-safe SDK client libraries for TypeScript, Python, and Rust - Use an advanced arg parser in any language - Scaffold one spec into different CLI frameworks-even different languages - [coming soon] Host your CLI documentation on usage.sh

winget install --id jdx.usage --exact --source winget

Latest 7.5.0·December 1, 2026

Release Notes

Specs can now declare the environment variables a command reads with a new env node. This release also makes Tab completion offer flags instead of file names when no positional argument is left, and loads large specs much faster. Added

  • (spec) A new env node declares an environment variable that a command reads but that isn't the value of any flag (#1689). Put it inside a cmd for a variable that command reads, or at the top level for one the whole program reads. Proposed in discussion #1688. cmd "shell" help="Open a shell in the worktree" { env "SHELL" help="The program to open" default_note="bash" }
    • Markdown docs list the variable under Environment on the command's page. Man pages list it in the command's section, and top-level variables get an ENVIRONMENT section.
    • usage generate json includes it as envs on the command.
    • unknown_env treats it as declared, including when it is hidden.
    • usage lint adds two rules: missing-env-help (info) and duplicate-env (error). The node supports help, long_help, default_note, deprecated and hide. It only documents the variable: usage never reads it or applies the default, and subcommands don't inherit it. Library users get a new SpecEnv type and a SpecCommand::envs field. The Rust derives don't emit env nodes yet, so for now you have to declare them in KDL.

Fixed

  • (complete) complete-word no longer offers file names when the command takes no more positional arguments and has no subcommands (#1681). Pressing Tab on an empty word now lists the command's flags. A word that doesn't start with -, or any word after --, gets no candidates. For example, mise run for a task that has only flags now shows those flags instead of the current folder. Thanks to @roalcantara for reporting it in #1679.

Performance

  • (spec) Large specs load faster, which speeds up every Tab completion (#1683, #1684). The KDL parser is about 3x faster and produces the same results and errors as before. Global flags are also no longer copied into every command during spec loading. On mise's spec, completing mise use takes about 57% fewer instructions.

πŸ’š Sponsor usage usage is built and maintained by @jdx, an open source developer at entire.io, the title sponsor of his open source work. If usage powers CLI specs, docs, or completions for a tool you maintain or use, please consider becoming an individual or company sponsor. Your support funds ongoing development and helps keep usage fast, free, and independent.

Installer type: zip

x64β€”751A94D25E3C554E3C2D04B6997480DC8052DC57FB3D6B4BAF6FECA0A8367667
arm64β€”9B82B2DCDCFAA8E5260D9FACDAAE431CBD90132F66B2DAA95DD413F114679796

Details

Homepage
https://usage.jdx.dev/
License
MIT
Publisher
jdx
Support
https://github.com/jdx/usage/issues
Copyright
Copyright (c) 2025 Jeff Dickey
Moniker
usage

Tags

clispec

Older versions (22)

7.4.1
x64β€”EE863AA1A1173FA84DBAA9707F52C14FCC3115E283EB6B842979CC5A38BA6FC8
arm64β€”E79B9F65491AE66AF043E2344AD7ABF5EC4B71185562849859F28B5B8B72022D
7.4.0
x64β€”A0BC6718039BBB4289E19981A2CF82A7E1D8509EB426CB27FCB90C0DC34D8B66
arm64β€”EE1F583B4357D8836FA95F9FE0C7A837DA6B92B1A26FB881D146CEB45EDF49DC
7.3.0
x64β€”0156C5FF413CB49275B109A44B0BB388D8AEBF4CE2F47DB4902333D3FBEE46CC
arm64β€”BE6E5EF486713AF5AA9DE830A9CAE3F0642C5CC3D6EC475C6AAF52479F53382D
7.2.0
x64β€”3C9C624DD930C1779F7118EB7C80C42336661FD16754DE79A41059868F8CB199
arm64β€”D6FE897D731BDBF03BD3EC08DE9A9FD0183B52D5354DBA2BEDC3C2D7E840A568
7.1.5
x64β€”F85334345483DACE180537BEF1D7C68E3DAA6D27FBD71C128552DF4D3D1CDB53
arm64β€”335BC7E5FCFAFB35AAE0C8CABE99BAE20F277C8DDD432EBBDAE355079797280D
7.1.4
x64β€”3254065EF86ACB0131BE75909EE9010CD41DE22E10BCBBC1C1829494B9C7A23F
arm64β€”1AD0C5B4B4E72F7564B93503D604CB496CD4E979A394405E217352601F30382F
7.1.3
x64β€”4ABB3F7B7E9ECAC17558BE73336137FA83EC9A43D0C1168A9BBB5AEDD1685A27
arm64β€”EC5F05A17F4CA09AAA0FE5AE469107DACB34F8F1311567BF8B4EBC693BCAF1C0
7.1.2
x64β€”061FE944671B7348D034CCAF016C457F896597DBDDC18EE2D6858BD88BDB1519
arm64β€”ED24B0C6A1164982C1C05F4C21B9D7283069EFB8F0E8F4A5B5E58322471FF573
7.1.1
x64β€”75659545F16F84474C32CEBB6EE3E304AEDF63286C31EC73C3CAB695FB56A6AA
arm64β€”B4A36CECABE8BFFEB2A5191A7C415DAD32B65AA3AF15FCA9E0ABB43BB91B0CD6
7.1.0
x64β€”012B38D1771EC2DF24F3AAC44C24DB58F56158AD339C7032415AEAFE03B7245D
arm64β€”47A735458121F9738462557C65E3625C4B32A8741DBBB3C366D7D48EA9C4D9F1
7.0.2
x64β€”91586495A99681B405C62A5C7C8F60DFFCA0D006834D3526520CED8527818CB5
arm64β€”18DE963480AC9141E6A49CA13660705D1D5D62F28EEC8235C7AC4AB232BEBF8E
7.0.1
x64β€”9518804218A48901AC82228618CA58503D7D79166E61DF6C04FA8E6A07EF7666
arm64β€”B3789E6D5585DFB62AF8046734D3EDB962E01243D9516D169AF8321AAC800A6D
7.0.0
x64β€”D9D2A1C134D5A02E5BC4129132BCA204862090A6C8CCED9366C95DDED7A5350B
arm64β€”887FB848B2BCA94FFA48FE7891C09FD0471F110EF3F5D3E8F214132322A810E8
6.12.1
x64β€”B5F1E3FAA5DEA4FFF179BDEF2E9AC737D2D416496FB9332E0D686E9A4A7B6D2C
arm64β€”98BEDAC7B5177483B817A52AFC8D7A63A8107013F41119BF2C5D2220D436D094
6.12.0
x64β€”BC9E362FD5169A9A13EB943963C905BB60F3FD2BD1076336C2BEB2878209BC24
arm64β€”2CDB29A06EDB66C4ED4CBA0136FF6BED394139410F346F77673A66268A0F39FD
6.11.1
x64β€”783CE7539B1145F1860054352067E5DA70BFAC1CEEBA3C9F3CB912477068F99D
arm64β€”F306676E46D2563B344A5EB93CF20729537788821F619889F83B971CF55988BB
6.11.0
x64β€”49F78FDEB1678986A89FABFFC10B9E01C1DEE4D3F8F001CD245AF0471DF9D9BE
arm64β€”A7B8088188271EA27322AE521170C8E43B2CA7676FDF99873C9122099C91480B
6.10.0
x64β€”0016FB4AD0AA2762EC089D3710FD540AAEDED08E27D0046660A2ECA143F976AF
arm64β€”80C4F0699DFBE6008BD0833D7C5420D3025090DD5C5D888DFD22C62FBBA87182
6.9.1
x64β€”932008A3F68F0B72FB2012443980D04B01029AF9BA2D31A5AF0601A76E7E5870
arm64β€”637E09873F5B7CAEE36996B8AF5C3C8B1A5B5B2AEFF1ACE18F91A5EBD4A6478D
6.9.0
x64β€”C2DDC621AD3E4806A4EB685E4ADEB654093EAEB01007C81DAC103ECDFBB4FB31
arm64β€”10D6B3958FCCEEFD4979B629104A4386317B561C7E29801CBE3FC1F9210FF184
6.8.0
x64β€”F97CF597BEF4A2A643B38ABCB02E2D47622E658FCCF17FD5D1A97DF9FAC17B78
arm64β€”D4C94BC6403073F4AB1C03864DD1E5714E35CF9EA65EC184C62EFD6EAB5D3F4F
5.0.0
x64β€”0CA7CBC821D6FE274EF42162058935261BF0F7AD8029A197275FF83CC36D996E
arm64β€”409201AFACD7B6C8E2B5CFB452DD44A27B2DB3B57662F6E6EBC74A9E2D2F9801