uf: a small language for describing command-line programs, with shell autocomplete
uf is a small language and set of tools for describing command-line programs. Its grammar is intentionally simple and rigid, so that people and machines can read it at a glance. The project's README says that man[1] pages are hard to parse, and that command-line parsing libraries differ from one language to another.
The tools include uf borrow, which converts man and tldr[2] pages into .uf files, and uf explain, which gives searchable explanations for thousands of commands. uf complete provides autocompletion for Bash and Zsh, and uf gen creates parser[3] code for any language. A VS Code extension, ufls, adds syntax highlighting and hover text.
For now, precompiled binaries are on Google Drive. Building from source requires Git, Go 1.27.1 or newer, Make, and Bash, and make init sets up uf. The UFPATH environment variable lists the directories where uf searches for .uf files. The design rules require flags to come before positional arguments and to start with -, and there is no official support for aliases.
Read the original codeberg.orgDiscussion
Sources
-
Codeberg.org
`uf`: better documentation than `man` or `tldr`, autocomplete for everything in `fish`/`zsh`/`bash`, CLI code generation for multiple languages, etc etc.






