AWS-CLI Auto-Completion + FZF + OhMyZSH = ๐ช๐ช๐ช
Time to escape from AWS Web Console
Pre-Requirement
OhMyZSH
OhMyZsh is zsh configuration package based on open-source. it already has a lot of configuration, so make it a lot easier to set up zsh. if you not use OhMyZSH you have to install manually some packages.
FZF
fzf is a powerful CLI finder. it can filters the lists any of matching character. also super fast!
using homebrew or check this link.
brew install fzf
AWS-CLI
yes, sure! you need aws-cli for executing commands
using homebrew or check this link.
brew install awscli
Configure Pre-installed ZSH Plugins
we need a few plugins to migrate above.
aws, fzf
oh-my-zsh already have pre-installed plugins in /.oh-my-zsh/plugins/ so you don't need to install above plugins. just open ~/.zshrc file, then add it. if not you have to download manually at ~/.oh-my-zsh/custom
......plugins=(... aws fzf )........
Configure Plugins Manually
zsh-completion
it is additional zshโs plugins for auto-completion. also better than Linuxโs one.
# it gonna be downloaded ~/.oh-my-zsh-custom/plugins directory
# also it is default plugin directory if you using ohmyzshgit clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions
after downloading the package, edit ~/.zshrc file like below
plugins=(โฆ aws fzf zsh-completions) # add in plugins list
autoload -U compinit && compinit //override comp
fzf-tab-completion
final step! already we enable auto-completion, we just connect auto-completion and fzf. fzf-tab-completion can do that.
# Download plugins
git clone https://github.com/lincheney/fzf-tab-completion.git ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/fzf-tab-completion
this plugin is not configured to ohmyzsh plugin style. so we use not in plugins brace but source command.
#then edit ~/.zsh file.
source $HOME/.oh-my-zsh/custom/plugins/fzf-tab-completion/zsh/fzf-zsh-completion.sh# only aws command completion
zstyle ':completion:*:*:aws' fzf-search-display true
# or for everything
zstyle ':completion:*' fzf-search-display true
Letโs See
it can makes it much easier to manage AWS and dramatically reduce the number of visiting web console