A command-line tool and TUI for managing shell aliases with intelligent suggestions based on your command history. Alman helps you organize, create, and manage aliases across multiple files and shells, making your workflow faster and smarter.
Watch alman in action! See how it can transform your command-line workflow with intelligent alias suggestions and intuitive management.
alman_demo.mp4
Important
Shell Configuration Required: After installation, you must add the shell configuration line to your shell config file (check with which $SHELL) or the app will not work. See the Shell Configuration section below for detailed instructions.
The easiest way to install alman on any system:
curl -sSfL https://raw.githubusercontent.com/vaibhav-mattoo/alman/main/install.sh | shThis script will automatically detect your system and install the appropriate binary.
Note
Remember to add ~/.local/bin to your $PATH if prompted by the install script, by adding export PATH="$HOME/.local/bin:$PATH" in the end of your shell config (~/.bashrc, ~/.zshrc etc).
cargo install almanbrew tap vaibhav-mattoo/alman
brew install almanUsing yay:
yay -S almanUsing paru:
paru -S almangit clone https://github.com/vaibhav-mattoo/alman.git
cd alman
cargo install --path .After installation, you need to configure your shell to use alman. The installer will detect your shell and provide specific instructions, but here are the general steps:
Note
The installer will automatically detect your shell and show you the exact configuration line to add to your shell config file.
Add this line to your ~/.bashrc:
eval "$(alman init bash)"Then reload your configuration:
source ~/.bashrcAdd this line to your ~/.zshrc:
eval "$(alman init zsh)"Then reload your configuration:
source ~/.zshrcAdd this line to your ~/.config/fish/config.fish:
alman init fish | sourceThen reload your configuration:
source ~/.config/fish/config.fishTip
Alman automatically initializes with your shell history when first run, so you'll have intelligent suggestions right from the start!
- Showcase
- Installation
- Shell Configuration
- Quick Start
- Interactive Mode
- Command Line Usage
- Usage Examples
- Advanced Usage
- TUI Navigation
- Command Line Options
- Output Format
- Ranking Algorithm
- Alias Suggestion Schemes
- Use Cases
- Uninstallation
- License
Launch the interactive alias manager:
alman
# or
alman tuiNavigate with arrow keys or jk, select aliases, and manage them interactively.
Add, remove, list, and get suggestions for aliases directly from the command line:
# Add an alias
alman add -c "git status" gs
# Remove an alias
alman remove gs
# List all aliases
alman list
# Get alias suggestions
alman get-suggestions -n 10The Terminal User Interface (TUI) provides an intuitive way to browse, add, remove, and change aliases:
- Arrow keys or jk: Move cursor
- Enter: Select
- a: Add alias
- r: Remove alias
- l: List aliases
- q or Ctrl+C: Quit
- Visual selection: Selected items are highlighted
- Alias suggestions: Get smart suggestions based on your command history
- Multi-file support: Manage aliases across multiple files
# Add a new alias
alman add -c "ls -la" ll
# Remove an alias
alman remove ll
# List all aliases
alman list
# Get intelligent suggestions
alman get-suggestions -n 5# Add a new alias
alman add -c "ls -la" ll
# Remove an alias
alman remove ll
# List all aliases
alman list
# Get intelligent suggestions
alman get-suggestions -n 5# Change an alias name (keeps the same command)
alman change old-alias new-alias
# Delete suggestions for an alias
alman delete-suggestion gs
# Use a specific alias file
alman --alias-file-path ~/.my-aliases add -c "htop" hImportant
After running alman change old new and sourcing your aliases, only the new alias will work. The old alias will be completely removed from all managed alias files.
# Add alias to a specific file
alman --alias-file-path ~/.bash_aliases add -c "ls -lh" lh
# List aliases from a specific file
alman --alias-file-path ~/.zsh_aliases list# Get more suggestions
alman get-suggestions -n 10
# Delete a specific suggestion
alman delete-suggestion gsThe Terminal User Interface provides an intuitive way to manage aliases:
Tip
The TUI mode is perfect for browsing your command history and discovering new alias opportunities!
- Arrow keys or jk: Navigate through aliases
- Enter: Select an alias or action
- a: Add a new alias
- r: Remove selected alias
- l: List all aliases
- q or Ctrl+C: Exit the interface
- Visual feedback: Selected items are highlighted
- Smart suggestions: Get intelligent alias suggestions
- Multi-file support: Manage aliases across different files
-c, --command <COMMAND>: Command to associate with the alias (foraddandchange)-n, --num <N>: Number of suggestions to display (forget-suggestions)--alias-file-path <PATH>: Path to the alias file to use
# Add an alias to a specific file
alman --alias-file-path ~/.bash_aliases add -c "ls -lh" lh
# Get 10 suggestions
alman get-suggestions -n 10Alman displays aliases in a clear, tabular format:
โโโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โ ALIAS โ COMMAND โ
โโโโโโโโโโโผโโโโโโโโโโโโโโโโค
โ gs โ git status โ
โ ll โ ls -la โ
โโโโโโโโโโโดโโโโโโโโโโโโโโโโ
Alman uses a sophisticated scoring algorithm to rank commands based on three key factors:
Score = Time Multiplier ร Length^(3/5) ร Frequency
- โค 1 hour: 4.0ร (recent commands get highest priority)
- โค 1 day: 2.0ร (recent commands)
- โค 1 week: 0.5ร (older commands)
- > 1 week: 0.25ร (very old commands)
- Recency: Recently used commands score higher, encouraging current workflow patterns
- Frequency: More frequently used commands get higher scores
- Length: Longer commands get slightly higher scores (using length^(3/5) to avoid excessive bias)
- Automatic Reset: When total score exceeds 70,000, all frequencies are reduced by 50% to prevent score inflation
Tip
The algorithm automatically adapts to your usage patterns, prioritizing commands you use most frequently and recently!
Alman employs multiple intelligent schemes to generate meaningful alias suggestions:
Removes vowels to create shorter, memorable aliases:
git statusโgst(removes 'i', 'a', 'u')docker psโdckr ps(removes 'o', 'e')
Abbreviation
Creates abbreviations from command words:
git pullโgpls -laโllnpm installโni
Combines first letter of first word and rest:
git statusโgstatusdocker composeโdcomposesystemctl statusโsstatus
Truncates long commands intelligently:
git checkoutโgcodocker buildโdbnpm run devโnrd
Suggests aliases based on common command prefixes:
gitcommands โg+ first letter of subcommanddockercommands โd+ first letter of subcommand
Note
Alman evaluates all these schemes and ranks suggestions by their effectiveness and memorability, ensuring you get the most useful aliases first.
Perfect for managing your shell aliases, discovering new shortcuts, and keeping your workflow efficient:
# Quick alias management
alman tui
# Add and remove aliases on the fly
alman add -c "git pull" gp
alman remove gp
# Get suggestions for new aliases
alman get-suggestions -n 5Tip
Try the interactive TUI mode (alman tui) for the most intuitive alias management experience!
To uninstall alman, you can run the command:
curl -sSfL https://raw.githubusercontent.com/vaibhav-mattoo/alman/main/uninstall.sh | shOr download and run the uninstall script manually:
curl -sSfL https://raw.githubusercontent.com/vaibhav-mattoo/alman/main/uninstall.sh -o uninstall.sh
chmod +x uninstall.sh
./uninstall.shNote
After uninstalling, remember to remove the shell configuration lines from your shell config files:
- From
~/.bashrc: Removeeval "$(alman init bash)" - From
~/.zshrc: Removeeval "$(alman init zsh)" - From
~/.config/fish/config.fish: Removeeval (alman init fish)
MIT License - see LICENSE file for details.