ohmyzsh/plugins/cdk/cdk.plugin.zsh
aayu22809 368728a512 Add AWS CDK plugin
Add an Oh My Zsh plugin for AWS CDK that registers yargs-based zsh completions and falls back to an npx wrapper for project-local CDK installations.
2026-05-04 02:02:26 -07:00

22 lines
562 B
Bash

# AWS CDK plugin
#
# Adds completion for the AWS CDK CLI. If `cdk` is not installed globally but
# `npx` is available, define a wrapper so project-local CDK installations work.
if (( ! $+commands[cdk] )); then
if (( ! $+commands[npx] )); then
return
fi
function cdk() {
npx -- cdk "$@"
}
fi
function _cdk_yargs_completions() {
local -a reply
reply=(${(f)"$(COMP_CWORD="$((CURRENT - 1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" cdk --get-yargs-completions "${words[@]}")"})
_describe 'values' reply
}
compdef _cdk_yargs_completions cdk