aliasx
Safe, modular shell aliases for bash and zsh on Linux and macOS. 502 aliases and functions in 25 modules.
Install
git clone https://github.com/bakhod1r/aliasx ~/.aliasx ~/.aliasx/install.sh
install.sh adds one line to ~/.bashrc and ~/.zshrc. Running it again changes nothing. Open a new shell.
oh-my-zsh: clone into $ZSH_CUSTOM/plugins/aliasx and add aliasx to plugins=(...).
Profiles
export ALIASX_PROFILE=backend # devops, sysadmin, minimal; combine: "backend devops" aliasx profiles # what each profile loads
Your own aliases
aliasx add deploy './scripts/deploy.sh --prod' "deploy to production" aliasx mine aliasx rm deploy
Saved in ~/.aliasx.local.sh, loaded last, with hints and search like built-in ones.
Configure
export ALIASX_DISABLE="docker k8s" # skip default modules export ALIASX_ENABLE="modern dangerous" # load opt-in modules
Set these before the aliasx line in your rc file.
Inspect
aliasx modules # list modules aliasx list git # aliases in one module aliasx check gs k tf # is a name taken? aliasx conflicts # names that hide programs or clash with your rc files aliasx doctor # version, shell, profile, install state aliasx update # pull the latest version aliasx why lni # lni → ln -i · link, ask before overwriting
Hints
Type an aliasx name and press Space: zsh shows what it does under the prompt.
$ lni █ lni → ln -i · link, ask before overwriting
Don't know the name? Type a word like port and press Space: related commands are listed.
$ port █ related commands: ports [PORT] · listening TCP ports, or who listens on PORT freeport PORT · kill what listens on PORT after y/N waitport HOST PORT [SEC] · wait until PORT accepts connections
Same in any shell: aliasx find port. Turn lists off with ALIASX_FIND=0.
bash 4+ prints the hint above the prompt. bash 3 (macOS default) has no live hook; use aliasx why.
Safe mode
aliasx mode safe # rm lists targets and asks [Y/n] aliasx mode normal # plain rm aliasx mode # show current mode export ALIASX_MODE=safe # keep it on (put in rc before aliasx)
Rules
- Tool modules load only when the tool is installed (
has docker,has kubectl…). - Standard commands (
cp,mv,rm,cat,top,ping) are never replaced by default. Safe variants get new names:cpi,mvi,rmi. - Destructive actions show what they will touch and ask first. Bulk deletes live in the opt-in dangerous module and need a typed phrase.
- No implicit
sudooutside package and power commands. No-yon upgrades. - One meaning per name:
his history, Helm useshm; Rust usescargo-*; pnpm usespn*.
Modules
| Module | Covers | Count |
|---|---|---|
| Core | Core: helpers, terminal and the aliasx command. Always loaded. | 20 |
| Hints | Hints: typing an aliasx name then Space shows what it does. | 2 |
| Completion | Tab completion for the aliasx command. | 1 |
| Navigation | Navigation and listing. | 17 |
| Files | Files: safe operations, search, disk, archives, history. | 39 |
| Git | Git and GitHub CLI. | 58 |
| Docker | Docker and Docker Compose. | 30 |
| Podman | Podman (pd*): same shape as the docker module. | 21 |
| Kubernetes | Kubernetes and Helm. | 49 |
| Infrastructure | Infrastructure as code: Terraform, OpenTofu, Ansible. | 21 |
| DevOps | DevOps: retries, tunnels, certificates, DNS, cron, logs. | 9 |
| Sysadmin | Sysadmin: users, logins, services, disk hogs, kernel messages. | 14 |
| Network | Networking and HTTP. | 11 |
| System | System: processes, services, packages, macOS. | 54 |
| Development | Development: Node, Python (uv, poetry), PHP, Ruby, .NET, Go, Rust, Java, TLS. | 57 |
| Backend & API | Backend and API work: HTTP calls, timing, JWT, ports, keys, certs. | 12 |
| Databases | Databases: PostgreSQL (pg*), MySQL (my*), Redis (r*), MongoDB. | 25 |
| nginx | nginx: test, reload, logs. Config is always tested before reload/restart. | 9 |
| SSH & tmux | Remote work: ssh and tmux. | 9 |
| Utilities | Utilities: passwords, ids, time, encoding, quick checks. | 13 |
| .env files | .env files: insert or update KEY=VALUE without opening an editor. | 4 |
| Cloud | Cloud CLIs: read-only identity and listing only. | 7 |
| Modern tools | Modern CLI tools that add new names only (never replace standard commands). | 6 |
| Modern replacements opt-in | Opt-in: replace standard commands with modern tools. | 9 |
| Dangerous helpers opt-in | Opt-in: destructive helpers. Each one shows targets and asks for a phrase. | 5 |
Uninstall
~/.aliasx/install.sh --uninstall