Skip to content

KurtWeston/alias-suggest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alias-suggest

Analyze your shell history to automatically suggest useful aliases for frequently typed commands

Features

  • 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

How to Use

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

Installation

# Clone the repository
git clone https://github.com/KurtWeston/alias-suggest.git
cd alias-suggest

# Install dependencies
pip install -r requirements.txt

Usage

python main.py

Built With

  • python using click

Dependencies

  • click>=8.0.0
  • pytest>=7.0.0
  • pytest-cov>=4.0.0

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Analyze your shell history to automatically suggest useful aliases for frequently typed commands

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages