DEV Community

Cover image for aliasctl - Modern Bash Alias Manager with Beautiful UI
ITpraktika.com
ITpraktika.com

Posted on • Originally published at itpraktika.com

aliasctl - Modern Bash Alias Manager with Beautiful UI

If you work frequently in the terminal, you probably use bash aliases to shorten long commands. But managing them can be frustrating โ€“ editing .bashrc, searching through files, forgetting what you created last month...

aliasctl solves these problems with an elegant, colorful, and intuitive interface that makes alias management a pleasure, not a chore.

โœจ What Does It Offer?

Intuitive Interface

Forget about manually editing configuration files. aliasctl gives you a beautiful menu with clear options and a modern color palette that makes work enjoyable.

Core Features

๐Ÿ“‹ View Aliases โ€“ See all your aliases in an elegant table with color formatting. Each alias is clearly displayed with its name and corresponding command.

โž• Easy Addition โ€“ Create a new alias in seconds with an interactive dialog that guides you step by step.

๐Ÿ—‘๏ธ Quick Removal โ€“ Delete unnecessary aliases quickly and easily, without worrying about breaking anything.

โœ๏ธ Direct Editing โ€“ For advanced users, you can open the alias file directly in your favorite editor.

๐Ÿ” FZF Integration โ€“ If you have fzf installed, you get powerful fuzzy search through all your aliases in real-time.

๐Ÿ“– Built-in Help โ€“ Embedded documentation showing where aliases are stored and how to load them.

Why It's Different

  • Visual Appeal โ€“ Beautiful color scheme with box-drawing characters and emojis
  • Validation โ€“ Checks input data and prevents errors
  • Informative โ€“ Clear messages for every action
  • Safety โ€“ Cannot create two aliases with the same name
  • Convenience โ€“ Everything in one place, without opening multiple files

๐Ÿš€ Installation

Download and install the script with a single command:

wget https://gist.fedia.eu/urocibg/6a5335aab5a2461c9ffc84792c16e468/raw/HEAD/aliasctl
sudo mv aliasctl /usr/local/bin/aliasctl
sudo chmod +x /usr/local/bin/aliasctl
Enter fullscreen mode Exit fullscreen mode

Then simply type in your terminal:

aliasctl
Enter fullscreen mode Exit fullscreen mode

๐Ÿ’ก How It Works

aliasctl stores all your aliases in a separate file ~/.fedya_aliases. This keeps your .bashrc clean and organized.

To automatically load aliases every time you enter the terminal, add this line to your ~/.bashrc:

[ -f ~/.fedya_aliases ] && source ~/.fedya_aliases
Enter fullscreen mode Exit fullscreen mode

๐ŸŽฏ Who Is It For?

  • Beginners โ€“ who want an easy way to manage their aliases
  • Advanced Users โ€“ who appreciate good UX and automation
  • System Administrators โ€“ who work with multiple systems and want consistency
  • Developers โ€“ who use dozens of aliases every day

๐ŸŒŸ Usage Examples

Imagine you frequently use:

  • git status โ†’ create alias gs
  • docker-compose up -d โ†’ create alias dup
  • systemctl restart nginx โ†’ create alias rn

With aliasctl, creating, viewing, and managing these aliases takes seconds, not minutes.

Quick Start Guide

1. Launch aliasctl

aliasctl
Enter fullscreen mode Exit fullscreen mode

You'll be greeted with a beautiful menu:

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘   ๐Ÿš€ Bash Alias Manager v2.0      โ•‘
โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ
โ•‘  1๏ธโƒฃ  View all aliases             โ•‘
โ•‘  2๏ธโƒฃ  Add new alias                โ•‘
โ•‘  3๏ธโƒฃ  Remove alias                 โ•‘
โ•‘  4๏ธโƒฃ  Edit aliases file            โ•‘
โ•‘  5๏ธโƒฃ  Search aliases (FZF)         โ•‘
โ•‘  6๏ธโƒฃ  Help                         โ•‘
โ•‘  0๏ธโƒฃ  Exit                         โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
Enter fullscreen mode Exit fullscreen mode

2. Create Your First Alias

Select option 2 and follow the prompts:

Enter alias name: gs
Enter command: git status
โœ“ Alias 'gs' successfully created!
Enter fullscreen mode Exit fullscreen mode

3. View Your Aliases

Select option 1 to see a formatted table:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Alias    โ”‚ Command                 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ gs       โ”‚ git status              โ”‚
โ”‚ dup      โ”‚ docker-compose up -d    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
Enter fullscreen mode Exit fullscreen mode

4. Search with FZF (Optional)

If you have fzf installed, select option 5 for instant fuzzy search through all your aliases.

๐Ÿ“ฆ Requirements

  • Bash shell
  • Linux system (Fedora, Ubuntu, Debian, etc.)
  • Optional: fzf for fuzzy search

Advanced Features

Input Validation

aliasctl prevents common mistakes:

  • No duplicate alias names
  • No empty commands
  • No special characters that could break your shell

Automatic Backup

Before making any changes, aliasctl creates a backup of your aliases file, so you can always restore if something goes wrong.

Custom Editor Support

Use your preferred editor for direct editing:

export EDITOR=vim  # or nano, emacs, etc.
Enter fullscreen mode Exit fullscreen mode

๐Ÿ”ฎ Future Possibilities

The tool is under active development. Planned features:

  • Export/import aliases
  • Categorization and groups
  • Synchronization between machines
  • Backup and restore
  • Usage statistics

Real-World Workflow

Here's how aliasctl fits into your daily routine:

Morning:

# Check your aliases before starting work
aliasctl
# Select option 1 to review what you have
Enter fullscreen mode Exit fullscreen mode

During Work:

# Found a long command you use often?
aliasctl
# Select option 2, add it as an alias in seconds
Enter fullscreen mode Exit fullscreen mode

Code Review:

# Need to find that Docker alias?
aliasctl
# Select option 5 for FZF fuzzy search
Enter fullscreen mode Exit fullscreen mode

Common Alias Ideas

Get inspired by these popular aliases:

Git Shortcuts:

gs   โ†’ git status
ga   โ†’ git add .
gc   โ†’ git commit -m
gp   โ†’ git push
gl   โ†’ git log --oneline --graph
Enter fullscreen mode Exit fullscreen mode

Docker Management:

dps  โ†’ docker ps
dpa  โ†’ docker ps -a
dup  โ†’ docker-compose up -d
ddn  โ†’ docker-compose down
Enter fullscreen mode Exit fullscreen mode

System Administration:

ll   โ†’ ls -lah
ports โ†’ netstat -tulanp
myip  โ†’ curl ifconfig.me
Enter fullscreen mode Exit fullscreen mode

๐Ÿค Conclusion

aliasctl is more than a simple script โ€“ it's a tool that makes your daily terminal work more productive and enjoyable. The beautiful interface, easy usage, and powerful features make it an indispensable assistant for anyone working on the command line.

Try it today and see how a small tool can make a big difference!


๐Ÿ“– Read the full article in Bulgarian: aliasctl - ะœะพะดะตั€ะตะฝ ะผะตะฝะธะดะถัŠั€ ะทะฐ Bash ะฐะปะธะฐัะธ

If you found this helpful, check out more hands-on IT guides at itpraktika.com ๐Ÿš€


What's your favorite bash alias? Share in the comments! ๐Ÿ’ฌ

Top comments (0)