Completions
Generate tab-completion scripts for your shell so you can autocomplete Suvadu subcommands, flags, and arguments without memorizing them.
Quick Start
Generate a completion script for your shell and write it to the appropriate location. Suvadu supports Zsh, Bash, and Fish.
suv completions <SHELL> The command outputs the completion script to stdout. Redirect it to a file in your shell's completion directory, then restart your shell (or source the file) to activate.
Zsh
Write the completion script to a file in your custom function path, then make sure that path is included before compinit in your .zshrc.
# Generate the completion script
suv completions zsh > ~/.zfunc/_suv Then ensure your .zshrc includes the following lines (before compinit):
# Add custom completions directory to fpath
fpath+=~/.zfunc
# Initialize completions
autoload -Uz compinit && compinit If ~/.zfunc does not exist yet, create it first:
mkdir -p ~/.zfunc Open a new terminal session or run source ~/.zshrc to activate.
Bash
Write the completion script to the Bash completions directory. The exact path depends on your system.
# macOS (Homebrew)
suv completions bash > /usr/local/etc/bash_completion.d/suv
# Linux
suv completions bash > /etc/bash_completion.d/suv If you do not have root access on Linux, you can source the completions from your .bashrc instead:
# Write to a user-local file
suv completions bash > ~/.local/share/bash-completion/completions/suv Open a new terminal session or run source ~/.bashrc to activate.
Fish
Write the completion script to Fish's completions directory. Fish picks up new files automatically — no restart required.
suv completions fish > ~/.config/fish/completions/suv.fish If the directory does not exist, create it first:
mkdir -p ~/.config/fish/completions Regenerating After Updates
When Suvadu is updated, new subcommands or flags may be added. Regenerate your completion script after updating to ensure tab completion covers all available options:
# Example for Zsh — repeat for your shell
suv completions zsh > ~/.zfunc/_suv Man Page
Suvadu can also generate a man page for offline reference. The suv man command outputs the man page to stdout in standard troff format.
suv man Installing the Man Page
To make it available system-wide via man suv:
suv man > /usr/local/share/man/man1/suv.1 You may need to update the man database afterwards:
# macOS
/usr/libexec/makewhatis /usr/local/share/man
# Linux
mandb Verifying Completions Work
After setting up completions, type suv (with a trailing space) and press Tab. You should see a list of available subcommands. Type a partial subcommand like suv al and press Tab to autocomplete to suv alias.
compinit is called after the fpath modification.