feat(kamal): add autocomplete support and aliases for Kamal (https://kamal-deploy.org/) (#13080)

This commit is contained in:
Igor Aleksandrov 2025-05-15 01:48:50 +04:00 committed by GitHub
commit c95509ebfd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 732 additions and 0 deletions

View file

@ -0,0 +1,25 @@
# Find kamal binary (local ./bin/kamal or global)
function _kamal_command () {
if [ -x "./bin/kamal" ]; then
./bin/kamal "$@"
else
command kamal "$@"
fi
}
function which-kamal() {
if [ -x "./bin/kamal" ]; then
echo "Using local ./bin/kamal"
else
echo "Using global $(command -v kamal)"
fi
}
# Use `_kamal_command`` function for `kamal` command
alias kamal='_kamal_command'
# Aliases
alias kad='kamal deploy'
# Hook up completion
compdef _kamal_command=kamal