alias-gen


Namealias-gen JSON
Version 0.6.7 PyPI version JSON
download
home_page
SummaryGenerate bash/zsh/fish shell aliases automatically.
upload_time2023-07-30 02:55:39
maintainerAriel Frischer
docs_urlNone
authorAriel Frischer
requires_python
licenseMIT
keywords alias bash zsh fish shell cli command-line command completion abbr generate terminal
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ALIAS-GEN ð‘—Š

![Screenshot](https://gitlab.com/ariel-frischer/alias-gen/-/raw/124474a794a16bbcaffe059a06a32e4064eb76d1/assets/screenshot.png)

Shell aliases are shortcuts or abbreviations for commands that are used in a Unix/Linux shell. They can save you time if you have very long or complex commands that you frequently use. ALIAS-GEN is a script that will create bash/zsh/fish shell aliases automatically to simplify your command-line tasks.

This script will create bash/zsh/fish shell aliases automatically. You can generate a new alias file by following the prompts, or use the `--stdout` option to print results directly in your terminal.

Two types of aliases are suggested, the default algorithm matches all characters incrementally for each command, while the `--use_min_alias` algorithm aims to minimize the total length of characters per command. 
Additionally, `--use_min_alias` does not necessarily match all characters in the command. 

The freq (frequency) column shows how often each command was used. For now, this script only generates aliases for the first word in a command. 
NOTE: Two character commands or less are not processed.

By default, fish shell generates abbr (abbreviations) rather than aliases.

## Requirements

- Python 3.6 or higher.
- No dependences required for installation.

## Install from pypi
```bash
pip install alias-gen
```
https://pypi.org/project/alias-gen/

## CLI Usage
Full Help Menu:
```
aliaser -h
```

Example usage to generate the top 40 aliases:

```
aliaser -n 40
```

With stdout and min_alias:

```
aliaser --stdout --use_min_alias
```

The `-s` argument specifies the shell type. In this example, `fish` shell is used.

```
aliaser -s fish
```

The `-f` argument allows you to specify a custom history file path.

```
aliaser -s zsh -f ~/.custom_zsh_history
```

## How does it work?

The `alias` column is generated by first sorting the most common commands found
in the history file, then aliases are generated for commands more than two
characters. These aliases just try to match character per character the given
command and will continue with more characters if there is a previous common
alias.

The `min_alias` column tries to minimize the total length of chars disregarding
the rule of matching the command character per character. It is generated using
the first char of the command always, followed by easy to reach keyboard characters
defined as QUERTY layout middle row, top row, then bottom row.

## Misc

I recommend using this script along with other shell plugins that help you remember
your alias or abbreviation. One example for fish shell is [fish-abbreviation-tips](https://github.com/gazorby/fish-abbreviation-tips).

## Buy me a coffee

Hope you found this project helpful, consider buying a coffee to show your support.

<a href="https://www.buymeacoffee.com/arielfrischer" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>




            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "alias-gen",
    "maintainer": "Ariel Frischer",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "arielfrischer@gmail.com",
    "keywords": "alias,bash,zsh,fish,shell,cli,command-line,command,completion,abbr,generate,terminal",
    "author": "Ariel Frischer",
    "author_email": "arielfrischer@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/5a/1c/3585d86bb11267b3762ceab118cbe76ea63a5197c4cdadfc83b264e7afad/alias_gen-0.6.7.tar.gz",
    "platform": null,
    "description": "# ALIAS-GEN \ud805\uddca\n\n![Screenshot](https://gitlab.com/ariel-frischer/alias-gen/-/raw/124474a794a16bbcaffe059a06a32e4064eb76d1/assets/screenshot.png)\n\nShell aliases are shortcuts or abbreviations for commands that are used in a Unix/Linux shell. They can save you time if you have very long or complex commands that you frequently use. ALIAS-GEN is a script that will create bash/zsh/fish shell aliases automatically to simplify your command-line tasks.\n\nThis script will create bash/zsh/fish shell aliases automatically. You can generate a new alias file by following the prompts, or use the `--stdout` option to print results directly in your terminal.\n\nTwo types of aliases are suggested, the default algorithm matches all characters incrementally for each command, while the `--use_min_alias` algorithm aims to minimize the total length of characters per command. \nAdditionally, `--use_min_alias` does not necessarily match all characters in the command. \n\nThe freq (frequency) column shows how often each command was used. For now, this script only generates aliases for the first word in a command. \nNOTE: Two character commands or less are not processed.\n\nBy default, fish shell generates abbr (abbreviations) rather than aliases.\n\n## Requirements\n\n- Python 3.6 or higher.\n- No dependences required for installation.\n\n## Install from pypi\n```bash\npip install alias-gen\n```\nhttps://pypi.org/project/alias-gen/\n\n## CLI Usage\nFull Help Menu:\n```\naliaser -h\n```\n\nExample usage to generate the top 40 aliases:\n\n```\naliaser -n 40\n```\n\nWith stdout and min_alias:\n\n```\naliaser --stdout --use_min_alias\n```\n\nThe `-s` argument specifies the shell type. In this example, `fish` shell is used.\n\n```\naliaser -s fish\n```\n\nThe `-f` argument allows you to specify a custom history file path.\n\n```\naliaser -s zsh -f ~/.custom_zsh_history\n```\n\n## How does it work?\n\nThe `alias` column is generated by first sorting the most common commands found\nin the history file, then aliases are generated for commands more than two\ncharacters. These aliases just try to match character per character the given\ncommand and will continue with more characters if there is a previous common\nalias.\n\nThe `min_alias` column tries to minimize the total length of chars disregarding\nthe rule of matching the command character per character. It is generated using\nthe first char of the command always, followed by easy to reach keyboard characters\ndefined as QUERTY layout middle row, top row, then bottom row.\n\n## Misc\n\nI recommend using this script along with other shell plugins that help you remember\nyour alias or abbreviation. One example for fish shell is [fish-abbreviation-tips](https://github.com/gazorby/fish-abbreviation-tips).\n\n## Buy me a coffee\n\nHope you found this project helpful, consider buying a coffee to show your support.\n\n<a href=\"https://www.buymeacoffee.com/arielfrischer\" target=\"_blank\"><img src=\"https://cdn.buymeacoffee.com/buttons/default-orange.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"></a>\n\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Generate bash/zsh/fish shell aliases automatically.",
    "version": "0.6.7",
    "project_urls": null,
    "split_keywords": [
        "alias",
        "bash",
        "zsh",
        "fish",
        "shell",
        "cli",
        "command-line",
        "command",
        "completion",
        "abbr",
        "generate",
        "terminal"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7b4aad43f6f70f9642e36c9d294c3b8abb476ed8e85a49a4ee400158029dbc5d",
                "md5": "f061598aa4fed952ca037b78b3cfb884",
                "sha256": "bc3fde849cc0e4c6aa4aacf34b4ccd2a4f69add19d6af426f6f612580a09d5b1"
            },
            "downloads": -1,
            "filename": "alias_gen-0.6.7-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f061598aa4fed952ca037b78b3cfb884",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 9495,
            "upload_time": "2023-07-30T02:55:38",
            "upload_time_iso_8601": "2023-07-30T02:55:38.171493Z",
            "url": "https://files.pythonhosted.org/packages/7b/4a/ad43f6f70f9642e36c9d294c3b8abb476ed8e85a49a4ee400158029dbc5d/alias_gen-0.6.7-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5a1c3585d86bb11267b3762ceab118cbe76ea63a5197c4cdadfc83b264e7afad",
                "md5": "e67d517c560ef1fe4d7db06aafb4edf6",
                "sha256": "5b40e4beb6647007ad4b20dadda289eadebe3299db01b37913268202fd55bb2c"
            },
            "downloads": -1,
            "filename": "alias_gen-0.6.7.tar.gz",
            "has_sig": false,
            "md5_digest": "e67d517c560ef1fe4d7db06aafb4edf6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 8778,
            "upload_time": "2023-07-30T02:55:39",
            "upload_time_iso_8601": "2023-07-30T02:55:39.558952Z",
            "url": "https://files.pythonhosted.org/packages/5a/1c/3585d86bb11267b3762ceab118cbe76ea63a5197c4cdadfc83b264e7afad/alias_gen-0.6.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-30 02:55:39",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "alias-gen"
}
        
Elapsed time: 0.09386s