Shell completion
The varlock CLI supports tab completion for subcommands and flags. Setup is a one-time step per shell.
Generate a completion script with varlock complete <shell>, then install it using the instructions below for your shell.
After upgrading varlock, re-run varlock complete <shell> if new commands or flags were added.
Zsh completion files must be named with a leading underscore:
mkdir -p ~/.zsh/completionsecho 'fpath=(~/.zsh/completions $fpath)' >> ~/.zshrcecho 'autoload -U compinit && compinit' >> ~/.zshrcvarlock complete zsh > ~/.zsh/completions/_varlocksource ~/.zshrcmkdir -p ~/.local/share/bash-completion/completionsvarlock complete bash > ~/.local/share/bash-completion/completions/varlocksource ~/.bashrcmkdir -p ~/.config/fish/completionsvarlock complete fish > ~/.config/fish/completions/varlock.fishFish loads completions automatically — restart your shell or open a new terminal to pick them up.
varlock complete powershell >> $PROFILE. $PROFILEWhat gets completed
Section titled “What gets completed”Tab completion covers varlock subcommands and static flags (including enum choices like load --format).
Dynamic values — such as env var names from your schema — are not completed yet.
Troubleshooting
Section titled “Troubleshooting”If completions stop working after an upgrade, regenerate the script:
npm exec -- varlock complete zsh > ~/.zsh/completions/_varlockpnpm exec -- varlock complete zsh > ~/.zsh/completions/_varlockbunx varlock complete zsh > ~/.zsh/completions/_varlockvlx -- varlock complete zsh > ~/.zsh/completions/_varlockyarn exec -- varlock complete zsh > ~/.zsh/completions/_varlockvarlock complete zsh > ~/.zsh/completions/_varlockReplace zsh and the output path with your shell and install location.