rsteube/lazycomplete
lazy loading for shell completion scripts
{ "createdAt": "2020-11-14T13:09:21Z", "defaultBranch": "master", "description": "lazy loading for shell completion scripts", "fullName": "rsteube/lazycomplete", "homepage": "", "language": "Go", "name": "lazycomplete", "pushedAt": "2022-11-22T14:08:57Z", "stargazersCount": 30, "topics": [ "bash", "completion", "fish", "lazy", "oil", "powershell", "shell", "xonsh", "zsh" ], "updatedAt": "2025-11-23T04:57:40Z", "url": "https://github.com/rsteube/lazycomplete"}lazycomplete
Section titled “lazycomplete”Lazy loading for shell completion scripts.
A lot of programs provide their own shell completion script by invoking them with a specific argument like mybinary completion. The easiest way to use it is to add the call to the shell init script (like .bashrc) which keeps the completion up to date. Add a couple of these and shell startup time is affected considerably though as a single invocation and subsequent parsing can take ~50-100ms. This tool generates a lazy loading script for given binaries where the actual completion script is resolved only when needed.
Status
Section titled “Status”WIP
Invoke with pairs of binary name and command to be invoked to create the completion:
# bashsource <(lazycomplete \ example 'example _carapace' \ lab 'lab _carapace' \)
# elvisheval (lazycomplete ^ example 'example _carapace' ^ lab 'lab _carapace' ^|slurp)
# fishlazycomplete \ example 'example _carapace' \ lab 'lab _carapace' \| source
# oilsource <(lazycomplete \ example 'example _carapace' \ lab 'lab _carapace' \)
# powershelllazycomplete ` example 'example _carapace' ` lab 'lab _carapace' `| Out-String | Invoke-Expression
# xonshexec($(lazycomplete \ example 'example _carapace' \ lab 'lab _carapace' \))
# zshsource <(lazycomplete \ example 'example _carapace' \ lab 'lab _carapace' \)