{"id":17142631,"url":"https://github.com/qjack001/bash-template","last_synced_at":"2026-04-28T21:01:57.176Z","repository":{"id":96742938,"uuid":"361935745","full_name":"qjack001/bash-template","owner":"qjack001","description":"A template for creating simple command-line-interfaces.","archived":false,"fork":false,"pushed_at":"2021-04-27T02:17:15.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T09:12:45.592Z","etag":null,"topics":["bash","cli","command-line","template"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/qjack001.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-27T00:50:31.000Z","updated_at":"2023-02-13T18:42:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"96fd6428-deaa-4dd4-ab9f-c90af32a4f1e","html_url":"https://github.com/qjack001/bash-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/qjack001/bash-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qjack001%2Fbash-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qjack001%2Fbash-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qjack001%2Fbash-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qjack001%2Fbash-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qjack001","download_url":"https://codeload.github.com/qjack001/bash-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qjack001%2Fbash-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32399010,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T19:38:08.556Z","status":"ssl_error","status_checked_at":"2026-04-28T19:37:55.688Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bash","cli","command-line","template"],"created_at":"2024-10-14T20:32:03.930Z","updated_at":"2026-04-28T21:01:57.161Z","avatar_url":"https://github.com/qjack001.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003e\n\t\u003ca href=\"https://github.com/qjack001/bash-template?=new\"\u003e\n\t\t\u003cimg src=\"logo.svg\" width=\"170.13\" height=\"24\" alt=\"template.sh logo\"\u003e\n\t\u003c/a\u003e\n\u003c/h1\u003e\n\n[ [How to use](#how-to-use) ][ [Installing your CLI](#installing-your-cli) ][ [Contributing](#contributing) ][ [Attribution](#attribution) ][ [Examples](#examples) ]\n\n\u003cbr\u003e\n\nA template file for creating simple command-line-interfaces. Includes commonly needed functions, such as coloring text and getting input, as well as hard-to-implement features, like a keyboard-navigatable menu.\n\n### How to use\n\nTo get started, clone this repo (or hit the \u003ckbd\u003eUse this template\u003c/kbd\u003e button) and open the [`template.sh`](template.sh) file in a text editor. Fill-in your CLI's information (marked by `\u003cangle brackets\u003e`), and add your functions to the file — see the default [`no_args`](template.sh#L45) function for an example of the \"library\" in-use. Add your function to [`handel_input`](template.sh#L14)'s list of commands, and test it out:\n\n```bash\nsh template.sh \u003cyour-command-name\u003e\n```\n\n\n\nRename the template file to `\u003cyour-program-name\u003e.sh` and push your changes to Github (or any other git host). Find the URL to the raw copy of the script and replace `source_url` with it. Push the changes again, and then try fetching it by running:\n\n```bash\nsh \u003cyour-program-name\u003e.sh update\n```\n\nWhen it prompts you to install the script, choose \"no\" for now. **Important:** make sure you've commited all your changes before running the `update` command, as it will overwrite your `\u003cyour-program-name\u003e.sh` file (if you are in your repo's directory).\n\n### Installing your CLI\n\nTo install it globally (currently moves it to `/usr/local/bin/`), run:\n\n```bash\nsh \u003cyour-program-name\u003e.sh install\n```\n\n**Important:** make sure you have commited all your changes before running the `install` command, as it will _move_ the script not copy (thus re-moving it from your repo).\n\nAlternatively, if you do not have access or don't want to install it there, simply add an alias to your `.bash_profile` or `.bashrc` (_and don't forget to `source` them after!_):\n\n```bash\nalias \u003cyour-program-name\u003e=\"sh ~/path/to/\u003cyour-program-name\u003e.sh\"\n```\n\nNow you should be able to run the program from any directory.\n\n```bash\n\u003cyour-program-name\u003e --version\n```\n\n### Contributing\n\nPlease feel free to open an issue or pull request if you notice any bugs. If you find that there is anything missing that you commonly use, please add it.\n\n### Attribution\n\nIf you would like to provide attribution, you can do so by linking to this repository (https://github.com/qjack001/bash-template), but it is not required.\n\n### Examples\n\nProjects which use this template:\n\n- [`todo`](https://github.com/qjack001/todo) — A simple todo-list app (doesn't use the template verbatim, but does use most of it).\n- [`jit`](https://github.com/qjack001/jit) — A `git` replacment that's more like Github Desktop (doesn't use the template at all, but rather the template was made based on how I did things there).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqjack001%2Fbash-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqjack001%2Fbash-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqjack001%2Fbash-template/lists"}