Skip to content

Axelvazslima/bashrc-alias-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Alias Manager

Alias Manager is a Python script that helps you efficiently manage command-line aliases in your ~/.bashrc file. It organizes aliases into groups (e.g., Git commands, Docker commands, etc.), preventing duplication and ensuring better readability by maintaining an auto-generated section.

Features

  • Group-based Alias Management: Adds aliases in categorized sections.
  • Avoids Duplicates: Ensures that existing aliases are not duplicated.
  • Auto-Generated Section: Keeps aliases structured under a dedicated marker.
  • Interactive Menu: Allows users to easily add, list, and create custom aliases.

Installation

  1. Clone this repository:

    git clone https://github.com/yourusername/alias-manager.git
    cd alias-manager
  2. Make sure you have Python installed (Python 3 recommended).

  3. Run the script:

    python3 alias_manager.py

Usage

When running the script, you will be presented with an interactive menu:

  1. Add aliases from predefined groups: Choose from main commands, Git commands, and Docker commands.
  2. Create custom alias: Define a new alias and command manually.
  3. List all aliases: View existing aliases in ~/.bashrc.
  4. Exit: Quit the script.

Example Alias Groups

Main Commands:

alias l='ls'
alias cl='clear'

Git Commands:

alias gst='git status'
alias ga='git add'

Docker Commands:

alias dps='docker ps'
alias dc='docker container'

How It Works

  • The script first checks for a special marker in ~/.bashrc:
    -----AUTO GENERATED BY AV PYTHON SCRIPT -----
  • If the marker doesn’t exist, it adds one.
  • When adding aliases, the script organizes them under sections like:
    -----MAIN COMMANDS-----
    alias l='ls'
    alias cl='clear'
  • Custom aliases can be manually added through the menu.

Contributing

If you'd like to improve or extend this script, feel free to fork the repository and submit a pull request.

License

This project is open-source and available under the MIT License.

Author

Developed by me.

About

Unix .bashrc alias manager using Python.

Topics

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages