A structured, metadata-aware superset of shell alias that exports real aliases with deterministic, reversible metadata.
Use the install script (it downloads the core files and updates your shell rc):
curl -fsSL https://raw.githubusercontent.com/monkeymonk/alx/main/install.sh | bashWhat the installer does:
- Installs
alxto~/.local/share/alx/bin/alx. - Installs
lib/*.shto~/.local/share/alx/lib/. - Adds
~/.local/share/alx/binto your PATH in your shell rc file.
To uninstall, remove the PATH line from your rc file and delete ~/.local/share/alx/.
If you prefer manual install, add bin/alx to your PATH.
Add aliases:
alx gs="git status"
alx ll="ls -lah" --desc "Long listing" --tags core,filesystemExplicit form:
alx add gs "git status" --desc "Git status" --tags gitBy default, alx add is idempotent: if the alias already exists in the registry, it is a no-op. Use --strict to warn on existing aliases, or --force to overwrite.
Export to your shell:
eval "$(alx export --shell)"Immediate mode:
eval "$(alx --immediate gs='git status')"List, show, search:
alx list
alx list --table
alx show gs
alx search gitHelp:
alx helpImport and export:
alx export --shell > aliases.sh
alx import aliases.sh
alias | alx import - # import current shell aliases via stdin
alx import --shell # import from ~/.bashrc, ~/.zshrc, etc.Interactive picker:
alx pick
alx pick --execFZF search (custom):
alx falx 'eval "$(alx list | fzf --delimiter=$'\''\t'\'' --with-nth=1,2,3 | cut -f1)"' --desc "Fuzy search and execute alias" --tags "alias,fuzzy"alx stores aliases as structured data, detects conflicts, and exports deterministic native aliases. It augments alias rather than replacing it.
Add to your ~/.bashrc or ~/.zshrc:
eval "$(alx export --shell)"This wrapper intercepts alias name='cmd' calls, stores them in alx, and defines the real shell alias. Plain alias (no args) and alias name (lookup) work unchanged.
# Load alx aliases
eval "$(alx export --shell)"
# Intercept alias definitions so they persist in alx
alias() {
if [[ $# -eq 0 ]]; then
builtin alias
elif [[ "$1" == -* ]]; then
builtin alias "$@"
elif [[ "$1" == *=* ]]; then
local name="${1%%=*}" cmd="${1#*=}"
alx add "$name" "$cmd" --force 2>/dev/null
builtin alias "$@"
else
builtin alias "$@"
fi
}With this, every alias gs='git status' you run also saves to alx. Remove the wrapper anytime — your shell aliases still work normally.
# Import aliases from your current shell session
alias | alx import -
# Or scan your rc files directly
alx import --shellAliases are stored as one file per alias in:
$XDG_CONFIG_HOME/alx/aliases/- fallback:
~/.config/alx/aliases/
To clear all stored aliases:
rm -rf ~/.config/alx/aliases- Bash 4+ or Zsh 5+
MIT
