From 03875b52510f47e4e010984bf78af96f4d2a2049 Mon Sep 17 00:00:00 2001 From: Daniel Borcherding Date: Wed, 20 May 2026 16:22:35 -0600 Subject: [PATCH] feat(cdk): add plugin for aws cdk --- plugins/cdk/README.md | 21 +++++++++++++++++++++ plugins/cdk/cdk.plugin.zsh | 22 ++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 plugins/cdk/README.md create mode 100644 plugins/cdk/cdk.plugin.zsh diff --git a/plugins/cdk/README.md b/plugins/cdk/README.md new file mode 100644 index 000000000..af5d3b602 --- /dev/null +++ b/plugins/cdk/README.md @@ -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 | diff --git a/plugins/cdk/cdk.plugin.zsh b/plugins/cdk/cdk.plugin.zsh new file mode 100644 index 000000000..5cb8080a8 --- /dev/null +++ b/plugins/cdk/cdk.plugin.zsh @@ -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"