topalias


Nametopalias JSON
Version 3.11.0 PyPI version JSON
download
home_pagehttps://github.com/CSRedRat/topalias
SummaryLinux bash alias generator
upload_time2025-11-03 05:10:08
maintainerNone
docs_urlNone
authorSergey Chudakov
requires_python<3.14,>=3.9
licenseGPL-3.0-or-later
keywords top bash zsh alias aliases linux python shell cli console terminal utility tool history sysadmin
VCS
bugtrack_url
requirements click setuptools
Travis-CI
coveralls test coverage
            # topalias

[![Test Status](https://github.com/CSRedRat/topalias/workflows/Test/badge.svg?branch=master)](https://github.com/CSRedRat/topalias/actions?query=workflow%3ATest)
[![Coverage](https://coveralls.io/repos/github/CSRedRat/topalias/badge.svg?branch=master)](https://coveralls.io/github/CSRedRat/topalias?branch=master)
[![GitLab pipeline](https://gitlab.com/CSRedRat/topalias/badges/master/pipeline.svg)](https://gitlab.com/CSRedRat/topalias/-/pipelines)
[![Python Version](https://img.shields.io/pypi/pyversions/topalias.svg)](https://pypi.org/project/topalias/)
[![Downloads](https://static.pepy.tech/personalized-badge/topalias?period=total&units=international_system&left_color=black&right_color=orange&left_text=Downloads)](https://pepy.tech/project/topalias)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
[![DeepSource](https://static.deepsource.io/deepsource-badge-light-mini.svg)](https://deepsource.io/gh/CSRedRat/topalias/?ref=repository-badge)

[topalias](https://github.com/CSRedRat/topalias) - Linux alias generator from bash/zsh command history with statistics, written on [Python](https://pypi.org/project/topalias/).

## 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](https://pypi.org/project/topalias/):

```bash
pip3 install -U --user topalias
```

From source:

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

Run as python script without install:

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

### Install requirements

```bash
sudo apt install python3 python3-pip -y
```

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

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

## Usage

![generated bash aliases](https://github.com/CSRedRat/topalias/raw/master/images/bash_screenshot.png "Bash topalias output")

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

```bash
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:

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

Also you can use topalias utility in [Bash for Git](https://gitforwindows.org) on Windows and in [WSL](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux).

### 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 username@servername" suggest add to .ssh/config/

## License

[GPLv3](https://github.com/CSRedRat/topalias/blob/master/LICENSE)

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
  <tr>
    <td align="center"><a href="https://github.com/CSRedRat"><img src="https://avatars1.githubusercontent.com/u/1287586?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Sergey Chudakov</b></sub></a><br /><a href="https://github.com/CSRedRat/topalias/commits?author=CSRedRat" title="Code">💻</a> <a href="#infra-CSRedRat" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#ideas-CSRedRat" title="Ideas, Planning, & Feedback">🤔</a> <a href="#maintenance-CSRedRat" title="Maintenance">🚧</a> <a href="#platform-CSRedRat" title="Packaging/porting to new platform">📦</a></td>
    <td align="center"><a href="https://github.com/morozsm"><img src="https://avatars2.githubusercontent.com/u/4393731?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Sergey Morozik</b></sub></a><br /> <a href="#maintenance-morozsm" title="Maintenance">🚧</a> <a href="#platform-morozsm" title="Packaging/porting to new platform">📦</a><a href="https://github.com/CSRedRat/topalias/commits?author=morozsm" title="Code">💻</a></td>
  </tr>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

_GitLab repository mirror with CI/CD: [https://gitlab.com/CSRedRat/topalias](https://gitlab.com/CSRedRat/topalias)_



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/CSRedRat/topalias",
    "name": "topalias",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.14,>=3.9",
    "maintainer_email": null,
    "keywords": "top, bash, zsh, alias, aliases, linux, python, shell, cli, console, terminal, utility, tool, history, sysadmin",
    "author": "Sergey Chudakov",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/5f/9e/b4bc035d3160ce0383d9b16fcbb8d88a7e7d18f7a65d2816b8adf18671e3/topalias-3.11.0.tar.gz",
    "platform": null,
    "description": "# topalias\n\n[![Test Status](https://github.com/CSRedRat/topalias/workflows/Test/badge.svg?branch=master)](https://github.com/CSRedRat/topalias/actions?query=workflow%3ATest)\n[![Coverage](https://coveralls.io/repos/github/CSRedRat/topalias/badge.svg?branch=master)](https://coveralls.io/github/CSRedRat/topalias?branch=master)\n[![GitLab pipeline](https://gitlab.com/CSRedRat/topalias/badges/master/pipeline.svg)](https://gitlab.com/CSRedRat/topalias/-/pipelines)\n[![Python Version](https://img.shields.io/pypi/pyversions/topalias.svg)](https://pypi.org/project/topalias/)\n[![Downloads](https://static.pepy.tech/personalized-badge/topalias?period=total&units=international_system&left_color=black&right_color=orange&left_text=Downloads)](https://pepy.tech/project/topalias)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)\n[![DeepSource](https://static.deepsource.io/deepsource-badge-light-mini.svg)](https://deepsource.io/gh/CSRedRat/topalias/?ref=repository-badge)\n\n[topalias](https://github.com/CSRedRat/topalias) - Linux alias generator from bash/zsh command history with statistics, written on [Python](https://pypi.org/project/topalias/).\n\n## Features\n\n-   Generate short alias for popular command from bash/zsh shell history\n-   Command history statistics & analytics\n-   Parametrised input\n-   Console help for all commands, options and arguments\n-   Shell workflow hints\n\n## Installation\n\nFrom [pypi.org repository](https://pypi.org/project/topalias/):\n\n```bash\npip3 install -U --user topalias\n```\n\nFrom source:\n\n```bash\ngit clone https://github.com/CSRedRat/topalias\npython3 topalias/setup.py install --user\n```\n\nRun as python script without install:\n\n```bash\ngit clone https://github.com/CSRedRat/topalias\npython3 topalias/topalias/cli.py -h\n```\n\n### Install requirements\n\n```bash\nsudo apt install python3 python3-pip -y\n```\n\nAdd PATH environment variable for run Python tools as Linux utility:\n\n```bash\necho \"export PATH=$PATH:$HOME/.local/bin\" >> ~/.bashrc\nsource ~/.bashrc\n```\n\n## Usage\n\n![generated bash aliases](https://github.com/CSRedRat/topalias/raw/master/images/bash_screenshot.png \"Bash topalias output\")\n\nWithout parameters utility check if you use alias in ~/.bash_aliases - analyze and print usage statistics, then find new simple aliases\n\n```bash\npython3 -m topalias  # run as python module\ntopalias  # check aliases and print suggestion bash command history\ntopalias -h  # print help\ntopalias --zsh  # work with zsh shell command history\ntopalias --min=2  # set minimal length for generated acronym filter, so that exclude some short command and find long, hard, usable command\ntopalias --debug history  # only analyze local bash history and print filtered rows\n```\n\nFiles path search order:\n\n-   directory from execution parameter\n-   .bash_history in . current directory\n-   .bash_history in ~ user home directory\n-   example development files in topalias/data\n\nYou can change dot files search path to another user home directory:\n\n```bash\ntopalias -f /home/user  # or topalias --path /home/user\n```\n\nAlso you can use topalias utility in [Bash for Git](https://gitforwindows.org) on Windows and in [WSL](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux).\n\n### Documentation\n\n```\nUsage: topalias [OPTIONS] COMMAND [ARGS]\n\nOptions:\n  -l, --min INTEGER     Print alias acronym not less that value. Default: 1\n  -c, --count INTEGER   Print specified number acronym suggestions. Default:\n                        20\n\n  --filter              Filter used aliases in history. Default: False\n  -z, --zsh             Use zsh shell history file .zsh_history. Default:\n                        False\n\n  -f, --path TEXT       Change custom directory for files: .bash_aliases,\n                        .bash_history, .zsh_history\n\n  --version             Print current program version and check latest on\n                        pypi.org.\n\n  --debug / --no-debug  Enable debug strings in output.\n  -h, --help            Show this message and exit.\n\nCommands:\n  hint     Print all hints.\n  history  Print bash history file.\n  version  Get program current and available version.\n```\n\n## TODO\n\n-   check if alias name already used\n-   check if alias already added\n-   add any another acronym algorithm with semantic\n-   more statistics & analytics (used dir, utils, parameters, time)\n-   alias max length parameter\n-   command ignore list flag: top, emacs, vim\n-   often used command \"ssh username@servername\" suggest add to .ssh/config/\n\n## License\n\n[GPLv3](https://github.com/CSRedRat/topalias/blob/master/LICENSE)\n\n## Contributors \u2728\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<table>\n  <tr>\n    <td align=\"center\"><a href=\"https://github.com/CSRedRat\"><img src=\"https://avatars1.githubusercontent.com/u/1287586?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Sergey Chudakov</b></sub></a><br /><a href=\"https://github.com/CSRedRat/topalias/commits?author=CSRedRat\" title=\"Code\">\ud83d\udcbb</a> <a href=\"#infra-CSRedRat\" title=\"Infrastructure (Hosting, Build-Tools, etc)\">\ud83d\ude87</a> <a href=\"#ideas-CSRedRat\" title=\"Ideas, Planning, & Feedback\">\ud83e\udd14</a> <a href=\"#maintenance-CSRedRat\" title=\"Maintenance\">\ud83d\udea7</a> <a href=\"#platform-CSRedRat\" title=\"Packaging/porting to new platform\">\ud83d\udce6</a></td>\n    <td align=\"center\"><a href=\"https://github.com/morozsm\"><img src=\"https://avatars2.githubusercontent.com/u/4393731?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Sergey Morozik</b></sub></a><br /> <a href=\"#maintenance-morozsm\" title=\"Maintenance\">\ud83d\udea7</a> <a href=\"#platform-morozsm\" title=\"Packaging/porting to new platform\">\ud83d\udce6</a><a href=\"https://github.com/CSRedRat/topalias/commits?author=morozsm\" title=\"Code\">\ud83d\udcbb</a></td>\n  </tr>\n</table>\n\n<!-- markdownlint-restore -->\n<!-- prettier-ignore-end -->\n\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n\n_GitLab repository mirror with CI/CD: [https://gitlab.com/CSRedRat/topalias](https://gitlab.com/CSRedRat/topalias)_\n\n\n",
    "bugtrack_url": null,
    "license": "GPL-3.0-or-later",
    "summary": "Linux bash alias generator",
    "version": "3.11.0",
    "project_urls": {
        "Homepage": "https://github.com/CSRedRat/topalias",
        "Repository": "https://github.com/CSRedRat/topalias"
    },
    "split_keywords": [
        "top",
        " bash",
        " zsh",
        " alias",
        " aliases",
        " linux",
        " python",
        " shell",
        " cli",
        " console",
        " terminal",
        " utility",
        " tool",
        " history",
        " sysadmin"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4c424e27aa4cd581d74dc4434d6551a4457c07b27f8490e025656fd86fea07d4",
                "md5": "1adbd88c58cd55a82ee01442ba33dad0",
                "sha256": "5cf57713eaaba86f759d2cf94df05204ae68412157d1da154f4b9fb067b5db8e"
            },
            "downloads": -1,
            "filename": "topalias-3.11.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1adbd88c58cd55a82ee01442ba33dad0",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": "<3.14,>=3.9",
            "size": 32460,
            "upload_time": "2025-11-03T05:10:02",
            "upload_time_iso_8601": "2025-11-03T05:10:02.617050Z",
            "url": "https://files.pythonhosted.org/packages/4c/42/4e27aa4cd581d74dc4434d6551a4457c07b27f8490e025656fd86fea07d4/topalias-3.11.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5f9eb4bc035d3160ce0383d9b16fcbb8d88a7e7d18f7a65d2816b8adf18671e3",
                "md5": "5bb75538aac69c74fe19a3287f6118cc",
                "sha256": "8d89460e0dfe6ed0fd52788bd36749576991808f5dd4a1fb836068026ffe139b"
            },
            "downloads": -1,
            "filename": "topalias-3.11.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5bb75538aac69c74fe19a3287f6118cc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.14,>=3.9",
            "size": 28843,
            "upload_time": "2025-11-03T05:10:08",
            "upload_time_iso_8601": "2025-11-03T05:10:08.068359Z",
            "url": "https://files.pythonhosted.org/packages/5f/9e/b4bc035d3160ce0383d9b16fcbb8d88a7e7d18f7a65d2816b8adf18671e3/topalias-3.11.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-11-03 05:10:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "CSRedRat",
    "github_project": "topalias",
    "travis_ci": true,
    "coveralls": true,
    "github_actions": true,
    "requirements": [
        {
            "name": "click",
            "specs": [
                [
                    ">=",
                    "8.0.2"
                ],
                [
                    "<",
                    "8.1.8"
                ]
            ]
        },
        {
            "name": "setuptools",
            "specs": [
                [
                    "<",
                    "58.0.0"
                ],
                [
                    ">=",
                    "57.4.0"
                ]
            ]
        }
    ],
    "tox": true,
    "lcname": "topalias"
}
        
Elapsed time: 1.43377s