Setup argsh
There are three ways to setup argsh:
- Install argsh (globally): It will install argsh (globally), so you can use it from anywhere.
- Source argsh in your shell: Source argsh in your Bash script as a library.
- Just copy parts of argsh: You can just copy the parts of argsh that you need and use them in your script.
Install argsh (globally)
This method allows you to load argsh easaly via a shebang in your script.
Also the argsh
script is a wrapper around the argsh
docker image.
This gives you the ability to use the following options to help you to write nice scripts:
- test - Run the tests for your script
- lint - Lint your script
- docs - Generate documentation for your script
- coverage - Generate a coverage report
- minify - Minify your script (experimental)
Globally
You can install argsh globally by running the following command:
Project based
You can also install argsh project based using direnv.
The recommended pattern is to have a directory .bin
in your project root and add it to your PATH
using direnv.
Bootstrap a new project
If you want to quickly bootstrap a new project with argsh just do this
This will setup
- a
.bin
directory in your project root with argsh - a
test
to help you get started with testing - a
scripts
directory with an example script and test - a
.github/workflows
directory with a GitHub Actions workflow - a
.envrc
to initialize your environment
Source argsh in your shell
You can source argsh in your Bash script.
Then, in your script, you can source it like this:
Just copy parts of argsh
Goto the library overview and copy the parts of argsh that you need and use them in your script.