{"id":13537015,"url":"https://github.com/realeroberto/bashlets","last_synced_at":"2025-04-10T17:42:35.606Z","repository":{"id":36585513,"uuid":"40891491","full_name":"realeroberto/bashlets","owner":"realeroberto","description":"An experiment in extending the command-line interface.","archived":false,"fork":false,"pushed_at":"2021-05-03T22:04:29.000Z","size":1006,"stargazers_count":74,"open_issues_count":0,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-07-30T13:13:29.769Z","etag":null,"topics":["bash","bashlets","library","linux","shell","toolbox"],"latest_commit_sha":null,"homepage":"https://bashlets.reale.info","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/realeroberto.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":"2015-08-17T12:06:55.000Z","updated_at":"2024-06-24T18:07:30.000Z","dependencies_parsed_at":"2022-09-12T01:31:31.286Z","dependency_job_id":null,"html_url":"https://github.com/realeroberto/bashlets","commit_stats":null,"previous_names":["reale/bashlets"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realeroberto%2Fbashlets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realeroberto%2Fbashlets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realeroberto%2Fbashlets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realeroberto%2Fbashlets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/realeroberto","download_url":"https://codeload.github.com/realeroberto/bashlets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248262198,"owners_count":21074262,"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","bashlets","library","linux","shell","toolbox"],"created_at":"2024-08-01T09:00:53.516Z","updated_at":"2025-04-10T17:42:35.586Z","avatar_url":"https://github.com/realeroberto.png","language":"Shell","readme":"# bashlets\n\n![Uptime Robot](https://img.shields.io/uptimerobot/status/m788032555-3c8b57a632434e90a5085acf)\n[![Build Status](https://travis-ci.com/reale/bashlets.svg?branch=master)](https://travis-ci.com/reale/bashlets)\n[![Read the Docs](https://readthedocs.org/projects/bashlets/badge/?version=latest)](http://bashlets.readthedocs.io/en/latest/?badge=latest)\n\n\u003e /'baʃlɪt/\n\u003e \n\u003e *noun: A tiny piece of shell code.*\n\n## Introduction\n\nBashlets is a new modular extensible toolbox for Bash, written in Bash.\n\nThe project is still in its early days, yet it is quite usable and the core features are already there: smart loading of modules, integration with git, partial OO support, and more.\n\nThe project has a threefold aim:\n\n* bringing together the largest possible corpus of useful pieces of reusable Bash code, with everything organized in as neat a fashion as we can think of\n* shielding the user from some of the Bash technicalities and idiosyncrasies\n* writing a consistent and portable API (well, kind of) towards the operating system\n\nI want to stress the fact that this is not a generically-compliant POSIX shell project; on the contrary, the aim of the project is to write code that will run on (and require) Bash. As to the rest of the environment, however, the long-term goal is to get rid of dependencies on external tools as far as it is possible (or reasonable) to do so, even though at present the code does assume a reasonably standard GNU/Linux system.\n\n\n## Rationale\n\nTODO\n\n\n## Contributing\n\nOf course there is so much work to do, and I'd be delighted if somebody is willing to step in with code, enhancements, suggestions, and of course test cases and bug reports!\n\n\n## Requirements\n\nA reasonably sane GNU environment is assumed to be at hand. More specifically, you need:\n\n* Bash\n* Git\n* GNU Coreutils\n* GNU grep, sed, awk\n* curl\n* the [jq](https://stedolan.github.io/jq/) command-line JSON processor\n* the [gitty](https://github.com/reale/gitty) Bash client for the GitHub API\n* Make\n\nTo run the test suite, you need Sam Stephenson's [Bash Automated Testing System](https://github.com/sstephenson/bats).\n\nTo check for proper programming, you need [ShellCheck](https://www.shellcheck.net/).\n\nExtension packages may have additional requirements.\n\n\n## Installing\n\n\t$ git clone https://github.com/reale/bashlets.git\n\t$ cd bashlets\n\t$ make install\n\nThat's all!\n\nTo run the test suite:\n\n    $ make test\n\nIf you want to check for proper programming:\n\n    $ make lint\n\n\n## Extensions\n\nThere is a growing corpus of additional packages available. To install package `package` just do\n\n    $ bashlets install -D package\n\n\n## Examples\n\n### Basic interaction\n\n\t$ source bashlets core::library::interact\n\t$ bash$$ interact say_hello\n\n\tHello, this is bashlets 1.0 speaking!\n\n\n### Data types: generating a random printable string of arbitrary length\n\n\t$ source bashlets core::datatype::string\n\n\t$ bash$$ string random 32\n\t6J-%.v(M)`N_de\u00262fvdVd;yy R;FRt=[\n\n### Data types: generating and validating UUIDs\n\n\t$ source bashlets core::datatype::uuid\n\n\t$ bash$$ uuid random\n\t2fc83419-df73-4cfd-bf9d-85634c8370fd\n\n\t$ bash$$ uuid validate 2fc83419-df73-4cfd-bf9d-85634c8370fd || echo INVALID\n\t$ bash$$ uuid validate 2fc83419-df73-4cfd-_f9d-85634c8370fd || echo INVALID\n\tINVALID\n\n### Data types: comparing version strings\n\n\t$ source bashlets core::datatype::semver\n\n\t$ bash$$ semver sort 1.44 1.4 1.4.4 1.4.4a 1.4-1234\n\t1.4\n\t1.4-1234\n\t1.4.4\n\t1.4.4a\n\t1.44\n\n### Cache: passing data around\n\n\t$ source bashlets core::cache::fs\n\n\t$ cache=$(bash$$ fs create)\n\n\t$ # set key/value in a subshell...\n\t$ ( bash$$ fs set $cache question 'To be, or not to be...' )\n\n\t$ # read value in the parent shell\n\t$ bash$$ fs get $cache question\n\tTo be, or not to be...\n\n\t$ bash$$ fs destroy $cache\n\n### Character streams: converting formats without external tools\n\n\t$ source bashlets core::stream::convert\n\n\t$ cat \u003c\u003c ??? | bash$$ convert unix2dos | file -\n\t\u003e Shall I compare thee to a summer's day?\n\t\u003e Thou art more lovely and more temperate.\n\t\u003e Rough winds do shake the darling buds of May,\n\t\u003e And summer's lease hath all too short a date...\n\t\u003e ???\n\t/dev/stdin: ASCII text, with CRLF line terminators\n\n### Math: manipulating complex numbers\n\n\t$ source bashlets core::math::icomplex\n\n\t$ i=$(bash$$ icomplex create 0 1)\n\t$ bash$$ icomplex to_real $(bash$$ icomplex square $i)\n\t-1\n\n### User eXperience: enjoying a basic REPL cycle\n\n\t$ source bashlets core::ux::repl\n\n\t$ bash$$ repl start\n\t\u003e quit\n\t$\n\n\n## Design Notes\n\nTODO\n\n\n## Style Guide\n\nTODO\n\n\n## Bibliography\n\n### Reference Works\n\n- [Bash Reference Manual](https://www.gnu.org/software/bash/manual/bash.html)\n- [The Open Group Base Specifications Issue 7, _Shell \u0026 Utilities_](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/contents.html)\n\n### Bash Hacking\n\n- [Advanced Bash-Scripting Guide](http://www.tldp.org/LDP/abs/html/index.html)\n- [BashGuide](http://mywiki.wooledge.org/BashGuide)\n- [The Bash Hackers Wiki](http://wiki.bash-hackers.org/)\n- [Bash Design Patterns](http://stackoverflow.com/questions/78497/design-patterns-or-best-practices-for-shell-scripts)\n- [BASH Frequently Asked Questions](http://mywiki.wooledge.org/BashFAQ)\n- [Bash Pitfalls](http://mywiki.wooledge.org/BashPitfalls)\n\n### Bash Criticism\n\n- [Bash Weaknesses](http://mywiki.wooledge.org/BashWeaknesses)\n- [Bash utility script library](http://stackoverflow.com/questions/11369522/bash-utility-script-library)\n\n### Special Topics\n\n- [Why is printf better than echo?](http://unix.stackexchange.com/questions/65803/why-is-printf-better-than-echo)\n- [How to check if a variable is set in Bash?](http://stackoverflow.com/questions/3601515/how-to-check-if-a-variable-is-set-in-bash)\n- [Setting `IFS` for a single statement](http://unix.stackexchange.com/questions/92187/setting-ifs-for-a-single-statement)\n- [`readarray` (aka `mapfile`) issue](http://unix.stackexchange.com/questions/136206/readarray-or-pipe-issue)\n\n### Tools\n\n- [Match command-line arguments to their help text](http://explainshell.com/)\n- [Bash/Tcsh Comparison Table](http://joelinoff.com/blog/?page_id=235)\n\n### Collections of scripts\n\n- [Bash One-Liners](http://bashoneliners.com/)\n- [Awesome Shell](https://github.com/alebcay/awesome-shell)\n\n### Frameworks\n\n- [bang.sh](https://github.com/bashlets/bangsh)\n- [bashinator](https://github.com/wschlich/bashinator)\n- [bash manager](https://github.com/lingtalfi/bashmanager)\n- [bash toolbox](https://github.com/hallison/bash-toolbox)\n- [bash-it](https://github.com/Bash-it/bash-it)\n- [bashworks](https://github.com/jpic/bashworks)\n- [blp](https://github.com/mikelking/blp)\n- [mbfl](https://github.com/marcomaggi/mbfl)\n- [oobash](https://github.com/domachine/oobash)\n- [shesfw](https://code.google.com/archive/p/shesfw/)\n- [ticktick](https://github.com/kristopolous/TickTick)\n\n### Special-purpose libraries\n\n- [bash automated testing system](https://github.com/sstephenson/bats)\n- [lib_MTA](https://github.com/reale/lib_MTA)\n- [log4sh](https://sites.google.com/a/forestent.com/projects/log4sh)\n","funding_links":[],"categories":["Shell","Applications","bash"],"sub_categories":["Cool Things"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frealeroberto%2Fbashlets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frealeroberto%2Fbashlets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frealeroberto%2Fbashlets/lists"}