Enable tab-completion for the cja_auto_sdr command in your terminal for faster, error-free command entry.
Shell completion allows you to:
- Press
TABto auto-complete command options (e.g.,--fo→--format) - See available choices for options (e.g.,
--format+TABshows all formats) - Reduce typos and speed up your workflow
The easiest way to enable completions is with the built-in --completion flag:
cja_auto_sdr --completion bash >> ~/.bashrc
source ~/.bashrccja_auto_sdr --completion zsh >> ~/.zshrc
source ~/.zshrccja_auto_sdr --completion fish > ~/.config/fish/completions/cja_auto_sdr.fishNote: If
argcompleteis not installed, this command will print install instructions.
Add to your ~/.bashrc or ~/.bash_profile:
# Enable cja_auto_sdr tab completion
eval "$(register-python-argcomplete cja_auto_sdr)"Then reload your shell:
source ~/.bashrcAdd to your ~/.zshrc:
# Enable cja_auto_sdr tab completion
autoload -U bashcompinit
bashcompinit
eval "$(register-python-argcomplete cja_auto_sdr)"Then reload your shell:
source ~/.zshrcCreate a completion file:
# Create completions directory if needed
mkdir -p ~/.config/fish/completions
# Generate Fish completions
register-python-argcomplete --shell fish cja_auto_sdr > ~/.config/fish/completions/cja_auto_sdr.fishRestart Fish or run:
source ~/.config/fish/completions/cja_auto_sdr.fishThe argcomplete package must be installed. It's included as an optional dependency:
# If using uv
uv add argcomplete
# If using pip
pip install argcompleteVerify installation:
which register-python-argcomplete
# Should output a path like /usr/local/bin/register-python-argcompleteOnce configured, try these:
# Complete option names
cja_auto_sdr --for[TAB]
# Completes to: --format
# See available format choices
cja_auto_sdr --format [TAB][TAB]
# Shows: excel csv json html markdown all reports data ci
# Complete long options
cja_auto_sdr --val[TAB]
# Completes to: --validate-config
# Complete after partial input
cja_auto_sdr --log-[TAB][TAB]
# Shows: --log-level --log-formatInstead of adding eval statements to each shell config, you can activate completions globally:
# Run once (requires sudo)
sudo activate-global-python-argcompleteThis adds completion to /etc/bash_completion.d/.
# Create user completion directory
mkdir -p ~/.bash_completion.d
# Add to ~/.bashrc
if [ -d ~/.bash_completion.d ]; then
for f in ~/.bash_completion.d/*; do
source "$f"
done
fi
# Generate completion script
register-python-argcomplete cja_auto_sdr > ~/.bash_completion.d/cja_auto_sdr-
Verify argcomplete is installed:
python -c "import argcomplete; print('OK')" -
Check registration command exists:
which register-python-argcomplete
-
Ensure shell config is sourced:
# Bash source ~/.bashrc # Zsh source ~/.zshrc
-
Try direct evaluation:
eval "$(register-python-argcomplete cja_auto_sdr)" cja_auto_sdr --[TAB]
The argcomplete package isn't installed or isn't in your PATH:
# Install argcomplete
pip install argcomplete
# Or if using the project's virtual environment
cd /path/to/cja_auto_sdr
uv add argcompleteAdd these lines before the eval statement in ~/.zshrc:
autoload -U compinit
compinit
autoload -U bashcompinit
bashcompinitIf completions only work when the virtual environment is activated, use the full path:
eval "$(register-python-argcomplete /path/to/cja_auto_sdr/.venv/bin/cja_auto_sdr)"Or use uv run in the eval:
eval "$(cd /path/to/cja_auto_sdr && uv run register-python-argcomplete cja_auto_sdr)"argcomplete does not natively support PowerShell. On Windows, consider:
- Use WSL (Windows Subsystem for Linux) - Full bash completion support
- Use Git Bash - Bash completion works after setup
- Manual completion - Use
cja_auto_sdr --helpto see available options
- CLI Reference - Complete list of all options
- Quick Reference - Common commands cheat sheet
- argcomplete documentation