Skip to main content

Linux bash aliases generator

Project description

topalias

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

topalias - Linux bash/zsh alias generator and statistics from command history, 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:

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

Usage

generated bash aliases

Syntax: topalias [OPTIONS] COMMAND [ARGUMENTS]

Without command utility check if you use alias in ~/.bash_aliases - analyze and print usage statistics, offers to 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.

TODO

  • multiline command in history
  • add any another acronym algorithm with semantic
  • more statistics & analytics (used dir, utils, parameters, time)
  • alias max length parameter

Please add you feature requests: https://github.com/CSRedRat/topalias/issues/new

License

GPLv3

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Sergey Chudakov

💻 🚇 🤔 🚧 📦 🧑‍🏫 💡

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

GitHub Pages: https://csredrat.github.io/topalias/

Version history

We follow Semantic Versions.

Version 2.0.0

  • Add zsh shell support (-z/--zsh flag)
  • Add version check (version/--version)
  • --filter flag exclude used alias from command top chart
  • --debug mode
  • -f change dot files search path
  • -c count suggestion parameter
  • Add "example" command for give aliases example
  • Add aliases usage statistic

Version 1.1.7

  • Build and publish working package

Version 0.1.0

  • Initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

topalias-2.0.5.linux-x86_64.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

topalias-2.0.5-py2.py3-none-any.whl (10.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file topalias-2.0.5.linux-x86_64.tar.gz.

File metadata

  • Download URL: topalias-2.0.5.linux-x86_64.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.6

File hashes

Hashes for topalias-2.0.5.linux-x86_64.tar.gz
Algorithm Hash digest
SHA256 c30064f2da7f13cde69c01704408c2bbe4b4b67c98f2be32af29aa8f63fa9c49
MD5 9940b73a6069e11f41d463cb8fc0c27e
BLAKE2b-256 827c3aadba2e007d4535f3a1b6215b741d379b7de9cf29037a99e5f2505a759d

See more details on using hashes here.

File details

Details for the file topalias-2.0.5-py2.py3-none-any.whl.

File metadata

  • Download URL: topalias-2.0.5-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.6

File hashes

Hashes for topalias-2.0.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 23037a7074f63a87b1e3f1c0e5de2f7af1a848227acfc03797b5419b6b8a2f72
MD5 454e352fb18d5c977e2f20d523a78d3f
BLAKE2b-256 a6d9468050f7367f3fc1658f1894e1ecbbfe7dc81a586d580f97b10005efeb0f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page