Shell Completion
Generate shell completion scripts for tab-completing LynxDB commands, flags, and arguments.
lynxdb completion [bash|zsh|fish|powershell]
Bash
# Add to current session
source <(lynxdb completion bash)
# Persist across sessions
lynxdb completion bash >> ~/.bashrc
After adding to ~/.bashrc, restart your shell or run source ~/.bashrc.
Zsh
# Add to current session
source <(lynxdb completion zsh)
# Persist across sessions
lynxdb completion zsh >> ~/.zshrc
If you use a completions directory:
lynxdb completion zsh > "${fpath[1]}/_lynxdb"
After adding, restart your shell or run source ~/.zshrc.
Fish
lynxdb completion fish > ~/.config/fish/completions/lynxdb.fish
Fish loads completions automatically from the completions directory.
PowerShell
# Add to current session
lynxdb completion powershell | Out-String | Invoke-Expression
# Persist across sessions (add to your PowerShell profile)
lynxdb completion powershell >> $PROFILE
What Gets Completed
The completion script provides tab-completion for:
- All top-level commands (
query,ingest,server,tail,mv, etc.) - Subcommands (
mv create,mv list,config get,alerts test, etc.) - Flags and their values (e.g.,
--formatcompletes tojson,table,csv, etc.) - Config keys for
config getandconfig set - Saved query names for
saved runandsaved delete - Materialized view names for
mv status,mv drop,mv pause,mv resume
Verifying Completion
After installation, verify that completion is working:
lynxdb <TAB><TAB>
# Should list all available commands
lynxdb query --format <TAB><TAB>
# Should list: auto json ndjson table csv tsv raw
lynxdb mv <TAB><TAB>
# Should list: create list status drop pause resume
Troubleshooting
If completions are not working:
- Run
lynxdb doctorto check if shell completion is detected - Ensure your shell is sourcing the completion file
- For Zsh, ensure
compinitis called in your.zshrc - For Bash, ensure
bash-completionis installed (apt install bash-completionorbrew install bash-completion)
See Also
- CLI Overview for all available commands
- config for the
doctorcommand that checks completion setup