Analyze your shell history to automatically suggest useful aliases for frequently typed commands
- Parse bash history (
/.bash_history) and zsh history (/.zsh_history) files - Calculate command frequency and identify top repeated commands
- Detect long commands (configurable threshold, default 30+ chars) worth aliasing
- Score alias candidates based on frequency, length, and complexity
- Generate smart alias names using command keywords and common abbreviations
- Filter out commands with sensitive data (passwords, tokens, API keys)
- Show before/after comparison with estimated keystrokes saved
- Export aliases to stdout in shell-compatible format
- Support --min-frequency flag to filter suggestions
- Support --min-length flag to only suggest aliases for long commands
- Interactive mode to review and select which aliases to export
- Append mode to add suggestions directly to ~/.bashrc or ~/.zshrc
- Dry-run mode to preview suggestions without modifying files
Use this project when you need to:
- Quickly solve problems related to alias-suggest
- Integrate python functionality into your workflow
- Learn how python handles common patterns with click
# Clone the repository
git clone https://github.com/KurtWeston/alias-suggest.git
cd alias-suggest
# Install dependencies
pip install -r requirements.txtpython main.py- python using click
click>=8.0.0pytest>=7.0.0pytest-cov>=4.0.0
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.