{"id":24581287,"url":"https://github.com/sherpacli/sherpa","last_synced_at":"2025-03-17T16:14:46.054Z","repository":{"id":270126625,"uuid":"909020999","full_name":"SherpaCLI/sherpa","owner":"SherpaCLI","description":"Brings RustCargo \u0026 WebDev workflow to Bash, using the terminal as a Browser.","archived":false,"fork":false,"pushed_at":"2025-02-24T15:51:36.000Z","size":10917,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-17T16:14:40.749Z","etag":null,"topics":["bash","bashscripting","cargo","cli","ohmybash","webdev"],"latest_commit_sha":null,"homepage":"https://sherpa-cli.netlify.app","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SherpaCLI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-27T14:55:41.000Z","updated_at":"2025-02-24T15:51:39.000Z","dependencies_parsed_at":"2025-02-04T11:31:28.009Z","dependency_job_id":null,"html_url":"https://github.com/SherpaCLI/sherpa","commit_stats":null,"previous_names":["andikod/sherpa","sherpabasecamp/sherpa","sherpacli/sherpa"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SherpaCLI%2Fsherpa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SherpaCLI%2Fsherpa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SherpaCLI%2Fsherpa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SherpaCLI%2Fsherpa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SherpaCLI","download_url":"https://codeload.github.com/SherpaCLI/sherpa/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244066190,"owners_count":20392407,"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","bashscripting","cargo","cli","ohmybash","webdev"],"created_at":"2025-01-24T02:28:19.438Z","updated_at":"2025-03-17T16:14:46.048Z","avatar_url":"https://github.com/SherpaCLI.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"sherpa.png\" alt=\"Sh:erpa Logo\"/\u003e\n\u003c/p\u003e\n\n## Making Bash scripting, a Fun adventure!\n\n**Sh:erpa** brings Cargo, OhMy and WebDev worflow to Bash scripting, using the Terminal as a browser!\n\n_Because WebDevs should be able to do more than `npm run dev` in a terminal, and Bash lovers don't have to be reduced to `automations` writers, obviously because I like both sides._\n\nDocs: [sherpa-cli.netlify.app](https://sherpa-cli.netlify.app) - Discord: [Community Discord Server](https://discord.gg/66bQJ6cuXG)\n\n### Quick install\n\nBe sure to have curl, git, gawk instaled (and obviously Bash), then run the installer:\n\n```bash\nbash -c \"$(curl -sLo- https://sherpa-cli.netlify.app/install.sh)\"\n```\n\nIt will do the following:\n\n- A. Install the CLI tools if not already installed.\n- B. Clone the Sh:erpa repo as ~/.sherpa\n- C. Add to the $PATH ~/.sherpa/bin\n- D. Initiate the SherpaCustomDir as ~/sherpa\n\nUse a Linux Distribution, still a Linux Distro but from WSL2 or MacOS.\nSee [the docs](https://sherpa-cli.netlify.app/getting-started/installation/prerequisites) for more details.\n\nOnce done, restart the terminal.\n\n### The BashBox Anatomy\n\nUpon `sherpa new myScript` the following is generated:\n\n```bash\n# /home/user/sherpa/boxes/myScript\n.\n├── data\n│   └── file.yaml\n├── docs\n│   └── myScript.md\n├── README.md\n├── Sherpa.yaml\n├── src\n│   ├── bin.sh\n│   ├── _globals.sh\n│   ├── _header.sh\n│   ├── _lib.sh\n│   ├── _options.sh\n│   └── __paths.txt\n├── target\n│   └── local\n│       └── myScript\n└── tests\n    └── example_test.sh\n```\n\nA simple `src/bin.sh` file could look like that:\n\n```bash\nuse \"std/fmt\"\n\nmain() {\n  # Data\n  dude=\"$(dataGet \"hiker\" \"name\")\"\n\n  # Template\n  h1 \"Greetings adventurer :)\"\n  hr \"+\" \"-\" # ------+------\n  br\n  p  \"Welcome ${txtBlue} ${dude} ${x}!\"\n}\n\n# Load the main fn if no arguments\n[[ \"$#\" == 0 ]] \u0026\u0026 main; exit 0\n```\n\nSh:erpa will merge the partials plus those sourced with `use \"dir/file\"`, generate docs, remove comments and blanks, then build the script and make it available for direct invocations. The tool can be picked-up by WebDevs discovering Bash or experienced shell scripters taking advantage of the build, watch and modularity while writing things their own way.\n\n### Local Libraries\n\nTo create your own local library, use something as `sherpa new bob lib`. This would scafold a library version of a BashBox in `$SCD/lib` with that structure:\n\n```bash\n# home/user/sherpa/lib/bob\n.\n├── data\n│   └── example.yaml\n├── lib.sh\n├── README.md\n├── Sherpa.yaml\n└── tests\n    └── example_test.sh\n```\nAny .sh file in `bob/` can be imported in any BashBox with `use \"bob/fileName\"`.\n\n### Install community-made packages\n\nSo far, we can install remote BashBoxes or Libs from Git repositories with:\n\n* BashBox: `sherpa install -n \"\u003csomeName\u003e\" -u \"\u003crepoUrl\u003e\"`\n* BashLib: `sherpa install -n \"\u003csomeName\u003e\" -u \"\u003crepoUrl\u003e\" -t \"lib\"`\n\nMore details in the Documentation, and some available repos to play with soon listed here. If you intend to share some code, great :) come on the Discord Server for timely updates about the publishing part.\n\n## Features\n\nCheck **[the Sh:erpa Website](https://sherpa-cli.netlify.app)** or come talk in the **[Discord](https://discord.gg/66bQJ6cuXG)**, but some included features are:\n\n- Modular + build-step workflow\n- Pug-like semantic formating\n- Non verbose styling options\n- CRUD operations on .yaml files\n- Fetch API data and use JSON in Bash\n- CDN-like imports for remote Libs\n- Integrated UnitTests suite\n- Docs generation from comments\n- Install/Up/Remove remote BashBox or Lib\n- Source local libs with `use \"dir/file\"`\n- Helpers for env variables or package data\n- Helper for `Are you sure? (y/n)` confirm\n- ...to name some of them.\n\n### Commands\n\n| 🔗                                                              | **Command**                  | **Description**                                         |\n| --------------------------------------------------------------- | ---------------------------- | ------------------------------------------------------- |\n| [🔗](https://sherpa-cli.netlify.app/commands/sherpa)            | `sherpa`                     | Dashboard. List of local/remote scripts \u0026 libs          |\n| [🔗](https://sherpa-cli.netlify.app/commands/package/new)       | `sherpa new \u003cmyPackage\u003e`     | Create a BashBox directory and script                   |\n| [🔗](https://sherpa-cli.netlify.app/commands/package/new)       | `sherpa new \u003cmyPackage\u003e lib` | Create a BashLib directory and library file             |\n| [🔗](https://sherpa-cli.netlify.app/commands/package/rm)        | `sherpa rmBox \u003cboxName\u003e`     | Delete a local BashBox and clean registers              |\n| [🔗](https://sherpa-cli.netlify.app/commands/package/rm)        | `sherpa rmLib \u003clibName\u003e`     | Delete a local BashLib and clean registers              |\n| [🔗](https://sherpa-cli.netlify.app/commands/package/install)   | `sherpa install ...`         | See docs. Installing a remote BashBox or Lib            |\n| [🔗](https://sherpa-cli.netlify.app/commands/package/uninstall) | `sherpa uninstall ...`       | See docs. Uninstalling a remote BashBox or Lib          |\n| [🔗](https://sherpa-cli.netlify.app/commands/package/update)    | `sherpa update \u003cboxName\u003e`    | Update an installed BashBox                             |\n| [🔗](https://sherpa-cli.netlify.app/commands/package/update)    | `sherpa upLib \u003clibName\u003e`     | Update an installed BashLib                             |\n| [🔗](https://sherpa-cli.netlify.app/commands/package/update)    | `sherpa self-update`         | Update sh:erpa itself to the lastes version             |\n| [🔗](https://sherpa-cli.netlify.app/commands/package/init)      | `sherpa init`                | Just like 'new' but from an existing directory          |\n| [🔗](https://sherpa-cli.netlify.app/commands/build/build)       | `sherpa b, build`            | Build the myScript.sh and optimise things               |\n| [🔗](https://sherpa-cli.netlify.app/commands/build/watch)       | `sherpa w, watch`            | Watching for changes and build on file-save             |\n| [🔗](https://sherpa-cli.netlify.app/commands/build/run)         | `sherpa r, run`              | Build the script and execute it                         |\n| [🔗](https://sherpa-cli.netlify.app/commands/package/test)      | `sherpa t, test`             | Run tests from the tests/ dir, with BashUnit            |\n| [🔗](https://sherpa-cli.netlify.app/commands/package/test)      | `sherpa self-test`           | Run Sh:erpa's tests from ~/.sherpa/tests                |\n| [🔗](https://sherpa-cli.netlify.app/commands/build/doc)         | `sherpa d, doc`              | Build .md docs from files in src/, with shDoc \u0026 bashDoc |\n| [🔗](https://sherpa-cli.netlify.app/commands/build/compile)     | `sherpa compile`             | Compile myScript.sh to a binary, using SHC              |\n| [🔗](https://sherpa-cli.netlify.app/commands/general/edit)      | `sherpa e, edit bin`         | Open the src/bin.sh file                                |\n| [🔗](https://sherpa-cli.netlify.app/commands/general/edit)      | `sherpa e, edit opt`         | Open the src/\\_options.sh file                          |\n| [🔗](https://sherpa-cli.netlify.app/commands/general/edit)      | `sherpa e, edit yaml`        | Open the Sherpa.yaml file                               |\n| [🔗](https://sherpa-cli.netlify.app/commands/general/edit)      | `sherpa e, edit basecamp`    | Open the ~/.sherpa/basecamp.sh file                     |\n| [🔗](https://sherpa-cli.netlify.app/commands/general/aliases)   | `sherpa aliases`             | List/edit the aliases created with Aliasman             |\n| [🔗](https://sherpa-cli.netlify.app/commands/general/links)     | `sherpa links`               | List the Symlinks in ~/.sherpa/bin. (Old command)       |\n\nSince relative paths are used, some commands need to be used from a package root directoy: build, watch, run, test, doc, compile, edit.\n\n### Aliases\n\nUpon first install, some aliases are created via Aliasman. They can be visualised and eventually changed via `sherpa aliases` command, wich is just a shortcut for `aliasman -e` and opens the file storing them (with the default editor, like vim).\n\n| **alias** | **replace**           | **effect**                      |\n| --------- | --------------------- | ------------------------------- |\n| s         | sherpa                | Shorter `s` commands            |\n| sdd       | cd $HOME/.sherpa      | Jump into the Sherpa Dot Dir    |\n| scd       | cd $HOME/sherpa       | Jump into the Sherpa Custom Dir |\n| boxes     | cd $HOME/sherpa/boxes | Jump into the local Boxes Dir   |\n\nAfter having created a BashBox with `s new \u003cmyScript\u003e`, you can:\n\n- Jump into the directory: `boxes \u0026\u0026 cd myScript`\n- Open the main file: `s e bin`\n- or any other command you need from the Root.\n\n### Credits\n\nSpecial shoutout to every person who has contributed code and genius ideas to the computing world since the first second of the Unix timestamp, making todays coding possible. Plus...\n\n- Rust Cargo: For the perfect package management workflow.\n- OhMyBash/ZSH: For the core/custom architecture inspiration.\n- Webinstall.dev: For making the install possible via the awesome webi tool.\n- Integrated projects: BashUnit, shdoc, bashdoc, SHC, Pathman, Aliasman, WatchExec, ...\n- The non-dev people around me, enduring my talks about CLI, WebDev \u0026 how interesting Sh:erpa can be. They all hope that the Discord will be active enough so I could spare them.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsherpacli%2Fsherpa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsherpacli%2Fsherpa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsherpacli%2Fsherpa/lists"}