{"id":13343214,"url":"https://github.com/elesiuta/elfs","last_synced_at":"2026-05-12T04:33:01.877Z","repository":{"id":57426033,"uuid":"272615704","full_name":"elesiuta/elfs","owner":"elesiuta","description":"Almost, but not quite, entirely unlike aliases","archived":false,"fork":false,"pushed_at":"2021-08-28T19:05:51.000Z","size":59,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-27T10:21:30.230Z","etag":null,"topics":["aliases","command-line-tool","console","fish","launcher","shell","terminal","xonsh"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/elfs/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elesiuta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-16T05:15:29.000Z","updated_at":"2021-12-05T19:13:02.000Z","dependencies_parsed_at":"2022-09-19T06:50:44.927Z","dependency_job_id":null,"html_url":"https://github.com/elesiuta/elfs","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elesiuta%2Felfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elesiuta%2Felfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elesiuta%2Felfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elesiuta%2Felfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elesiuta","download_url":"https://codeload.github.com/elesiuta/elfs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243738985,"owners_count":20340002,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aliases","command-line-tool","console","fish","launcher","shell","terminal","xonsh"],"created_at":"2024-07-29T19:30:42.656Z","updated_at":"2026-05-12T04:33:01.833Z","avatar_url":"https://github.com/elesiuta.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Enhanced aLiases For Shells (Name subject to change)\n### Install from PyPI\n```\npip install elfs\n```\n### Install from source\n```\npython setup.py install --user\n```\n### Enable dynamic tab-completion for fish or xonsh\n```\nelfs --reg-fish\nelfs --reg-xonsh\n```\n### Command Line Interface\n```\nusage: elfs [options] [command [initial-arguments ...]]\n\nAlmost, but not quite, entirely unlike aliases\n\noptional arguments:\n  -h, --help         show this help message and exit\n  -c name            add the command to your spellbook\n  -cc name desc      also add description with command\n  -ccc name desc rs  also add replace-str with command\n  -d path            add a directory path to your config\n  -e .ext path       add an extension and the path to an executable for it\n  -l, --list         list entire collection (or specify: cmd, dir, ext, files)\n  -s, --search       search entire collection for command\n  -n, --dry-run      print command instead of executing it\n  --version          show program's version number and exit\n```\n### Usage Notes\n- Runs on any platform with python 3\n- Unless using search (and select), the default behaviour is to find a command using exact matches only, and is selected in the following order of precedence\n  1. files in order of directories listed in config\n  2. names of commands from spellbook in order listed\n  3. imply file extension if possible and unambiguous\n- Commands without names (or duplicate names of lower precedence) can only be run via search\n- Commands and files with spaces in their names need to be escaped or in quotes\n- The first argument (that is not an option for elfs) is treated as the command or filename and all subsequent arguments are passed to the command or file to be executed (except for commands with a replace-str, see example)\n- Pipes work as expected, you can pipe into or out from any command or file, however if you try piping into a search, it will interpret that as your selection\n### Examples\n- add a directory  \n```\u003e elfs -d ~/scripts```\n- run your script from any directory  \n```\u003e elfs myscript.py arg0 arg1 arg2```\n- file extension is implied only if unambiguous  \n```\u003e elfs myscript arg0 arg1 arg2```\n- add an extension to run a file with a specific executable  \n```\u003e elfs -e .py /path/to/alternative/env/for/python```\n- add a command  \n```\u003e elfs -cc spam \"echo spam to output 3 times\" echo spam spam spam```\n- run the command  \n```\u003e elfs spam```\n\u003e spam spam spam\n- add a command with a replace-str (metavar: rs) and run it  \n```\u003e elfs -ccc menu \"even more spam\" {} echo spam {} spam {}```  \n```\u003e elfs menu bacon eggs```\n\u003e spam bacon spam eggs\n- giving fewer arguments causes them to repeat  \n```\u003e elfs menu bacon```\n\u003e spam bacon spam bacon\n- and extra arguments are passed along as normal  \n```\u003e elfs menu bacon eggs sausage spam```\n\u003e spam bacon spam eggs sausage spam\n- command chaining (needs to run in a shell, elfs uses Popen shell=False)  \n```\u003e elfs -c \"double spam\" bash -c \"echo spam \u0026\u0026 echo spam\"```  \n```\u003e elfs \"double spam\"```\n\u003e spam spam\n- see the command without running it (quotes may appear slightly different)  \n```\u003e elfs -n \"double spam\"```\n\u003e Command: bash -c \"echo spam \u0026\u0026 echo spam\"\n- list all commands and files  \n```\u003e elfs -l```\n- search commands and files with fuzzy matches, then optionally select from a list of matches to execute  \n```\u003e elfs -s dble spam```\n- add a command to quickly edit your config  \n```\u003e elfs -c \"config\" nano ~/.config/elfs/config.json```\n- or add a command to edit your spellbook (you can move this file)  \n```\u003e elfs -c \"spells\" nano ~/.config/elfs/spellbook.json```\n### Add dynamic tab-completion to your scripts\n- create completion rules in the following json format\n```json\n[\n  {\n    \"expression\": \"python_expression_for_rule_1\",\n    \"completions\": [\"option1\", \"option2\\thello\", \"option3\\tworld\"]\n  },\n  {\n    \"expression\": \"python_expression_for_rule_2\",\n    \"completions\": [\"option1\", \"option4\\toptional description\"]\n  }\n]\n```\n- where the python expression is evaluated in a namespace with the following variables\n  - position = current position in the command, where 0 is the current script\n    - eg. `elfs[None] myscript.py[0] option[1] [2]`\n    - position does not increment until the next space `elfs[None] myscript.py[0] option[1] op[2]`\n  - command = command so far, as parsed by shlex\n    - following the same example with `position=2`, `command=[\"myscript.py\", \"option\", \"\"]`\n    - and `command=[\"myscript.py\", \"option\", \"op\"]`\n  - eg. `\"position == 2 and command[1] in ['option1', 'option2']\"`\n- the completions are shown for every expression that evaluates as true\n- the completion rules can be placed in either of the following locations\n  - inside `file_name.ext.elfs.json`, eg. `myscript.py.elfs.json`\n  - or directly enclosed in `file_name.ext` with `# TAB-COMPLETION START` and `# TAB-COMPLETION END`\n```python\n# TAB-COMPLETION START\n[\n  ...\n]\n# TAB-COMPLETION END\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felesiuta%2Felfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felesiuta%2Felfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felesiuta%2Felfs/lists"}