omni-dev completions <shell> prints a shell completion script to stdout. The
script is generated from the live clap command tree, so it stays in sync with
the CLI surface across releases without a separate maintenance burden.
Supported shells: bash, zsh, fish, powershell, elvish.
The subcommand is hidden from the top-level --help listing to keep the
primary help block focused on day-to-day commands, but it remains discoverable
via omni-dev help-all.
omni-dev completions bash | headIf you see a _omni__dev() function definition, the binary is working. The
remaining sections cover how to install the script so your shell actually
loads it.
# In ~/.bashrc:
eval "$(omni-dev completions bash)"This regenerates the completion script every time a new bash session starts,
so upgrading omni-dev is enough — there is no separate file to refresh.
omni-dev completions bash | sudo tee /etc/bash_completion.d/omni-dev > /dev/nullRequires the bash-completion package installed on the system. New shells
pick it up automatically.
Zsh discovers completion functions via $fpath and loads them through
compinit. The file must be named _omni-dev (underscore prefix matching the
command name) and live in a directory on $fpath.
The naive omni-dev completions zsh > "${fpath[1]}/_omni-dev" recipe assumes
$fpath[1] is user-writable. On most systems it is not — it tends to be
/usr/share/zsh/site-functions, owned by root. Use a directory you own
instead:
mkdir -p ~/.zsh/completions
omni-dev completions zsh > ~/.zsh/completions/_omni-devThen add this to ~/.zshrc before compinit runs:
fpath=(~/.zsh/completions $fpath)
autoload -Uz compinit && compinitOpen a new shell (or exec zsh) and tab-completion will work.
Oh My Zsh adds ~/.oh-my-zsh/completions to $fpath automatically, so you
can skip the $fpath edit:
mkdir -p ~/.oh-my-zsh/completions
omni-dev completions zsh > ~/.oh-my-zsh/completions/_omni-devunfunction _omni-dev 2>/dev/null
autoload -Uz _omni-dev
omni-dev <Tab>If completion fires, the installation worked.
- "_omni-dev: function definition file not found" — the file is not on
$fpath. Runecho $fpathand confirm the directory you wrote to is listed; if not, thefpath=(...)line in.zshrcis missing or runs aftercompinit. - No completions at all — clear the compinit cache and retry:
rm -f ~/.zcompdump*; exec zsh.
Fish loads completions from ~/.config/fish/completions/<command>.fish
automatically:
omni-dev completions fish > ~/.config/fish/completions/omni-dev.fishNo fish config change is required. The completion is available immediately
in new shells (and in existing shells after source of the file).
PowerShell uses Register-ArgumentCompleter. For the current session:
omni-dev completions powershell | Out-String | Invoke-ExpressionFor persistence across sessions, append the same line to your $PROFILE:
Add-Content $PROFILE 'omni-dev completions powershell | Out-String | Invoke-Expression'Then reopen the shell or . $PROFILE.
Elvish loads modules from ~/.config/elvish/lib/:
omni-dev completions elvish > ~/.config/elvish/lib/omni-dev.elvThen use omni-dev from ~/.config/elvish/rc.elv to load it on shell start.
When you upgrade omni-dev, regenerate any installed completion files so they
reflect new subcommands and flags. The bash eval "$(...)" recipe does this
automatically; the file-based recipes do not.
A simple refresh script:
omni-dev completions zsh > ~/.zsh/completions/_omni-dev
omni-dev completions fish > ~/.config/fish/completions/omni-dev.fish