Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions plugins/cdk/README.md
Original file line number Diff line number Diff line change
@@ -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 |
12 changes: 12 additions & 0 deletions plugins/cdk/_cdk
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions plugins/cdk/cdk.plugin.zsh
Original file line number Diff line number Diff line change
@@ -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'
2 changes: 1 addition & 1 deletion plugins/tmux/tmux.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function _zsh_tmux_plugin_preexec()
local -a tmux_cmd
tmux_cmd=(command tmux)

eval $($tmux_cmd show-environment -s)
eval "$($tmux_cmd show-environment -s)"
}

# Use the completions for tmux for our function
Expand Down