AWS-CLI Auto-Completion + FZF + OhMyZSH = ๐Ÿ’ช๐Ÿ’ช๐Ÿ’ช

Time to escape from AWS Web Console

Harry The Great
2 min readJan 6, 2020

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.

how to install

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 ohmyzsh
git 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

--

--

Harry The Great

Android & IOS Developer ๐Ÿ˜€ ๋ฏธ๋””์›€ ์ด์™ธ์— ์Šค๋‹ˆํŽซ์ด๋‚˜ ๋””๋ฒ„๊ทธ๋…ธํŠธ๋กœ ํ™œ์šฉํ•˜๋Š” https://www.harrymikoshi.com/ ๋ธ”๋กœ๊ทธ๋„ ์šด์˜ํ•˜๊ณ ์žˆ์Šต๋‹ˆ๋‹ค.