{"id":20957225,"url":"https://github.com/axiros/ubc","last_synced_at":"2025-06-15T04:08:42.017Z","repository":{"id":41551085,"uuid":"97134061","full_name":"axiros/ubc","owner":"axiros","description":"Universal Bash Completer","archived":false,"fork":false,"pushed_at":"2019-02-09T18:47:02.000Z","size":964,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-14T05:35:25.027Z","etag":null,"topics":["autocomplete","bash","cli","cli-utilities","help","tabs"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/axiros.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-13T14:49:17.000Z","updated_at":"2023-12-01T07:43:19.000Z","dependencies_parsed_at":"2022-07-08T08:03:14.892Z","dependency_job_id":null,"html_url":"https://github.com/axiros/ubc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/axiros/ubc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axiros%2Fubc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axiros%2Fubc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axiros%2Fubc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axiros%2Fubc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axiros","download_url":"https://codeload.github.com/axiros/ubc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axiros%2Fubc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259919460,"owners_count":22932073,"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":["autocomplete","bash","cli","cli-utilities","help","tabs"],"created_at":"2024-11-19T01:30:20.421Z","updated_at":"2025-06-15T04:08:42.000Z","avatar_url":"https://github.com/axiros.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Universal Bash Completer\n\n\n[![Build Status](https://travis-ci.org/axiros/ubc.svg?branch=master)](https://travis-ci.org/axiros/ubc)\n[![Bash Shell](https://badges.frapsoft.com/bash/v1/bash.png?v=103)](https://github.com/ellerbrock/open-source-badges/)\n\n\u0026nbsp; \n\n\u003cimg src=\"./img/catt.png\" width=400px style=\"border: 0 !important\"\u003e\u003c/img\u003e\n\nThis is a first shot of bash completer which does a little more than 'normal'\ncompleters - and is pretty extensible.\n\nHere a demo:\n\n[![asciicast](https://asciinema.org/a/g3lg9CKBNtx72Vn3LYMw8e50I.png)](https://asciinema.org/a/g3lg9CKBNtx72Vn3LYMw8e50I?autoplay=1\u0026theme=solarized-dark)\n\nThe indexing can be parametrized, to match only substrings or go into the\nstructure only up to certain levels.\n\n## Universal? This is Python!?\n\nYes, currently you can point it to arbitray python modules and it will introspect and complete the names and arguments of classes and functions therein.  \nBut: Completion and execution are two very distinct processes, i.e. the\nintrospected python module could just be used as (a possibly autogenerated) adapter for any other command. Also, the indexing of the python module results in a tree of information, stored as json - you might generate it using other tools.\n\n----\n\n\n# Tech\n\n## Bash Completion\n\nThere is lot of information how completion works in general, no need to repeat.\n`man bash` is the basis.\n\nOne important thing:\n\n### The Point of No Return\n\nThe current line can be changed by the completion results but not left of any\nof these characters:\n\n- ` ` (and we fix that, see below)\n- `\"`\n- `'`\n- `=`\n\nSo anything before those characters can't be reverted by a clever \u003ctab\u003e\ncompleter if its wrongly entered.\n\n\u003e In such situations out strategy is to rather display the docu and not further complete anything\n\n\n\n## Function Completion\n\nThe function completion options are straight forward, the completer actually helps\nhere:\n\nSay we have in our cmd module named 'mod':\n\n    def foo (): pass\n    def foo2(): pass\n\n\nThen we simple exit with:\n\n    mod f\u003ctab\u003e     --\u003e \\nfoo\\nfoo2\\n\n    mod fo\u003ctab\u003e    --\u003e \\nfoo\\nfoo2\\n\n    mod foo\u003ctab\u003e   --\u003e \\nfoo\\nfoo2\\n\n\nIf substring matching is enabled we do also e.g.:\n\n    o\u003ctab\u003e   --\u003e \\nfoo\\nfoo2\\n\n\nand the completer will do the rest, i.e shows you the options.\n\n## Arguments Completion\n\nThis is very much harder. The bash completion works sometimes against us here, e.g. when arranging options, and we have to trick it a bit.\n\n(will explain the details, for now I need the tests only ;-) )\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxiros%2Fubc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxiros%2Fubc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxiros%2Fubc/lists"}