Hi again
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
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
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.