Shell Completions for Kimberlite CLI
On this page
The kimberlite CLI provides shell completions for Bash, Zsh, and Fish.
Installation
Bash
# Generate and install completion
# Or for user-only installation
# Then reload your shell or source the file
Zsh
# Generate and install completion
# Or for user-only installation
# Add to your ~/.zshrc (if not already present):
fpath=(/.zsh/completions )
&&
Fish
# Generate and install completion
# Completions are loaded automatically
Usage
Once installed, you can use tab completion for all kimberlite commands:
# Tab after typing kimberlite to see all commands
# Tab after a command to see its options
# Tab after flags to see available values
Available Completions
The shell completions support:
- All command names (init, dev, repl, query, tenant, cluster, etc.)
- All subcommands (tenant create, cluster init, etc.)
- All flags and options (–port, –tenant, –seed, etc.)
- File path completion for arguments expecting paths
- Enum value completion (e.g.,
--formatvalues: text, json, toml)
Verifying Installation
To verify completions are working:
- Type
kimberliteand press Tab - you should see all available commands - Type
kimberlite tenantand press Tab - you should see: create, list, delete, info - Type
kimberlite cluster init --and press Tab - you should see all flags
Troubleshooting
Bash: Completions not working
Problem: Tab completion doesn’t work after installation
Solutions:
- Ensure bash-completion is installed:
brew install bash-completion(macOS) orapt install bash-completion(Linux) - Source your completion file manually:
source ~/.local/share/bash-completion/completions/kimberlite - Check that bash-completion is loaded in your
~/.bashrcor~/.bash_profile
Zsh: Completions not found
Problem: _kimberlite:1: command not found: compdef
Solutions:
- Ensure compinit is called in your
~/.zshrcbefore loading completions - Add
autoload -Uz compinit && compinitto your~/.zshrc - Verify
fpathincludes your completions directory
Fish: Completions not loading
Problem: Completions don’t appear after installation
Solutions:
- Restart your Fish shell:
exec fish - Check file location:
~/.config/fish/completions/kimberlite.fish - Test manually:
complete -C kimberlite
Updating Completions
When you update kimberlite, regenerate completions to get the latest commands:
# Re-run the installation command for your shell
# Then reload your shell
Advanced: Custom Completions
If you want to add custom completion logic:
Bash
Edit the generated completion file and add custom logic to the _kimberlite() function.
Zsh
Add custom completions in ~/.zsh/completions/_kimberlite after the generated content.
Fish
Add custom completions in a separate file in ~/.config/fish/completions/.