From da368d646833c61f73ed30ebb664c6d0e6c4fe73 Mon Sep 17 00:00:00 2001 From: Akshat1927 Date: Mon, 3 Aug 2026 13:46:50 +0530 Subject: [PATCH] feat(cdk): add plugin (#13831) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marc Cornellà --- plugins/cdk/README.md | 32 ++++++++++++++++++++++++++++++++ plugins/cdk/_cdk | 12 ++++++++++++ plugins/cdk/cdk.plugin.zsh | 13 +++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 plugins/cdk/README.md create mode 100644 plugins/cdk/_cdk 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..fe97ba4ea --- /dev/null +++ b/plugins/cdk/README.md @@ -0,0 +1,32 @@ +# AWS CDK Plugin + +This plugin provides aliases and autocompletion for the [AWS Cloud Development Kit (CDK)](https://aws.amazon.com/cdk/) CLI. + +## Usage + +Add `cdk` to the plugins array in your `.zshrc`: + +```zsh +plugins=(... cdk) +``` + +## Requirements + +- [AWS CDK CLI](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html) installed (`npm install -g aws-cdk`) + +## Aliases + +| Alias | Command | Description | +| ------------ | ----------------- | ---------------------------------- | +| `cdkl` | `cdk list` | List all stacks in the app | +| `cdksynth` | `cdk synth` | Synthesize CloudFormation template | +| `cdkdiff` | `cdk diff` | Compare deployed vs local stack | +| `cdkdeploy` | `cdk deploy` | Deploy stack to AWS | +| `cdkdestroy` | `cdk destroy` | Destroy deployed stack | +| `cdkboot` | `cdk bootstrap` | Bootstrap CDK environment | +| `cdkdoc` | `cdk docs` | Open CDK documentation | +| `cdkinit` | `cdk init` | Initialize a new CDK project | +| `cdkwatch` | `cdk watch` | Watch for changes and auto-deploy | +| `cdkctx` | `cdk context` | Manage cached context values | +| `cdkack` | `cdk acknowledge` | Acknowledge a notice | +| `cdkver` | `cdk --version` | Print CDK version | diff --git a/plugins/cdk/_cdk b/plugins/cdk/_cdk new file mode 100644 index 000000000..4a67095c0 --- /dev/null +++ b/plugins/cdk/_cdk @@ -0,0 +1,12 @@ +#compdef cdk + +# Originally found and adapted from: https://github.com/aws/aws-cdk/discussions/24380#discussioncomment-5158176 + +local -a reply +local IFS +IFS=$'\n' reply=($(COMP_CWORD="$((CURRENT-1))" \ + COMP_LINE="$BUFFER" \ + COMP_POINT="$CURSOR" \ + cdk --get-yargs-completions "${words[@]}")) + +_describe 'values' reply diff --git a/plugins/cdk/cdk.plugin.zsh b/plugins/cdk/cdk.plugin.zsh new file mode 100644 index 000000000..654d372fa --- /dev/null +++ b/plugins/cdk/cdk.plugin.zsh @@ -0,0 +1,13 @@ +# Aliases +alias cdkl='cdk list' +alias cdksynth='cdk synth' +alias cdkdiff='cdk diff' +alias cdkdeploy='cdk deploy' +alias cdkdestroy='cdk destroy' +alias cdkboot='cdk bootstrap' +alias cdkdoc='cdk docs' +alias cdkinit='cdk init' +alias cdkwatch='cdk watch' +alias cdkctx='cdk context' +alias cdkack='cdk acknowledge' +alias cdkver='cdk --version'