Tab-Completion
mdacli includes built-in support for command-line tab-completion
Activation
The activation method depends on your shell:
Bash
Temporary (current session only):
eval "$(register-python-argcomplete mda)"
Permanent (recommended)
Add to your ~/.bashrc:
echo 'eval "$(register-python-argcomplete mda)"' >> ~/.bashrc
source ~/.bashrc
Zsh
Add to your ~/.zshrc:
autoload -U bashcompinit
bashcompinit
eval "$(register-python-argcomplete mda)"
Then reload:
source ~/.zshrc
Fish
Generate the completion file:
register-python-argcomplete --shell fish mda > ~/.config/fish/completions/mda.fish
Restart your Fish shell or run:
source ~/.config/fish/config.fish
Tcsh
Add to your shell startup file:
eval `register-python-argcomplete --shell tcsh mda`
Usage Examples
Once enabled, tab-completion works for:
Module names:
mda <TAB>
# Shows: AlignTraj, AverageStructure, Contacts, DensityAnalysis, ...
Partial module names:
mda RM<TAB>
# Shows: RMSD, RMSF
Options and flags:
mda RMSD -<TAB>
# Shows: -s, -f, -atomgroup, -b, -e, -dt, -v, --debug, --version, ...
Case insensitive:
mda rmsd<TAB> # Also works
mda RmSd<TAB> # Also works
Troubleshooting
Tab-completion not working
Verify argcomplete is installed:
python -c "import argcomplete; print(argcomplete.__version__)"
Check if activation command was added:
grep "register-python-argcomplete mda" ~/.bashrc
Reload your shell:
source ~/.bashrc # or restart terminal
Test basic completion:
mda <TAB>
Still not working
Make sure you’ve restarted your terminal or sourced the configuration file
For Zsh, ensure
bashcompinitis loaded before argcompleteCheck that
mdais in your PATH:which mdaTry running the registration command manually in your current shell
Global activation (for all Python scripts)
To enable argcomplete for all Python scripts at once:
activate-global-python-argcomplete
This requires root/admin privileges and will enable completion system-wide.