3 releases
| 0.1.2 | Jul 13, 2025 |
|---|---|
| 0.1.1 | Jul 13, 2025 |
| 0.1.0 | Jul 12, 2025 |
#468 in Development tools
63 downloads per month
220KB
4.5K
SLoC
alman - Intelligent Alias Manager
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.
🎨 Showcase
Watch alman in action! See how it can transform your command-line workflow with intelligent alias suggestions and intuitive management.
🚀 Installation
[!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.
Universal Install Script
The easiest way to install alman on any system:
curl -sSfL https://raw.githubusercontent.com/vaibhav-mattoo/alman/main/install.sh | sh
This script will automatically detect your system and install the appropriate binary.
[!NOTE] Remember to add
~/.local/binto your$PATHif prompted by the install script, by addingexport PATH="$HOME/.local/bin:$PATH"in the end of your shell config (~/.bashrc, ~/.zshrc etc).
From Cargo
cargo install alman
From AUR (Arch Linux)
Using yay:
yay -S alman
Using paru:
paru -S alman
From Source
git clone https://github.com/vaibhav-mattoo/alman.git
cd alman
cargo install --path .
⚙️ Shell Configuration
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.
Bash
Add this line to your ~/.bashrc:
eval "$(alman init bash)"
Then reload your configuration:
source ~/.bashrc
Zsh
Add this line to your ~/.zshrc:
eval "$(alman init zsh)"
Then reload your configuration:
source ~/.zshrc
Fish
Add this line to your ~/.config/fish/config.fish:
alman init fish | source
Then reload your configuration:
source ~/.config/fish/config.fish
[!TIP] Alman automatically initializes with your shell history when first run, so you'll have intelligent suggestions right from the start!
📋 Table of Contents
- 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
🚀 Quick Start
Interactive Mode
Launch the interactive alias manager:
alman
# or
alman tui
Navigate with arrow keys or jk, select aliases, and manage them interactively.
Command Line Mode
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 10
🖥️ Interactive Mode
The Terminal User Interface (TUI) provides an intuitive way to browse, add, remove, and change aliases:
Navigation
- Arrow keys or jk: Move cursor
- Enter: Select
- a: Add alias
- r: Remove alias
- l: List aliases
- q or Ctrl+C: Quit
TUI Features
- Visual selection: Selected items are highlighted
- Alias suggestions: Get smart suggestions based on your command history
- Multi-file support: Manage aliases across multiple files
💻 Command Line Usage
Basic Commands
# 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
📝 Usage Examples
Basic Usage
# 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
Advanced Usage
# 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" h
[!IMPORTANT] After running
alman change old newand sourcing your aliases, only the new alias will work. The old alias will be completely removed from all managed alias files.
🔧 Advanced Usage
Multi-file Management
# 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
Suggestion Management
# Get more suggestions
alman get-suggestions -n 10
# Delete a specific suggestion
alman delete-suggestion gs
🎮 TUI Navigation
The 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!
Key Bindings
- 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
Features
- Visual feedback: Selected items are highlighted
- Smart suggestions: Get intelligent alias suggestions
- Multi-file support: Manage aliases across different files
⚙️ Command Line Options
Output Options
-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
Examples
# 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 10
📊 Output Format
Alman displays aliases in a clear, tabular format:
┌─────────┬───────────────┐
│ ALIAS │ COMMAND │
├─────────┼───────────────┤
│ gs │ git status │
│ ll │ ls -la │
└─────────┴───────────────┘
🧠 Ranking Algorithm
Alman uses a sophisticated scoring algorithm to rank commands based on three key factors:
Scoring Formula
Score = Time Multiplier × Length^(3/5) × Frequency
Time-Based Multipliers
- ≤ 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)
Factors Explained
- 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!
🎯 Alias Suggestion Schemes
Alman employs multiple intelligent schemes to generate meaningful alias suggestions:
Vowel Removal
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
First Letter Combination
Combines first letter of first word and rest:
git status→gstatusdocker compose→dcomposesystemctl status→sstatus
Smart Truncation
Truncates long commands intelligently:
git checkout→gcodocker build→dbnpm run dev→nrd
Prefix Matching
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.
🎯 Use Cases
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 5
[!TIP] Try the interactive TUI mode (
alman tui) for the most intuitive alias management experience!
🗑️ Uninstallation
To uninstall alman, you can run the command:
curl -sSfL https://raw.githubusercontent.com/vaibhav-mattoo/alman/main/uninstall.sh | sh
Or 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.sh
[!NOTE] 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)
📄 License
MIT License - see LICENSE file for details.
Dependencies
~9–23MB
~291K SLoC