Useful CLI Aliases for Frontend Developers

Roman Meshcheriakov
2 min readJul 1, 2021

Hi! 👋 My name is Roman, and I am a Frontend Developer (claps-claps 👏).

Sometimes we need to do something very quickly and often with CLI. For example: delete `node_modules` and install again and again…

rm -rf node_modules => yarn => yarn start => rm -rf node_modules and again… 😢

So, after several thousand times of these commands entered into the terminal, I used to be thinking about simplifying these.

And these have been simplified with Aliases! 😃

Simple aliases are a short form of a long command. To set up a simple alias, edit the ~/.zshrc file using your text editor and add an alias at the bottom, e.g. with nano ~/.zshrc.

My simple aliases

  1. repack

Target: Use for re-installing node_modules

Command:

2. mgif

Target: Use for creating a GIF from the local video file (e.g. a screen recording for a PR description)

Notice: First you need to install https://ffmpeg.org/

Command:

How to add these commands to the terminal

  1. Create OR save these files to the home directory (~/)
  2. Add the alias to .zshrc file like this (nano ~/.zshrc)

# my aliases
alias repack=’bash “${HOME}/repack.sh”’
alias mgif=’bash “${HOME}/video-to-gif.sh”’

3. Restart the terminal

Congratulations! 🎉 Now you can use your own aliases into the terminal!

Happy hacking! 😊

--

--