topalias - Linux alias generator from bash/zsh command history with statistics, written on Python.

Overview

topalias

Test Status Coverage GitLab pipeline Python Version Downloads Code style: black Imports: isort DeepSource

topalias - Linux alias generator from bash/zsh command history with statistics, written on Python.

Features

  • Generate short alias for popular command from bash/zsh shell history
  • Command history statistics & analytics
  • Parametrised input
  • Console help for all commands, options and arguments
  • Shell workflow hints

Installation

From pypi.org repository:

pip3 install -U --user topalias

From source:

git clone https://github.com/CSRedRat/topalias
python3 topalias/setup.py install --user

Run as python script without install:

git clone https://github.com/CSRedRat/topalias
python3 topalias/topalias/cli.py -h

Install requirements

sudo apt install python3 python3-pip -y

Add PATH environment variable for run Python tools as Linux utility:

> ~/.bashrc source ~/.bashrc ">
echo "export PATH=$PATH:$HOME/.local/bin" >> ~/.bashrc
source ~/.bashrc

Usage

generated bash aliases

Without parameters utility check if you use alias in ~/.bash_aliases - analyze and print usage statistics, then find new simple aliases

python3 -m topalias  # run as python module
topalias  # check aliases and print suggestion bash command history
topalias -h  # print help
topalias --zsh  # work with zsh shell command history
topalias --min=2  # set minimal length for generated acronym filter, so that exclude some short command and find long, hard, usable command
topalias --debug history  # only analyze local bash history and print filtered rows

Files path search order:

  • directory from execution parameter
  • .bash_history in . current directory
  • .bash_history in ~ user home directory
  • example development files in topalias/data

You can change dot files search path to another user home directory:

topalias -f /home/user  # or topalias --path /home/user

Also you can use topalias utility in Bash for Git on Windows and in WSL.

Documentation

Usage: topalias [OPTIONS] COMMAND [ARGS]

Options:
  -l, --min INTEGER     Print alias acronym not less that value. Default: 1
  -c, --count INTEGER   Print specified number acronym suggestions. Default:
                        20

  --filter              Filter used aliases in history. Default: False
  -z, --zsh             Use zsh shell history file .zsh_history. Default:
                        False

  -f, --path TEXT       Change custom directory for files: .bash_aliases,
                        .bash_history, .zsh_history

  --version             Print current program version and check latest on
                        pypi.org.

  --debug / --no-debug  Enable debug strings in output.
  -h, --help            Show this message and exit.

Commands:
  hint     Print all hints.
  history  Print bash history file.
  version  Get program current and available version.

TODO

  • check if alias name already used
  • check if alias already added
  • add any another acronym algorithm with semantic
  • more statistics & analytics (used dir, utils, parameters, time)
  • alias max length parameter
  • command ignore list flag: top, emacs, vim
  • often used command "ssh [email protected]" suggest add to .ssh/config/

License

GPLv3

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Sergey Chudakov

πŸ’» πŸš‡ πŸ€” 🚧 πŸ“¦

Sergey Morozik

πŸ’»

GitLab repository mirror with CI/CD: https://gitlab.com/CSRedRat/topalias

A Reverse Shell Python Packages

A Reverse Shell Python Packages

1 Nov 03, 2021
A command-line utility that creates projects from cookiecutters (project templates), e.g. Python package projects, VueJS projects.

Cookiecutter A command-line utility that creates projects from cookiecutters (project templates), e.g. creating a Python package project from a Python

18.6k Dec 30, 2022
Amazon Scraper: A command-line tool for scraping Amazon product data

Amazon Product Scraper: 2021 Description A command-line tool for scraping Amazon product data to CSV or JSON format(s). Requirements Python 3 pip3 Ins

49 Nov 15, 2021
argofloats: Simple CLI for ArgoVis and Argofloats

argofloats: Simple CLI for ArgoVis and Argofloats Argo is an international program that collects information from inside the ocean using a fleet of ro

Samapriya Roy 2 Feb 13, 2022
A terminal application for managing images and artifacts in Azure Container Registry.

acr-browser acr-browser is a terminal-based user interface for managing container images and artifacts in Azure Container Registry. πŸš€ This project ow

Sam Dobson 5 Jul 30, 2022
Interactive Redis: A Terminal Client for Redis with AutoCompletion and Syntax Highlighting.

Interactive Redis: A Cli for Redis with AutoCompletion and Syntax Highlighting. IRedis is a terminal client for redis with auto-completion and syntax

2.2k Dec 29, 2022
Investing library and command-line interface inspired by the Bogleheads philosophy

Lakshmi (Screenshot of the lak command in action) Background This project is inspired by Bogleheads forum. Bogleheads focus on a simple but powerful p

Sarvjeet Singh 108 Dec 26, 2022
A Terminal Client for MySQL with AutoCompletion and Syntax Highlighting.

mycli A command line client for MySQL that can do auto-completion and syntax highlighting. HomePage: http://mycli.net Documentation: http://mycli.net/

dbcli 10.7k Jan 07, 2023
Get COVID-19 vaccination schedules from booking.moh.gov.ge in the CLI

vaccination.py Get COVID-19 vaccination schedules from booking.moh.gov.ge in the CLI. Installation $ pip install vaccination Usage Make sure the Pytho

Temuri Takalandze 11 Dec 08, 2021
Voidlx is a terminal cli apps launcher made in python

Voidlx is a terminal cli apps launcher made in python

2 Nov 13, 2021
Fetch is use to get information about anything on the shell using Wikipedia.

Fetch Search wikipedia article on command line [Why This?] [Support the Project] [Installation] [Configuration] Why this? Fetch helps you to quickly l

Yash Singh 340 Dec 18, 2022
Command line parser for common log format (Nginx default).

Command line parser for common log format (Nginx default).

Lucian Marin 138 Dec 19, 2022
Cek Username IG Yang Masih Bisa Dipake

Cek Username IG Cara Install $ pkg update && pkg upgrade $ pkg install python $ pkg install git $ git clone https://github.com/Dekusec/ig-checker $ cd

Deku 3 Nov 28, 2021
A command line tool to query source code from your current Python env

wxc wxc (pronounced "which") allows you to inspect source code in your Python environment from the command line. It is based on the inspect module fro

ClΓ©ment Robert 13 Nov 08, 2022
Browse Hacker News like a haxor: A Hacker News command line interface (CLI).

haxor-news Coworker who sees me looking at something in a browser: "Glad you're not busy; I need you to do this, this, this..." Coworker who sees me s

Donne Martin 3.8k Jan 07, 2023
Color preview command-line tool written in python

Color preview command-line tool written in python

Arnau 1 Dec 27, 2021
πŸ’₯ Share files easily over your local network from the terminal!

Fileshare πŸ“¨ Share files easily over your local network from the terminal! πŸ“¨ Installation # clone the repo $ git clone https://github.com/dopevog/fil

Dopevog 11 Sep 10, 2021
Splitgraph command line client and python library

Splitgraph Overview Splitgraph is a tool for building, versioning and querying reproducible datasets. It's inspired by Docker and Git, so it feels fam

Splitgraph 313 Dec 24, 2022
Bear-Shell is a shell based in the terminal or command prompt.

Bear-Shell is a shell based in the terminal or command prompt. You can navigate files, run python files, create files via the BearUtils text editor, and a lot more coming up!

MichaelBear 6 Dec 25, 2021
dcargs is a tool for generating portable, reusable, and strongly typed CLI interfaces from dataclass definitions.

dcargs is a tool for generating portable, reusable, and strongly typed CLI interfaces from dataclass definitions.

Brent Yi 119 Jan 09, 2023