Shell Completions¶
Enable tab completion for redisctl commands.
Supported shells: bash, zsh, fish, powershell, elvish
Dynamic Completions (Recommended)¶
Dynamic completions query the redisctl binary at runtime, enabling context-aware
completions such as profile names from your config file, file path hints, and URL hints.
To enable, add the registration one-liner to your shell's config file. You can print
the command with --register:
Dynamic completions provide:
- Profile names from your config (e.g.,
--profile my<Tab>completes to configured profiles) - File path hints for
--config-fileand--ca-cert - URL hints for
--urland--api-url - Executable path hints for
--redis-cli
Static Completions (Fallback)¶
Static scripts complete subcommands and flags but have no awareness of runtime values like profile names. Use these if dynamic completions are not supported in your environment.
Installation¶
Usage¶
After installation, press Tab to complete:
# Complete commands
redisctl ent<Tab>
# → redisctl enterprise
# Complete subcommands
redisctl enterprise cl<Tab>
# → redisctl enterprise cluster
# Complete options
redisctl enterprise cluster get --<Tab>
# → --output --query --profile ...
Homebrew Users¶
If you installed via Homebrew, completions may be automatically available. If not:
# Bash
echo 'source $(brew --prefix)/etc/bash_completion.d/redisctl' >> ~/.bashrc
# Zsh
echo 'source $(brew --prefix)/share/zsh/site-functions/_redisctl' >> ~/.zshrc
Troubleshooting¶
Completions Not Working¶
-
Verify the file was created:
-
Check your shell's completion system is enabled:
-
Restart your shell or source the completion file.
Zsh: Command Not Found: compinit¶
Add to your ~/.zshrc: