Shell Completions

Vulnetix CLI supports tab completion for commands, subcommands, flags, and flag values across all major shells. Completions are generated dynamically from the CLI binary, so they stay in sync with the version you have installed.

What Gets Completed

CategoryExample
Commandsvulnetix v<TAB>vdb, version
Subcommandsvulnetix vdb e<TAB>ecosystems, exploits
Flag namesvulnetix scan --f<TAB>--file, --format
Flag valuesvulnetix upload --format <TAB>cyclonedx, spdx, sarif, openvex, csaf_vex
File pathsvulnetix upload --file <TAB>(file browser)
Directoriesvulnetix scan --path <TAB>(directory browser)

Bash

Requires bash 4.1+ and the bash-completion v2 package.

Current Session

source <(vulnetix completion bash)

Permanent Installation

Choose one of the following:

# Option 1: bash-completion directory (recommended)
vulnetix completion bash > ~/.local/share/bash-completion/completions/vulnetix

# Option 2: System-wide (requires root)
vulnetix completion bash | sudo tee /etc/bash_completion.d/vulnetix > /dev/null

# Option 3: macOS with Homebrew
vulnetix completion bash > $(brew --prefix)/etc/bash_completion.d/vulnetix

# Option 4: Source from .bashrc
echo 'source <(vulnetix completion bash)' >> ~/.bashrc

Restart your shell or run source ~/.bashrc to activate.

Prerequisites

# Debian/Ubuntu
sudo apt install bash-completion

# macOS (Homebrew) — bash-completion v2 for bash 4.1+
brew install bash-completion@2

Zsh

Current Session

source <(vulnetix completion zsh)

Permanent Installation

# Standard zsh (writes to first directory in fpath)
vulnetix completion zsh > "${fpath[1]}/_vulnetix"

# Oh My Zsh
mkdir -p ~/.oh-my-zsh/completions
vulnetix completion zsh > ~/.oh-my-zsh/completions/_vulnetix

# macOS with Homebrew
vulnetix completion zsh > $(brew --prefix)/share/zsh/site-functions/_vulnetix

After installing, restart your shell or run:

compinit

Troubleshooting

If completions don’t load, ensure compinit is called in your .zshrc:

autoload -Uz compinit && compinit

If you see a warning about insecure directories, either fix the directory permissions or add this before compinit:

ZSH_DISABLE_COMPFIX=true

Fish

Current Session

vulnetix completion fish | source

Permanent Installation

vulnetix completion fish > ~/.config/fish/completions/vulnetix.fish

Fish automatically loads completions from ~/.config/fish/completions/, so no additional configuration is needed. Completions are available immediately in new shells.


PowerShell

Current Session

vulnetix completion powershell | Out-String | Invoke-Expression

Permanent Installation

# Add to your PowerShell profile
vulnetix completion powershell >> $PROFILE

If your profile doesn’t exist yet:

New-Item -Path $PROFILE -ItemType File -Force
vulnetix completion powershell >> $PROFILE

You may need to adjust the execution policy:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Profile Locations

ShellPath
PowerShell Core~/.config/powershell/Microsoft.PowerShell_profile.ps1
Windows PowerShell~\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

Flags with Value Completion

The following flags provide tab-completable values:

CommandFlagValues
auth login--methodapikey, sigv4
auth login--storehome, project, keyring
scan--typemanifest, spdx, cyclonedx
scan--outputjson, pretty
scan--formatcdx17, cdx16, json
upload--formatcyclonedx, spdx, sarif, openvex, csaf_vex
vdb--methodapikey, sigv4
vdb--outputjson, yaml, pretty
vdb-V, --api-versionv1, v2
vdb--highlightdark, light, none
vdb exploits search--sourceexploitdb, metasploit, nuclei, vulncheck-xdb, crowdsec, github, poc
vdb exploits search--severityCRITICAL, HIGH, MEDIUM, LOW, NONE
vdb exploits search--sortrecent, epss, severity, maturity
vdb timeline--datespublished, modified, reserved

File path flags (upload --file, scan --file) use your shell’s native file browser. The scan --path flag completes directory names only.


Package Manager Notes

  • Homebrew: Completions are installed automatically by the formula for bash, zsh, and fish. No manual setup is needed.
  • Scoop: Does not install completions automatically. Use the PowerShell instructions above.
  • Nix: The flake does not install completions. Use the instructions for your shell above.
  • go install / curl: Completions are not installed automatically. Use the instructions for your shell above.

Updating Completions

After upgrading Vulnetix CLI, regenerate your completions to pick up new commands and flags:

# Re-run the same command you used to install
vulnetix completion bash > ~/.local/share/bash-completion/completions/vulnetix

If you installed via Homebrew, completions are updated automatically with brew upgrade vulnetix.