Use Shell Completion
This guide walks you through enabling and managing shell completion so that
angreal commands, template names, task names, and arguments complete on [TAB].
Shell completion helps you:
- Complete
angrealcommands automatically - Get template suggestions when using
angreal init - Complete task names within Angreal projects
- Complete command arguments
Supported shells: bash and zsh.
1. Install completion
Section titled “1. Install completion”The first time you run Angreal, it auto-installs completion for your current shell. If you need to install (or reinstall) it manually, run:
# Install for the current shell (auto-detected from $SHELL)angreal completion install
# Or install for a specific shellangreal completion install bashangreal completion install zshThe [shell] argument is optional; when omitted, Angreal detects your shell from
the $SHELL environment variable.
2. Activate completion in your current shell
Section titled “2. Activate completion in your current shell”Installation writes the completion script, but your already-open shell session won’t pick it up until it re-reads its startup file. Restart your shell, or reload it:
# bashsource ~/.bashrc
# zshsource ~/.zshrc3. Verify it’s working
Section titled “3. Verify it’s working”Check the installation status:
angreal completion statusThen try completion in a shell:
# Type 'angreal ' and press TAB to see available commandsangreal [TAB]
# Type 'angreal init ' and press TAB to see available templatesangreal init [TAB]
# Inside an Angreal project, TAB completes project task namesangreal [TAB]Uninstall completion
Section titled “Uninstall completion”To remove the completion script:
# Uninstall for the current shell (auto-detected)angreal completion uninstall
# Or for a specific shellangreal completion uninstall bashangreal completion uninstall zshDisable auto-install (e.g. in CI)
Section titled “Disable auto-install (e.g. in CI)”Angreal auto-installs completion on first run. To prevent that — for example in
a CI environment where you don’t want it modifying shell startup files — set the
ANGREAL_NO_AUTO_COMPLETION environment variable before running Angreal:
export ANGREAL_NO_AUTO_COMPLETION=1When this variable is set, the first-run auto-install is skipped. You can still
install completion explicitly with angreal completion install.
Related Documentation
Section titled “Related Documentation”- Create Tasks - How to create tasks with completion support
- Create Templates - How to create templates with completion support