DEV Community

Cover image for Stop Treating Your ~/.bashrc Like a Junk Drawer — Meet aliashub 🎨
Fedya Serafiev
Fedya Serafiev

Posted on Edited on Originally published at linuxdevops.dev

Stop Treating Your ~/.bashrc Like a Junk Drawer — Meet aliashub 🎨

If you are anything like me, your ~/.bashrc has grown into a museum of shell history: 200 lines of aliases, half of them broken, three different ones named g, and at least one you are genuinely afraid to touch because you don't remember what depends on it.

And then comes the real horror story. Mine did — the day I added an alias containing a single apostrophe. A tiny quoting mistake, one echo with an unmatched ', and my whole aliases file stopped loading. Every terminal opened with a syntax error, and I had to reconstruct the file from memory. 🙃

That's why I built aliashub — a small but obsessive alias manager that treats your aliases like first-class citizens instead of text lines. In this post I'll show you what it does, how it stays safe, and why a terminal tool ended up speaking Bulgarian. 🇧🇬

GitHub logo fedya-dev / aliashub

The alias manager for Bash & Zsh — colorful interactive menu, full CLI, categories & tags

aliashub — алиас мениджър за Bash и Zsh / alias manager for Bash & Zsh

🎨 aliashub

Алиас мениджърът на Федя — за Bash и Zsh The alias manager for Bash & Zsh — colorful interactive menu, full CLI, categories & tags

Version License Shell Zsh Platform i18n

🇧🇬 Български · 🇬🇧 English


🇧🇬 Български

aliashub пази всички твои shell алиаси в един файл (~/.fedya_aliases) и дава два начина за работа с тях: цветно интерактивно меню за ежедневната работа в терминала и CLI подкоманди (aliashub add …, aliashub rm …) за скриптове и навик „като git". Всичко, което записва, е валиден Bash и Zsh код — дори команди с апострофи, кавички, |, $ и обратни кавички се записват безопасно.

Файлът си остава твой: може да съдържа собствени функции (вкл. с имена на кирилица), if блокове, export-и и коментари — aliashub управлява само алиас-редовете и не пипа нищо друго. Преди всяка промяна се прави автоматичен backup, имената се валидират, дубликатите се отхвърлят, а doctor следи дали…

🧠 The idea: one file, two interfaces

aliashub keeps all your aliases in a single file (~/.fedya_aliases by default) and gives you two ways to work with them:

  • a colorful interactive menu for everyday terminal life, and
  • a full CLI (aliashub add, aliashub rm, aliashub list…) with predictable names and exit codes, for scripts and for the git-style muscle memory.

The file stays 100% yours. It is plain shell code — you can keep your own functions (Cyrillic names included), if blocks, exports and comments in it. aliashub only manages the alias lines and never touches anything else. Everything it writes is valid Bash and Zsh code.

aliashub interactive menu

🚀 Getting started

git clone https://github.com/fedya-dev/aliashub.git
cd aliashub
./install.sh        # → ~/.local/bin, auto-loading in .bashrc/.zshrc, doctor check
Enter fullscreen mode Exit fullscreen mode

No dependencies beyond Bash 3.2+ (Linux, macOS, WSL). fzf is optional — if it's present, search becomes an interactive picker.

aliashub                        # the interactive menu
aliashub add gs 'git status -sb'
aliashub add psgrep 'ps aux | grep -i '   # pipes? no problem
aliashub add .. 'cd ..'                   # dots and dashes too
aliashub add списък 'ls -la'              # yes, Cyrillic names work
aliashub list                             # browse everything
Enter fullscreen mode Exit fullscreen mode

After add, the alias is alive in every new terminal. In the current one, just source ~/.fedya_aliases.

🏷️ Tags & categories — my favorite part

Every alias can have one category and many tags. The metadata is stored as a comment line right above the alias, so the file remains clean, valid shell code you could cat into any shell:

# @aliashub tags=ssh,server category=админ
alias srv='ssh root@srv'
Enter fullscreen mode Exit fullscreen mode

And the CLI speaks it fluently:

aliashub add srv 'ssh root@srv' --category админ --tags ssh,server
aliashub tag srv net,tunnel        # replace tags
aliashub list --tag ssh            # only aliases tagged ssh
aliashub list --category админ     # only one category
aliashub list -g                   # grouped overview
aliashub stats                     # per-category statistics
aliashub search ssh                # searches names, commands AND tags
Enter fullscreen mode Exit fullscreen mode

aliashub list -g grouped by category with tags

The menu has a dedicated [10] Categories & tags screen too — pick a tag, see the matching aliases, choose an action. It's the closest a dotfile gets to a tag system without becoming a database.

🛡️ The paranoia section: it won't let you break your file

Remember the apostrophe story? This is the part built in response to it:

  • Automatic backup before every change — add, remove, rename, tag, restore, everything. Keeps the last 50, oldest ones pruned.
  • Real syntax validation — check runs bash -n against your file, detects duplicates, unquoted values and broken metadata. No false alarms: your own functions and comments are not "problems".
  • Safe quoting — commands with ', ", |, $, backticks are stored correctly. The file can't be corrupted by an awkward command, because the writer refuses to write invalid lines.
  • doctor — a health check for the whole setup: aliases file, syntax, loading in .bashrc/.zshrc, editor, fzf, backup folder, language.

aliashub doctor — all green

aliashub check      # validate the file
aliashub doctor     # validate the whole environment
aliashub backup && aliashub backups && aliashub restore last   # full control
Enter fullscreen mode Exit fullscreen mode

Exit codes are boring on purpose: 0 success, 1 operation error, 2 usage error. Perfect for scripting.

🇧🇬 A terminal tool that speaks your language

I wanted the tool to feel native to people who think in Bulgarian — so the whole interface is bilingual (bg/en), switchable without restarting anything:

aliashub lang        # current language
aliashub lang en     # switch, persisted in ~/.config/aliashub/config
LANG=en aliashub list   # one-off override
Enter fullscreen mode Exit fullscreen mode

This also shaped a design decision: names like .., ..., git-status or списък are all valid aliases — anything Bash accepts, aliashub accepts. The validator only rejects characters that would actually break the line.

⌨️ Under the hood

A few things I care about more than features:

  • Zero dependencies — one Bash script, ~2000 lines, readable and hackable. No Python, no Node, no config database.
  • NO_COLOR respected (no-color.org standard), plus a --no-color flag.
  • Runs under Bash always — if you start it from sh/zsh/dash, it re-executes itself under Bash, so behavior is identical everywhere.
  • Painless migration — upgrading from my earlier tool aliasctl? ./install.sh upgrades the rc-blocks, moves the backups and keeps the old ALIASCTL_* variables working.

🗺️ Try it & tell me what's missing

The repo has a full bilingual README (🇬🇧 + 🇧🇬), screenshots and a step-by-step upload guide if you want to peek at the code:

👉 https://github.com/fedya-dev/aliashub

If you speak Bulgarian, my site is fedia.eu — more tools are coming there.

What's your alias hygiene like? Do you keep them in .bashrc, a separate file, or do you use something fancier (zoxide, atuin, fzf-tab…)? And would tags/categories change how you organize them? Drop a comment — bug reports and PRs are very welcome too. 🚀

Top comments (0)