{"repo":"adaszko/complgen","free":true,"listed":false,"github":"https://github.com/adaszko/complgen","clone":"git clone https://github.com/adaszko/complgen.git","description":"Language-independent, declarative bash/fish/zsh/pwsh completions without writing shell scripts!","language":"Rust","stars":335,"topics":["bash-shell","fish-shell","shell-completion","zsh-shell","bash","completion","completions","fish","zsh","powershell"],"license":"GPL-3.0","category":"cli-tools","readme_excerpt":"Value Proposition complgen compiles man-page-like grammars into standalone completion scripts. One grammar file compiles into several different scripts for most popular shells, freeing you from having to reimplement and maintain the same (state-machine) logic for each shell separately. complgen grammars are declarative and thus much easier to maintain than long completion scripts. See examples. Demo Usage Bash Fish Zsh 💡 Note: Under ZSH, source isn't strictly necessary — it is enough to put the output file in one of the directories listed in $fpath variable. PowerShell 💡 Note: Requires PowerShell Core 7+ (pwsh). Add the script to your $PROFILE for persistent completions. Installation Or download a pre-built binary from the latest GitHub release. Syntax See the examples subdirectory. complgen's grammar is based on compleat's one. A grammar is a series of lines separated by a semicolon ( ; ). Each line either represents a single variant of invoking the completed command (e.g. git status; git log ) or is a nonterminal definition ( = bar ). a b matches a followed by b . a b c matches either a b or c (IOW: sequence binds stronger than alternative). [a] matches zero or one occurrences of a . a... matches one or more occurrences of a [a]... matches zero or more occurrences of a . (aaa bbb ccc) shows aaa and bbb as candidates, and ccc only when current input matches neither aaa nor bbb . behaves exactly like when matching, it differs only when offering completions. Use parentheses ","default_branch":null,"files":null,"tree":[],"storefront":"/r/adaszko","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/adaszko/complgen/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}