CLI tool to manage shell aliases from a single, versionable TOML file, written in Rust 🦀. It keeps aliases grouped, toggled, and synchronized with your shell so you can avoid hand-editing scattered alias definitions.
- Store aliases in
~/.config/aliasmgr/aliases.toml(or a custom path) with optional groups. - Add, move, list, and remove aliases; mark groups or aliases as disabled.
- Generate shell-ready alias changes on demand with
aliasmgr sync. - Track the last synced catalog so aliasmgr removes stale managed aliases without clearing unrelated shell aliases.
- Zsh-only global aliases (
alias -g) support.
cargo install aliasmgr
brew install faria22/homebrew-tap/aliasmgr
- Initialize in your shell rc file so aliasmgr can sync on startup and know which shell you use:
- Bash:
eval "$(aliasmgr init bash)" - Zsh:
eval "$(aliasmgr init zsh)"
- Bash:
- Custom catalog location:
aliasmgr init zsh --catalog ~/.aliases.toml- This sets
ALIASMGR_CATALOG_PATHso subsequent commands use that file.
- This sets
- The init script also exports
ALIASMGR_SHELLand defines a wrapper function that applies alias deltas returned on file descriptor 3. - Advanced: set
ALIASMGR_LAST_SYNCED_CATALOG_PATHto customize where aliasmgr stores the last synced catalog snapshot.
- Default path:
~/.config/aliasmgr/aliases.toml(XDG config home). - Last synced snapshot path:
~/.local/state/aliasmgr/last_synced_catalog.toml(XDG state home). - Format supports top-level aliases and grouped aliases. Disabled or global aliases use the detailed form.
- Order of groups and aliases matches the catalog file; new items are appended to the bottom.
- When aliasmgr rewrites the catalog, extra whitespace (including blank lines) is removed.
py = "python3" # enabled by default
js = { command = "node", enabled = false } # disabled
x = { command = "xargs", global = true } # global alias (zsh only)
[git] # group name
ga = "git add"
gc = { command = "git commit", enabled = true }
[misc]
enabled = false # disable entire group
ll = { command = "ls -la", enabled = true }aliasmgr add alias <name> <command> [--group <group>] [--disabled] [--global]aliasmgr add group <name> [--disabled]aliasmgr move <name> [group]aliasmgr list [<pattern>] [--group [group]] [--enabled] [--disabled] [--global]aliasmgr remove alias <name>aliasmgr remove group <name> [--reassign]aliasmgr remove allaliasmgr rename alias <old_name> <new_name>aliasmgr rename group <old_name> <new_name>aliasmgr edit <name> <new_command> [--group [group]] [--toggle_enabled] [--toggle_global]aliasmgr syncaliasmgr sort aliases [--group [group]]aliasmgr sort groupsaliasmgr enable alias <name>aliasmgr enable group <name>aliasmgr disable alias <name>aliasmgr disable group <name>
For more details, use the -h or --help flags.
Notes:
- Alias names cannot contain whitespace or
=. - Global aliases (
--global) only work on zsh; they are skipped on other shells.
aliasmgr synccompares the current catalog with the last synced catalog snapshot.- Aliases that existed in the last synced snapshot are removed with targeted
unalias '<name>'commands before the current enabled aliases are added back. - This avoids
unalias -a, so aliases you maintain outside aliasmgr are not cleared by sync. - Disabled groups, disabled aliases, invalid alias names, and zsh global aliases in non-zsh shells are skipped when generating shell commands.
- The catalog and last synced snapshot are saved after commands that change aliases or groups, so new terminals can remove aliases that were renamed, disabled, moved out of scope, or deleted in another shell.
- Run
aliasmgr syncafter manually editing the catalog file without using aliasmgr commands, and after changes made in one terminal when you have multiple shells open.
- Run tests:
cargo test - Format:
cargo fmt - Lint:
cargo clippy - Release: use
cargo publishto bump the crate version and publish to crates.io.