DEV Community

Cover image for πŸš€ Stop Typing Long Terminal Commands. Use Aliases Instead
Aditya
Aditya

Posted on

πŸš€ Stop Typing Long Terminal Commands. Use Aliases Instead

As developers, we optimize APIs, databases, and smart contracts.

But we rarely optimize our own workflow.

I realized I was typing the same commands every single day:

  • npm run dev
  • git add .
  • git commit -m "message"
  • git push
  • docker compose up --build
  • npx hardhat test
  • forge build

It seems small.

But friction compounds.

So I reduced it.


🧠 What Are Shell Aliases?

Aliases are shortcuts you define in your shell (bash or zsh) that map short commands to longer ones.

Instead of typing:

npm run dev
Enter fullscreen mode Exit fullscreen mode

You type:

nd
Enter fullscreen mode Exit fullscreen mode

Same result. Less friction.


πŸ›  Step 1: Open Your Shell Config

If you’re using:

Zsh (Mac / Linux default nowadays)

nano ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

Bash

nano ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

✍ Step 2: Add Aliases

Here are some practical ones for Full-Stack + Web3 developers:

# πŸ“¦ NPM
alias nd="npm run dev"
alias nb="npm run build"
alias ni="npm install"

# 🌿 Git
alias gs="git status"
alias ga="git add ."
alias gc="git commit -m"
alias gp="git push"
alias gpl="git pull"
alias gcb="git checkout -b"
alias gl="git log --oneline"

# 🐳 Docker
alias dcu="docker compose up"
alias dcub="docker compose up --build"
alias dcd="docker compose down"
alias dps="docker ps"

# πŸ” Hardhat
alias hhc="npx hardhat compile"
alias hht="npx hardhat test"
alias hhn="npx hardhat node"

# βš’ Forge
alias fb="forge build"
alias ft="forge test"
Enter fullscreen mode Exit fullscreen mode

Save the file.

Then reload:

source ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

(Or source ~/.bashrc)

Done.


πŸ”₯ Real Before vs After

Before

git add .
git commit -m "fix: JWT verification bug"
git push
Enter fullscreen mode Exit fullscreen mode

After

ga
gc "fix: JWT verification bug"
gp
Enter fullscreen mode Exit fullscreen mode

Before

docker compose up --build
Enter fullscreen mode Exit fullscreen mode

After

dcub
Enter fullscreen mode Exit fullscreen mode

Before

git checkout -b feature/jwt-auth
Enter fullscreen mode Exit fullscreen mode

After

gcb feature/jwt-auth
Enter fullscreen mode Exit fullscreen mode

⚑ Level 2: Combine Commands

You can even chain commands:

alias gacp="git add . && git commit -m"
Enter fullscreen mode Exit fullscreen mode

Now:

gacp "feat: add middleware"
gp
Enter fullscreen mode Exit fullscreen mode

One step closer to flow state.


🎯 Why This Matters

This isn’t about saving 3 seconds.

It’s about reducing cognitive load.

When friction decreases:

  • You stay in flow longer
  • You ship faster
  • You feel less drained

Most developers try to optimize performance.

Few optimize themselves.


🧩 Bonus: Modern Git Alternative

Instead of:

git checkout -b feature/auth
Enter fullscreen mode Exit fullscreen mode

You can use:

git switch -c feature/auth
Enter fullscreen mode Exit fullscreen mode

And alias it:

alias gsw="git switch -c"
Enter fullscreen mode Exit fullscreen mode

πŸ’­ Final Thought

Productivity isn’t about working more hours.

It’s about removing unnecessary resistance from your system.

If you’re a developer:

What’s one shortcut you can’t live without?

Top comments (0)