{"id":23340187,"url":"https://github.com/sierrasoftworks/bash-cli","last_synced_at":"2025-04-09T23:41:50.529Z","repository":{"id":46645924,"uuid":"75773750","full_name":"SierraSoftworks/bash-cli","owner":"SierraSoftworks","description":"A command line framework built using nothing but Bash and compatible with anything","archived":false,"fork":false,"pushed_at":"2023-04-04T10:58:46.000Z","size":57,"stargazers_count":108,"open_issues_count":1,"forks_count":31,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-24T01:35:22.557Z","etag":null,"topics":["bash","cli","framework","hacktoberfest"],"latest_commit_sha":null,"homepage":"https://blog.sierrasoftworks.com/2016/12/12/bash-cli/","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/SierraSoftworks.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}},"created_at":"2016-12-06T21:37:05.000Z","updated_at":"2025-01-30T12:19:58.000Z","dependencies_parsed_at":"2024-01-16T22:17:43.816Z","dependency_job_id":"a8d7ce0b-ec1f-492e-83ae-b549b1220538","html_url":"https://github.com/SierraSoftworks/bash-cli","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SierraSoftworks%2Fbash-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SierraSoftworks%2Fbash-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SierraSoftworks%2Fbash-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SierraSoftworks%2Fbash-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SierraSoftworks","download_url":"https://codeload.github.com/SierraSoftworks/bash-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131470,"owners_count":21052819,"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":["bash","cli","framework","hacktoberfest"],"created_at":"2024-12-21T04:19:58.956Z","updated_at":"2025-04-09T23:41:50.508Z","avatar_url":"https://github.com/SierraSoftworks.png","language":"Shell","readme":"# Bash CLI\n**A command line framework built using nothing but Bash and compatible with anything**\n\nBash CLI was borne of the need to provide a common entrypoint into a range of scripts\nand tools for a project. Rather than port the scripts to something like Go or Python,\nor merge them into a single bash script, we opted to build a framework which allows\nand executable to be presented as a sub-command.\n\n## Example\n\n```sh\nbash-cli install my-app\nbash-cli command create start\nmy-app start\n```\n\n## Customizing Bash CLI\nBash CLI is designed to make it as simple as possible for you to create **your** application.\nTo that end, everything that makes it \"Bash CLI\" can be tweaked and changed by simply modifying\nthe following files in your `app` directory.\n\n - **.name** should contain the name of your command line, something like \"My Awesome App\"\n - **.author** is meant to contain your name (or the name of your company)\n - **.version** should contain the version of your app, you can automatically include this using `git describe --tags \u003e app/.version`\n - **.help** should be a short-ish description of what your app does and how people should use it.\n   Don't worry about including help for every command here, or even a command list, Bash CLI will\n   handle that for you automatically.\n\n## Adding Commands\nBash CLI commands are just a stock-standard script with a filename that matches the command name.\nThese scripts are contained within your `app` folder, or within nested folders there if you want\nto create a tree-based command structure.\n\nFor example, the script `app/test/hello` would be available through `cli test hello`. Any arguments\npassed after the command will be curried through to the script, making it trivial to pass values and\noptions around as needed.\n\nThe simplest way to add a command however, is to just run `bash-cli command create [command name]`\nand have it plop down the files for you to customize.\n\n### Contextual Help\nBash CLI provides tools which enable your users to easily discover how to use your command line without\nneeding to read your docs (a travesty, we know). To make this possible, you'll want to add two extra\nfiles for each command.\n\nThe first, `[command].usage` should define the arguments list that your command expects to receive,\nsomething like `NAME [MIDDLE_NAMES...] SURNAME`. This file is entirely optional, leaving it out will\nhave Bash CLI present the command as if it didn't accept arguments.\n\nThe second, `[command].help` is used to describe the arguments that your command accepts, as well as\nprovide a bit of additional context around how it works, when you should use it etc.\n\nIn addition to providing help for commands, you may also provide it for directories to explain what\ntheir sub-commands are intended to achieve. To do this, simply add a `.help` file to the directory.\n\n## Autocomplete\nAutocomplete functionality has been added to make navigating the command line even easier than it\nwas before. To install it, simply add the following to `/etc/bash_completion.d/my-app`.\n\n```sh\nsource \"/opt/my-app/complete\"\ncomplete -F _bash_cli my-app\n```\n\nIf you want to add completion to your commands just create `[command].complete` file which returns array.\n```sh\nOPTIONS=(\"one\" \"two\" \"three\")\necho ${OPTIONS[@]}\n```\n\nSee `example/completion` command as example.\n\nYou also might need to have access to arguments it could be done via:\n `local_args_array=(${COMP_WORDS[@]:${cmd_arg_start}})`\nfor: `cli example completion 1 2 3 4`\n`local_args_array`  will be `'1 2 3 4'`\n\nYou also could use fzf in here to make interactive selects:\n\n```sh\n echo -e \"one\\ntwo\\nthree\" | fzf\n```\n\n## Frequently Asked Questions\n\n1. **Can I use Bash CLI to run things which aren't bash scripts?**\n   Absolutely, Bash CLI simply executes files - it doesn't care whether they're written in Bash, Ruby,\n   Python or Go - if you can execute the file then you can use it with Bash CLI.\n\n1. **Will Bash CLI work on my Mac?**\n   It should, we've built everything to keep it as portable as possible, so if you do have a problem\n   don't hesitate to open a bug report.\n\n1. **Does it allow me to use tab-autocomplete?**\n   As of the latest version, yes it does. The install command included in this repo will automatically\n   set up your `/etc/bash_completion.d/` directory to provide support for your project.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsierrasoftworks%2Fbash-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsierrasoftworks%2Fbash-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsierrasoftworks%2Fbash-cli/lists"}