feat(cdk): add plugin for aws cdk

This commit is contained in:
Daniel Borcherding 2026-05-20 16:22:35 -06:00
commit 03875b5251
No known key found for this signature in database
2 changed files with 43 additions and 0 deletions

21
plugins/cdk/README.md Normal file
View file

@ -0,0 +1,21 @@
# AWS CDK
This plugin adds completion for the [AWS Cloud Development Kit (CDK)](https://aws.amazon.com/cdk/), as well as some aliases for common commands.
To use it, add `cdk` to the plugins array in your zshrc file:
```zsh
plugins=(... cdk)
```
## Aliases
| Alias | Command | Description |
| --------- | -------------- | --------------------------------------------------------- |
| `cdkc` | `cdk context` | Manage cached context values |
| `cdkd` | `cdk deploy` | Deploys the stack(s) named STACKS into your AWS account |
| `cdkdiff` | `cdk diff` | Compares the specified stack with the deployed stack |
| `cdki` | `cdk init` | Create a new, empty CDK project |
| `cdkl` | `cdk list` | Lists all stacks in the app |
| `cdks` | `cdk synth` | Synthesizes and prints the CloudFormation template |
| `cdkx` | `cdk destroy` | Destroy the stack(s) named STACKS |

View file

@ -0,0 +1,22 @@
if (( ! $+commands[cdk] )); then
return
fi
_cdk_yargs_completions() {
local reply
local si=$IFS
IFS=$' '
reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" cdk --get-yargs-completions "${words[@]}"))
IFS=$si
_describe 'values' reply
}
compdef _cdk_yargs_completions cdk
# Aliases
alias cdkc="cdk context"
alias cdkd="cdk deploy"
alias cdkdiff="cdk diff"
alias cdki="cdk init"
alias cdkl="cdk list"
alias cdks="cdk synth"
alias cdkx="cdk destroy"