Need feedback on a Bash scripting tool I made

Hi again :wave:

tl;dr

I made a CLI tool for myself, then finally published it, but didn’t really advertised about. As I know anybody actually using it, I need some feedback. I wish I could keep myself motivated into keeping it going (correct things / validate roadmaps, etc).

Coming from a webDev background (PHP, JS, Rust…) yet loving Bash and the CLI life I was looking for a tool that would let me create/manage/distribute bash scripts and libs like the other languages tooling do.

As I didn’t find it, I made a little one for myself and published it in case it could help others. It’s called Sh:erpa because it helps you carry your packages up the mountain :slight_smile:

With curl, git and gawk installed, we can call…

bash -c "$(curl -sLo- https://sherpa-cli.netlify.app/install.sh)"

It will do the following:

  • A. Install the CLI tools if not already installed.
  • B. Clone the Sh:erpa repo as ~/.sherpa
  • C. Add to the $PATH ~/.sherpa/bin
  • D. Initiate the SherpaCustomDir as ~/sherpa

For the install part, it use β€˜webi’ from webinstall.dev

Creating a Bash version of a Crate

# Check the Dashboard
sherpa
# Create a BashBox
sherpa new <scriptName>

This will create a package directory like Cargo is creating the β€œcrate” package, build the script and make it invoquable as scriptName.

# /home/user/sherpa/boxes/myScript
.
β”œβ”€β”€ data
β”‚   └── file.yaml
β”œβ”€β”€ docs
β”‚   └── myScript.md
β”œβ”€β”€ README.md
β”œβ”€β”€ Sherpa.yaml
β”œβ”€β”€ src
β”‚   β”œβ”€β”€ bin.sh
β”‚   β”œβ”€β”€ _globals.sh
β”‚   β”œβ”€β”€ _header.sh
β”‚   β”œβ”€β”€ _lib.sh
β”‚   β”œβ”€β”€ _options.sh
β”‚   └── __paths.txt
β”œβ”€β”€ target
β”‚   └── local
β”‚       └── myScript
└── tests
    └── example_test.sh

It have unit tests, docs generation from comments, options/flags, partials files (for DRY workflow) with a build step putting all together.

A simple src/bin.sh file could look like:

use "std/fmt"

main() {
  # Data
  dude="$(dataGet "hiker" "name")"

  # Template
  h1 "Greetings adventurer :)"
  hr "+" "-" # ------+------
  br
  p  "Welcome ${txtBlue} ${dude} ${x}!"
}

# Load the main fn if no arguments
[[ "$#" == 0 ]] && main; exit 0

To put it simple, it let us create/manage local scripts & libs, or publisg them and letting people install/update/delete them like a package manager would.

To see all the commands, some links:

Github : SherpaCLI/sherpa
Docs : sherpa-cli.netlify.app
Discord: Invite

You will also find me in the Matrix room, openMandriva’s Chat :wink:

I don’t know if it’s the right forum for that type of posts, but I do hope finding at least one or two people willing to play around with the tool or just share ideas or anything about.

1 Like