Skip to main content

Writing a little shell script is a joy. However, once you need to write a slightly more complex application, issues start to rise: You don’t have libraries, hence, you don’t have a way to modularize your application. That makes code reuse a pain, since, if you want to reuse some code from a previous application, you have to copy-and-paste, or some other hack. Well, that’s ugly.
UNIX shells lack a way to modularize scripts and, in sequence, a way to compose those modules. Yes, there were some package managers for bash out there already, but they lacked the flexibility I like. You have to configure stuff, you have to submit your packages to a central organization, etcetera.

shop is a simplistic package manager for UNIX shells (bash, mksh, etc.).

Out of frustration, shop was born. shop is a package manager for UNIX shells; it lets you create packages and compose them. Moreover, it requires almost no configuration (by this I mean you don’t need to write configuration files or submit your packages to a third party). The only requirements are (1) that your package exists as a repository in GitHub and (2) that you put your files in specific folders (bin/ and lib/).

The tool is a single bash script whose only requirements are that you install it and append ~/.shop/.bin to your PATH variable (this last step is only required if you want to run executables coming from the packages). Once you do that, you can start using packages in your scripts! Run shop b to generate a self-contained script that you can then distribute to your users.

Check it out and give it a try!