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.
Frequently Asked Questions
Which shells does Suvadu support completions for?
Suvadu can generate completion scripts for Zsh, Bash, and Fish. Pass the shell name to suv completions <SHELL> and redirect the output to the appropriate completion directory for that shell.
Why aren't my completions working after setup?
The most common cause is that completion scripts only load when a shell starts, so you need to open a new terminal session (or source your rc file). For Zsh specifically, make sure the fpath+=~/.zfunc line comes before autoload -Uz compinit && compinit in your .zshrc — completions won't register if compinit runs first.
Do I need to regenerate completions after updating Suvadu?
Yes, if you want tab completion to cover newly added subcommands or flags. After running an update, regenerate the script for your shell (for example suv completions zsh > ~/.zfunc/_suv) and start a new session.
How do I get a man page for Suvadu?
Run suv man to output a standard troff man page to stdout. To install it system-wide so man suv works, write it to your man directory (for example suv man > /usr/local/share/man/man1/suv.1) and refresh the man database.